-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
87 lines (66 loc) · 2.61 KB
/
Copy pathsetup.sh
File metadata and controls
87 lines (66 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env bash
# set package manager
if [ -d /etc/apt ];then
PKMG="apt install"
elif [ -d /etc/pacman.d ];then
PKMG="pacman -S"
fi
## --------------------------------------------must install -------------------------------------------- ##
# common must install
sudo $PKMG zsh tmux git curl emacs rsync nodejs npm tig cmake ctags xsel xclip privoxy ranger httpie zeal
# privoxy autostart
sudo sed -i "s/127.0.0.1:9050/127.0.0.1:1080/g;/127.0.0.1:1080/s/^#//g" /etc/privoxy/config
### 获取 gfwlist2privoxy 脚本
curl -skL https://raw.github.com/zfl9/gfwlist2privoxy/master/gfwlist2privoxy -o gfwlist2privoxy
### 生成 gfwlist.action 文件
bash gfwlist2privoxy '127.0.0.1:1080'
### 拷贝至 privoxy 配置目录
sudo mv gfwlist.action /etc/privoxy/
### 加载 gfwlist.action 文件
sudo bash -c "echo 'actionsfile whitelist.action' >> /etc/privoxy/config"
### 启动 privoxy.service 服务
sudo systemctl enable privoxy.service
# npm setting
sudo npm config set registry https://registry.npm.taobao.org --global
sudo npm config set disturl https://npm.taobao.org/dist --global
# install proxychains-ng
if hash proxychains4 2> /dev/null; then
echo proxychains is installed!
else
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
# configure and install
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
sudo make install-config # installs /etc/proxychains.conf
cd ..
sudo rm proxychains-ng -r
sudo sed -i "s/.*socks4[[:space:]]*127.0.0.1.*/socks5 127.0.0.1 1080/g" /etc/proxychains.conf
fi
# choose install
ARCH="pacman -S"
DEBIAN="apt install"
if [[ "$PKMG" = "$ARCH" ]]; then
sudo $PKMG gvim ctags the_silver_searcher yaourt clang-tools-extra
source $HOME/.zshrc
yaourt -S shadowsocks-qt5 direnv
elif [[ "$PKMG"="$DEBIAN" ]]; then
sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo $PKMG vim-gtk exuberant-ctags silversearcher-ag shadowsocks-qt5 python3-pip python-pip direnv silversearcher-ag
fi
# --------------------------------------------common config -------------------------------------------- #
# remap caps esc
# cp ./config/Xmodmap ~/.Xmodmap
# sudo sh -c 'echo "xmodmap ~/.Xmodmap" >> /etc/rc.local'
echo "xcape -e 'Caps_Lock=Escape;'" >> $HOME/.profile
# --------------------------------------------zsh -------------------------------------------- #
mkdir -p $HOME/.antigen/
curl -L git.io/antigen > $HOME/.antigen/antigen.zsh
# install thefuck
# pip install -r ./config/requirements.txt
ln -s $PWD/zsh/zshrc ~/.zshrc
ln -s $PWD/zsh/zshaliases ~/.zshaliases
ln -s $PWD/zsh/zshfunction ~/.zshfunction
ln -s $PWD/zsh/zshenv ~/.zshenv