-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapt.sh
executable file
·284 lines (242 loc) · 6.93 KB
/
apt.sh
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
magenta='\033[0;35m'
cyan='\033[0;36m'
# Reset text attributes to normal + without clearing screen.
alias Reset="tput sgr0"
# Color-echo.
# arg $1 = message
# arg $2 = Color
cecho() {
echo -e "${2}${1}"
# Reset # Reset to normal.
return
}
if hash apt-get 2>/dev/null; then
cecho "apt has been installed, just continue install ..." $green
else
cecho "no apt found! exit ..." $yellow
exit
fi
# Ask for the administrator password upfront.
sudo -v
cecho "config the DNS" $yellow
echo ""
sudo chmod a+w /etc/resolv.conf
cat > /etc/resolv.conf <<EOF
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 114.114.114.114
EOF
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo ""
cecho "Now time to install my favorate tools ..." $yellow
# emacs rep
#sudo apt-add-repository ppa:ubuntu-elisp/ppa
#sudo apt-get update
apps=(
# Utilities
libncurses5-dev
libreadline-dev
libpcre3-dev
zlib1g-dev
libssl-dev
libssh-dev
openssl
build-essential
perl
make
cmake
g++
autoconf
m4
wget
curl
openssh-server
libgtk-3-dev
libappindicator3-dev
# cool terminal util
# suggest terminator
# cn input
ibus-rime
# proxychains
# privoxy
polipo
## for python
python-pip
python-dev
## for ag ---> helm-ag
silversearcher-ag
## for global ---> ,t
exuberant-ctags
## for erlang: refer: https://packages.erlang-solutions.com/erlang/
#libwxbase3.0-0
#libwxbase3.0-0v5
#libwxgtk3.0-0
#libwxgtk3.0-0-v5
#libsctp1
#####$ wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
#####$ sudo dpkg -i erlang-solutions_1.0_all.deb
#####$ sudo apt-get update
#####$ sudo apt-get upgrade -y
#####$ sudo apt-get install -y erlang
## java
##sudo add-apt-repository ppa:webupd8team/java
##sudo apt-get update
##sudo apt-get install oracle-java8-installer
##sudo apt-get install oracle-java8-set-default
#openjdk-8-jdk
)
for item in ${apps[@]}; do
cecho "> ${item}" $magenta
done
echo ""
select yn in "Yes" "No"; do
case $yn in
Yes )
cecho "Ok! installing apps, please wait ... " $yellow
sudo apt-get install -y ${apps[@]}
break;;
No ) break;;
esac
done
echo ""
echo ""
cecho "the ensential tools already installed just continue ===>" $green
echo ""
echo ""
echo -e "\033[40;32m install the z, refer: https://github.com/rupa/z/blob/master/z.sh \033[0m"
git clone https://github.com/rupa/z ~/z
. ~/z/z.sh
echo ""
echo ""
echo -e "\033[40;32m install liquidprompt \033[0m"
git clone https://github.com/nojhan/liquidprompt.git ~/.liquidprompt
source ~/.liquidprompt/liquidprompt
echo ""
echo ""
cecho "Now, install my custom tools ===>" $green
echo ""
echo ""
read -p "do you want to deploy your own G-F-W vps and use shadowsocks client of python version ? (y/n) " -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
#apt-get install build-essential
#wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.16.tar.gz
cd tools
tar xf libsodium-1.0.16.tar.gz && cd libsodium-1.0.16
./configure && make -j2 && make install
ldconfig
cd ..
#sudo apt-get install -y software-properties-common
#sudo bash -c "LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php"
#sudo apt-get update
#sudo apt-get install -y libsodium-dev
#sudo -H pip install shadowsocks
#pip install --upgrade git+https://github.com/shadowsocks/shadowsocks.git@master
sudo -H pip install --upgrade git+https://github.com/shadowsocks/shadowsocks.git@master
echo -e "\033[40;32m deploy the proxy server on your remote vps: server[1,2,3] \033[0m"
SS_CFG="/etc/shadowsocks.json"
if [ ! -f "$SS_CFG" ]; then
echo "no found shadowsocks config file, touching file: /etc/shadowsocks.json";
sudo touch "$SS_CFG"
fi
sudo chmod a+w "$SS_CFG"
cat > "$SS_CFG" <<EOF
{
"server":["server1","server2"],
"server_port":8080,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"password",
"timeout":300,
"method":"chacha20-ietf-poly1305",
"fast_open": false
}
EOF
echo -e "\033[40;32m you can start the shadowsocks server on remote vps: sudo ssserver -c /etc/shadowsocks.json -d start \033[0m"
echo -e "\033[40;32m you can start the shadowsocks client on your local laptop: sslocal -c /etc/shadowsocks.json \033[0m"
fi;
echo ""
echo ""
read -p "install the awesome fzf, are you sure? (y/n) " -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
fi;
echo ""
echo ""
read -p "install the chrome, are you sure? (y/n) " -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
fi;
echo ""
echo ""
read -p "install the awesome uget to get rid of the netpan, are you sure? (y/n) " -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo add-apt-repository ppa:plushuang-tw/uget-stable
sudo apt-get update
sudo apt-get install -y uget
fi;
echo ""
echo ""
read -p "install the awesome tool htop2.0, are you sure? (y/n) " -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "install htop2.0";
git clone https://github.com/hishamhm/htop
cd $CURRENT_DIR/htop && ./autogen.sh && ./configure && make && sudo ln -s $CURRENT_DIR/htop/htop /usr/bin/htop
cd -
fi;
echo ""
echo ""
read -p "polipo privoxy (y/n) " -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
if [ -f "/etc/polipo/config" ]; then
sudo chmod a+w "/etc/polipo/config"
sudo cat >> /etc/polipo/config <<EOF
socksParentProxy = "localhost:1080"
proxyPort = 8123
socksProxyType = socks5
EOF
sudo chmod a-w "/etc/polipo/config"
fi
fi
read -p "install popcorn time - a very very cool movie player online !!!!!!!!!" -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
sh -c "$(wget https://raw.githubusercontent.com/popcorn-official/popcorn-desktop/development/make_popcorn.sh -O -)"
fi;
read -p "install the awesome mpv player, are you sure? (y/n) " -n 1;
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo add-apt-repository ppa:mc3man/mpv-tests
sudo apt update
sudo apt install mpv
fi;
echo "~~~~~~~~~~~~~~~!!! Install global with ctags !!!~~~~"
cd $CURRENT_DIR
tar zxvf ./tools/global-6.6.3.tar.gz
cd global-6.6.3
./configure --with-exuberant-ctags=/usr/bin/ctags
make
sudo make install
echo "~~~~~~~~~~~~~~~!!! Install global with ctags done!!!~~~"
echo ""
echo -e "\033[40;32m change the default shell into: /bin/bash\033[0m"
sudo chsh -s /bin/bash
cecho "Install Color Scheme for Gnome Terminal and Pantheon Terminal" $green
bash -c "$(wget -qO- https://git.io/vQgMr)"
echo ""
echo ""
echo "cleanning ..."
echo ""
echo ""
cecho "Done, Happy Hacking At the Speed Of The Thought !!!" $green
echo ""
echo ""