[TOC]
cat /etc/lsb-release
In control pannel, power management.
Mirrors can be managed using pacman-mirrors
command, with official illustration here.
Manjaro mirror list can be obtained from web
-
One can get the newest mirror from net, then insert into
/etc/pacman.d/mirrorlist
. -
One can use the following command to auto update mirrors:
sudo pacman-mirrors -c all
-
Configure Chinese mirror:
sudo pacman-mirrors -i -c China -m rank
-
Open
/etc/pacman.conf
:sudo code /etc/pacman.conf
-
At the end, type in:
[archlinuxcn] SigLevel = TrustAll //remove after install archlinuxcn-keyring Server = http://repo.archlinuxcn.org/$arch
-
Update package list:
sudo pacman -Syy
-
Sync package and updates:
sudo pacman -Syu
sudo pacman -S archlinuxcn-keyring
pacman -Q -l <pkg name>
pactree <pkg name>
pacman -Sc
- Open
pamac-manager
pamac-manager
- Select [首选项] from top right corner
- Select [AUR] tab, tick the enable option
- Goto AUR page for the package:
- Click
View Changes
- Pick target published version:
- Click
download
: - Unzip the downloaded file
- CD into the unzipped directory, run
makepkg -si
Using openvpn(installed already):
-
Open
/etc/resolv.conf
:sudo code /etc/resolv.conf
-
Remove everything and type in the following and save:
nameserver 103.86.96.100 nameserver 103.86.99.100
-
Connecting using openvpn using one of the configuration file from
ls ./OpenVPN/
:sudo openvpn --config ./OpenVPN/us7097.nordvpn.com.udp.ovpn
-
Type in account info:
Username: Password:
Open /etc/resolv.conf
, remove everything and type in :
# Generated by NetworkManager
nameserver 192.168.0.1
172.104.106.200 - jp598.nordvpn.com
139.162.111.224 - jp599.nordvpn.com
139.162.118.94 - jp599.nordvpn.com
45.79.111.177 - us5783.nordvpn.com
45.79.111.208 - us5784.nordvpn.com
45.79.64.4 - us5784.nordvpn.com
45.79.64.48 - us5783.nordvpn.com
178.79.134.237 - uk2326.nordvpn.com
109.74.193.212 - uk2326.nordvpn.com
176.58.98.210 - uk2326.nordvpn.com
After insalling archlinuxcn-keyring
each time open chromium first time will asking for password:
The following are steps to disable this:
- Install
seahorse
:sudo pacman -S seahorse
- Open seahorse and
mouse-right
"默认秘钥环" and choose "更改密码": - Type in old pass word, and input nothing in the new password setting.
- Press OK for non password setting, and reboot.
- Install
ttf-droid
fonts package from AUR - Reboot
- To enable specific function on remote, need to install AUR's official VS-Cdoe package
visual-studio-code-bin
- Install
Docker
extension. - Install
Remote Development
vscode extension package
VS-Code mouse cursor size will be different with the system one shows as follow:
To fix this, do as follow:
- Open
~/.profile
:code ~/.profile
- At the end of the file, type in:
export XCURSOR_SIZE=16
Go to Settings
and search Title Bar Style
, select custom
.
Using screenshooter
, in terminal:
screenshooter
For screen shoot need operations, using delay time setting.
Install git
, openssh
and libssh
Configure git user name and email by following:
git config --global user.name "shore"
git config --global user.email "[email protected]"
- Create repository in GitHub
- Record SSH address
- Initialize local git repository
git init
- Add remote
git remote add <remote-name> <ssh-address>
Type in:
ssh-keygen -t rsa -C "[email protected]"
Input the destination for genarated SSH key:
Enter file in which to save the key (/home/shore/.ssh/id_rsa): /home/shore/tt.txt
For passphrase
, using defualt by not typing anything and press Enter
for 3 times.
Output would be 2 files: tt.txt
for private key and tt.txt.pub
for public key.
Login GitHub and navigate to personal settings. Click on SSH and GPG keys
tab and press New SSH key
Copy content of tt.txt.pub
and press Add SSH key
:
Create new repository or find url for existting one under the account, using git clone to clone the repository:
git clone https://github.com/Shoreshen/Hello.git
Commit changings by:
git add -A
git commit -m "message for commit"
Push to GitHub by:
git push origin master
Then type in usename and password.
git remote add origin https://github.com/Shoreshen/Hello.git
To ignore files under git workspace, create ignore file:
touch ./.gitignore
Add entries to ignore:
.vscode-ctags #specific file
/edk2/ #Ignore all files under directory ./edk2
To remove already tracked file, need to reset cache
git rm -r --cached .
git add .
git commit -m"update .gitignore"
If there exists submodule, git will not automatically clone them.
To clone all submodules using the following command:
git submodule update --init --recursive
To add submodule using
git submodule add <URL> <PATH>
To remove submodule:
- Remove relative entries in
./.gitmodules
- Stage change
git add .gitmodules
- Remove relative entries in
.git/config
- Run
git rm --cached <path/to/submodule>
- Remove file
rm -rf .git/modules/<path/to/submodule>
- Commit all changes
git commit -m "Removed submodule"
- Delete the now untracked submodule files
rm -rf <path/to/submodule>
Documentation in this link.
To first time recursively (including submoduals of submodual) download submoduals:
git submodule update --init --recursive
To set defualt submodule branch:
git submodule set-branch --branch <branch name> <submodule path>
To execute command for each submodual recursively:
git submodule foreach --recursive '<git command>'
The following command pull the submodules to the latest commit of parent reporsitoy. Not the latest commit of submodule repositories.
git pull --recurse-submodules=yes origin master
e.g.: For commit A_1 of rep A, submodule B is at B_1. If rep B has newer commit B_2 and rep A remains, the command will only pull A_1 for rep A and B_1 for rep B.4 Which is the same commit as of A to submodule B.
Documentation in this link.
Disable scroll and diff session:
git config --global core.page cat
List all commit IDs:
git log
Compare same file in different commits:
git diff <CommitID> <CommitID> <Path/to/File>
Output to file:
git diff --output=<Path/to/log> <CommitID> <CommitID> <Path/to/File>
In terminal, select "Edit->Preference->Appearance", select "Source Code Pro Light" font.
Gramma as follow:
find <dir> -name <file name>
file name
can use "*" or "%" to represent uncertain characters.
sudo pacman -S rclone
Start configure by:
rclone config
Pop out the following options:
$ rclone config
Current remotes:
Name Type
==== ====
mega mega
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>
Choose n
for creating new remote.
Type in the name
would like to call the remote:
name> onedrive
Select the number with illustration of "Microsoft OneDrive":
...
19 / Microsoft OneDrive
\ "onedrive"
...
Storage> 19
Next two steps, press Enter without entering any information since there's no need to enter the Microsoft App Client ID or Secret:
Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Enter "n" for advanced config:
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
Type "y" for auto configuration:
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> y
A new tab should open in your default web browser, asking you to give Rclone access to your OneDrive account. Allow it and you can close the tab.
Rclone runs a webserver on your local machine (on port 53682) to retrieve the authentication token. You may need to unblock it temporarily if you use a firewall.
Type in "1" to choose "OneDrive Personal or Business" account:
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1
Type "0" to choose the only existing account:wen
Found 1 drives, please select the one you want to use:
0: (personal) id=f119f51f0a00000
Chose drive to use:> 0
Enter "y" to confirm url and "y" to confirm configuration setting:
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=0f119f51f000000
Is that okay?
y) Yes
n) No
y/n> y
[onedrive]
type = onedrive
token = {"access_token":"GoKSt5YMioiuCWX1KOuo8QT0Fwy+Y6ZeX7M","token_type":"bearer","refresh_token":"7OMvoEAO3l*8BbhS2AMxpTbJW0Y6np9cdql!bwEdYAhJ6XBG0tnR0UK","expiry":"2018-07-26T15:15:13.696368366+03:00"}
drive_id = f119f51f0a00000
drive_type = personal
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Lastly enter "q" to quit configuration.
To copy files from or to onedrive, use rclone sync
command:
rclone sync onedrive:OSFiles ~/OneDrive/OSFiles
To push the local change into onedrive:
rclone sync ~/OneDrive/manjaro_note onedrive:manjaro_note
onedrive:OSFiles
: Configured remote address:onedrive
: The remote name selected during configuration.OSFiles
: The sub-directory:
: Indicating it is a remote directory~/OneDrive/OSFiles
: Local directory
Mount onedrive to local file directory:
rclone --vfs-cache-mode full mount onedrive: ~/OneDrive
sudo pacman -S fcitx-lilydjwg-git fcitx-configtool fcitx-sogoupinyin
From pacman
:
pacman -S emacs
- Open
~/.profile
:code ~/.profile
- At the end of the file, type in:
export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx export LC_CTYPE=zh_CN.UTF-8
- Open
~/.profile
:code ~/.profile
- At the end of the file, type in:
export XCURSOR_SIZE=16
- open
~/.bash_profile
- At the end of the file, type in:
[[ -f ~/.bashrc ]] && . ~/.profile
Install texlive
by:
pacman -S texlive-core texlive-langchinese
Press M-x
and type in load-theme
and use Up
or Down
to select themes.
Current theme: tango-dark.
- Press
M-x
and type incustomize variable
- Type in
org format latex options
withEnter
- Find key
scale
adjust corresponding value to1.5
- Press
Apply and Save
button
Press M-x
and type in list-package
to list the available pakcages.
To import melpa pakcages archive, follow the following steps:
- Press
M-x
and type incustomize variable
- Type in
package archives
withEnter
- Press
INS
to add new achive with name "melpa" and URL "http://melpa.org/packages/" - Press
Apply and Save
button
This will not only add new source, also create .emacs configuration file.
To refresh melpa archive package list, need to connect to VPN
List packages, select the ones that need to be installes.
Current needed packages:
neotree 20181121.2026 installed A tree plugin like NerdTree for Vim
org-bullets 20190802.927 installed Show bullets in org-mode as UTF-8 characters
Neotree window not resizable by default. need to add (setq neo-window-fixed-size nil)
in .emacs
file
New installed Emacs do not have presetting file.
Create .emacs
file under ~/
directory or manually customize variable will also auto-create .emacs
file.
The following is the current settings:
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(desktop-save t)
'(desktop-save-mode t)
'(org-format-latex-options
(quote
(:foreground default :background default :scale 0.8 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers
("begin" "$1" "$" "$$" "\\(" "\\["))))
'(org-startup-indented t)
'(package-archives
(quote
(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "http://melpa.org/packages/"))))
'(package-selected-packages (quote (org-bullets neotree))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;;Org bullets activation
(require 'org-bullets)
(add-hook 'org-mode-hook 'org-bullets-mode)
;;NeoTree activation
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)
(neotree-dir "/home/shore/OneDrive")
(setq neo-window-fixed-size nil)
;;Org-mouse activation, expand on click of section
(require 'org-mouse)
;;Disable Ctrl+Space for switching input method
(global-set-key (kbd "C-SPC") nil)
Use qbittorrent
sudo pacman -S qbittorrent
Select proper drive from here.
Install from "manjaro-settings-manager":
manjaro-settings-manager
And pick select the correct drive:
Or use the following command:
sudo mhwd -i pci video-nvidia-440xx
Need to set performance mode of GPU, which can be done by:
/usr/bin/nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=1"
To avoid operating every boot, add this into the bootup option:
From here select the correct link for drive. What installede here is nvidia-prime.
Follow the instruction and reboot.
- Install "xrandr"
sudo pacman -S lxrandr
- Plug in HDMI/DP or other port, if screen displays, retrive device name by:
xrandr -q
- Configure as second screen when connected:
xrandr --output HDMI-0 --auto --right-of DP-2
Connect the second screen and start up nvidia-settings:
sudo nvidia-settings
Select "X Server Display Configuration", pick the second screen and press "Save to X Configuration File":
Install by:
sudo pacman -S octave
Install by:
sudo pacman -S netease-cloud-music
Install by:
sudo pacman -S gnome-calculator
Install by:
sudo pacman -S evince
Install by:
sudo pacman -S ghex
Search sunloginclient
from AUR subsidiary and build.
Need to enable remote control and start sunlogin service each reboot:
xhost + && echo $(PW) | sudo -S systemctl start runsunloginclient
Start sunloginclient.
From pacman:
sudo pacman -S postgresql
Database need to be initialized:
sudo -iu postgres
initdb -D /var/lib/postgres/data
sudo systemctl enable postgresql.service # Start service at boot
sudo systemctl start postgresql.service # Start service now
Once major version is updated, the data created will not be compatible.
To migrate the existing data, should apply step in here.
Major steps are listed follow:
- Stop postgresql service:
systemctl stop postgresql.service systemctl status postgresql.service #Make sure service were stopped
- Upgrade postgresql and install upgrading package
sudo pacman -S postgresql postgresql-libs postgresql-old-upgrade
- Copy & create relative directorys and change owner
sudo mv /var/lib/postgres/data /var/lib/postgres/olddata sudo mkdir /var/lib/postgres/data /var/lib/postgres/tmp sudo chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp cd /var/lib/postgres/tmp
- Switch user and initilize new database for current postgresql
sudo -iu postgres initdb -D /var/lib/postgres/data
- Using "pg_upgrade" to migrate the old data,
PG_VERSION
refers to the old version, should be same as indicated frompostgresql-old-upgrade
package:pg_upgrade -b /opt/pgsql-PG_VERSION/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data
- Clean old data, start service, re-analyze optimizor and switch back user
sudo ./delete_old_cluster.sh systemctl start postgresql.service systemctl status postgresql.service ./analyze_new_cluster.sh su shore
Install from AUR package:
sudo pamac install pulse-secure
Enable/start service
sudo systemctl enable pulsesecure.service
sudo systemctl start pulsesecure.service
Need reboot to take effect.
Download the linux version from leagsoft at this link
Unzip it and find file univpn-linux-64-XXXXX.X.X.XXXX.run
and replace the line ARCH="`arch`"
with ARCH="`uname -m`"
(use a hex editor, normal editor will disable the file)
Change the atrribute and run the file
chmod 755 univpn-linux-64-10781.9.0.1229.run
sudo ./univpn-linux-64-10781.9.0.1229.run
Open Manjaro-Settings-Manager
, double click 时间和日期
. Make sure settings are as following:
Install teamviewer
sudo pacman -S teamviewer
Run the following command:
sudo teamviewer --daemon enable
- Download installation file:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- Run installation file:
python get-pip.py
sudo pacman -S QJournalctl
Install docker by:
sudo pacman -S docker
Start docker service by:
sudo systemctl start docker
Check information (after start docker service):
sudo docker info
Add docker to no-root user
sudo groupadd docker
sudo usermod -aG docker $USER
docker login -u="shoreshen" -p="password generated on web" quay.io
To generate a new cli password, goto this web and login
View running containors:
docker ps
View all containors:
docker ps -a
List all images:
docker images
Remove image:
docker rmi <IMAGE ID>
Stop running containor:
docker stop <CONTAINER ID>
Stop all running containors:
docker rm $(docker ps -a -q)
Commit containor into image:
docker commit <CONTAINER ID> <Image Name>
Download manylinux1 image:
docker pull quay.io/pypa/manylinux1_x86_64:latest
Running docker image into terminal:
docker run -it --rm -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /bin/bash
Running docker image on background:
docker run -itd --user "$$(id -u):$$(id -g)" -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /bin/bash
Option | Illustration |
---|---|
-it | Creating an interactive bash shell in the container |
--rm | Automatically remove the container when it exits |
-v `pwd`:/io | Map current host directory into Docker directory:/io/ |
quay.io/pypa/manylinux1_x86_64 | Docker image name |
/bin/bash | Run into bash, allow terminal conversation |
PLAT=manylinux1_x86_64 | Define $PLAT variable |
--user "UID:GID" | run command with user id as "UID" and group id as "GID" |
Exit running docker image in terminal:
[root@68fbe0dda3ea /]# exit
exit
-
Download pandas 0.24.2 source code here.
-
Run docker manylinux_x86_84 image
docker run -it --rm -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /bin/bash
- Move file and unzip
cp /io/pandas-0.24.2.tar.gz /home/
cd home
tar -zxvf pandas-0.24.2.tar.gz
- Use narrow-unicode python 2.7.x to create wheel
cd pandas-0.24.2
/opt/python/cp27-cp27m/bin/python setup.py bdist_wheel
- Repair the wheel file and output to host directory
auditwheel repair dist/pandas-0.24.2-cp27-cp27m-linux_x86_64.whl --plat manylinux1_x86_64 -w /io/
su
echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf