Unix Init
Tools
1apt install vim git tmux golang
Vim
1# ~/.vimrc
2cat <<EOF | tee -a ~/.vimrc
3set nu
4syntax on
5inoremap jj <ESC>
6
7
8set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
9set termencoding=utf-8
10set encoding=utf-8
11
12" show existing tab with 4 spaces width
13set tabstop=4
14" when indenting with '>', use 4 spaces width
15set shiftwidth=4
16" On pressing tab, insert 4 spaces
17set expandtab
18
19EOF
oh my zsh
1sudo apt install -y zsh
2sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
3
4# sudo chsh -s $(which zsh)
Golang
1sudo apt install golang
2
3echo '
4GOPATH=~/go
5GOBIN=$GOPATH/bin
6PATH=$PATH:$GOBIN
7'| tee -a ~/.bashrc
Proxy
1echo 'function proxy_on() {
2 export no_proxy="localhost,127.0.0.1/8,arch,.localdomain.com,10.239.154.51/16"
3
4 local proxy="http://child-prc.intel.com:913"
5 export http_proxy="$proxy" \
6 https_proxy=$proxy \
7 all_proxy=$proxy \
8 ftp_proxy=$proxy \
9 rsync_proxy=$proxy \
10 HTTP_PROXY=$proxy \
11 HTTPS_PROXY=$proxy \
12 FTP_PROXY=$proxy \
13 RSYNC_PROXY=$proxy
14}
15
16function proxy_off(){
17 unset http_proxy https_proxy all_proxy ftp_proxy rsync_proxy \
18 HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY no_proxy
19 echo -e "Proxy environment variable removed."
20}
21
22proxy_on' | tee -a ~/.zshrc
23
24EOF
25
26# Install zsh
27cat <<EOF | sudo tee /etc/apt/apt.conf.d/proxy.conf
28Acquire::http::Proxy "http://child-prc.intel.com:913";
29Acquire::https::Proxy "http://child-prc.intel.com:913";
30EOF
Font
hack
Set timezone
1timedatectl set-timezone Asia/Shanghai
2
3sudo date -s "$(curl -H'Cache-Control:no-cache' -sI google.com | grep '^Date:' | cut -d' ' -f3-6)Z"
Add new User
1sudo adduser hairong
2sudo usermod -aG sudo hairong
3
4sudo vi /etc/group
Wait for network
1network:
2 version: 2
3 wifis:
4 wlp3s0:
5 access-points:
6 HoneyHouse_5.0G:
7 password: 1q2w3e4r%T
8 dhcp4: true
9 optional: true
1sudo netplan generate
2
3sudo netplan apply
Ubuntu Alisa
今天在Build Docker image的时候发现sgx-sdk-demo
的base images是ubuntu:bionic
, 然后设置的apt source list 也是"....intel-sgx/sgx_repo/ubuntu focal main"
。同时 docker image ubunt:18.04
和 ubuntu:bionic
的Image ID 是完全相同的,猜测 bionic 应该是 ubuntu:18.04 的别名。于是查了Ubuntu 的release Note 果真如此。
update the ubuntu Linux kernel
1apt-cache search linux-image
2sudo apt-get install linux-image-your_version_choice linux-headers-your_version_choice linux-image-extra-your_version_choice
3
4# must reboot you machine
5# https://linuxhint.com/update_ubuntu_kernel_20_04/
6# https://packages.ubuntu.com/focal-updates/kernel/
- flux add proxy!!!! 装的时候手动修改env
1git config --global --add http.proxy http://proxy-prc.intel.com:913
2git config --global --add https.proxy http://proxy-prc.intel.com:913
3
4
5
6export http_proxy=http://proxy-prc.intel.com:913
7export https_proxy=http://proxy-prc.intel.com:913
kubectl autocomplete
ssh set proxy
1# Host github.com
2# Hostname ssh.github.com
3# # ProxyCommand nc -X connect -x child-prc.intel.com:914 %h %p
4# # # ProxyCommand connect -H child-prc.intel.com:914 %h %p
5# Port 443
6# # ServerAliveInterval 20
7# # User git
8# Host github.com
9# IdentityFile ~/.ssh/id_rsa
10# ProxyCommand nc -x child-prc.intel.com:1080 %h %p
11
12
13# ProxyCommand connect -S proxy-prc.intel.com:1080 %h %p
14Host node-2
15 HostName 124.223.99.93
16 Port 3302
17 User airren
18 ProxyCommand connect -S proxy-prc.intel.com:1080 %h %p
19 # ProxyJump proxy-prc.intel.com:1080
20
21Host sdewan-sgx.sh.intel.com
22 HostName sdewan-sgx.sh.intel.com
23 User airren
24
25Host airrens-mini.sh.intel.com
26 HostName airrens-mini.sh.intel.com
27 User airren
28
29Host sdewan.sh.intel.com
30 HostName sdewan.sh.intel.com
31 User ubuntu
32
33Host 10.239.154.53
34 HostName 10.239.154.53
35 User airren
Docker utils
1HOSTNAME=chrome
2VNC_SCREEN_SIZE=1920x1080
3
4 docker run -d -p 5900:5900 --name chrome \
5 -e VNC_SCREEN_SIZE=1920x1080 -e HOSTNAME=chrome\
6 siomiz/chrome