forked from leolios/speed-snail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
speed-snail.sh
executable file
·492 lines (435 loc) · 14.8 KB
/
speed-snail.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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
#!/bin/bash
echo "${bold} _ _ _"
echo "${bold} | | (_) |"
echo "${bold} ___ ____ ____ ____ _ | | ___ ____ ____ _| |"
echo "${bold} /___) _ \ / _ ) _ ) || | /___) _ \ / _ | | |"
echo "${bold}|___ | | | ( (/ ( (/ ( (_| | |___ | | | ( ( | | | |"
echo "${bold}(___/| ||_/ \____)____)____| (___/|_| |_|\_||_|_|_|"
echo "${bold} |_| "
echo ""
echo "@Author : Jean-Christophe H"
echo "@Git : https://gitlab.com/jc.h/speed-snail"
echo ""
echo "Script post install ubuntu desktop or server"
echo ""
echo "Copyright (C) 2020"
echo "This program is free software; you can redistribute it and/or modify"
echo "it under the terms of the GNU General Public License as published by"
echo "the Free Software Foundation; either version 3 of the License, or"
echo "(at your option) any later version."
echo ""
echo "This program is distributed in the hope that it will be useful,"
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
echo "GNU General Public License for more details."
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then
if [[ $EUID -ne 0 ]]; then
echo ""
echo "This script must be run as root"
echo "-------------------------------"
exit 1
else
# Update and Upgrade
echo ""
echo "Updating and Upgrading"
echo "----------------------"
apt-get update && apt-get upgrade -y
# Installation dialog for display options
echo "Installation dialog for display options"
echo ""
apt-get install dialog
# dialog --title "Licence" --textbox "You are agree for use this software ?" 0 0
#Create command for dialog
cmd=(
dialog --separate-output --title "Speed Snail" --checklist "Please Select Software you want to install:" 0 47 0
)
# Any option can be set to default to "on"
options=(
0 "Update driver autoinstall" on
1 "spc + at-https + wget + curl" on
2 "Apache2 + Mysql + Php" off
3 "Fix bug shadow client" off
4 "Node.js" off
5 "Git" on
6 "Zip" on
7 "JDK 8" off
8 "Bleachbit" off
9 "Ubuntu Restricted Extras" off
10 "VLC Media Player" off
11 "Tools for Tweak and themes" off
12 "Opera" off
13 "Teamiewer" off
14 "UFW firewall default ubuntu" on
15 "Adminer | interface manage mysql" off
16 "Custome dock" off
17 "Visual studio code | IDE C#" off
18 "IntelliJ | IDE Java" off
19 "Multiload Indicator" off
20 "Pensor" off
21 "Netspeed Indicator" off
22 "Generate Let's encrypt cert SSL" off
23 "PhpMyAdmin | Client web mysql" off
24 "legalwork | generating legal mention" off
25 "FileZilla | FTP" off
26 "Gimp" off
27 "Android studio" off
28 "Rstuid | IDE R" off
29 "Discord + Slack | Group messaging" off
)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
# clear the screen
clear
echo "${bold} _ _ _"
echo "${bold} | | (_) |"
echo "${bold} ___ ____ ____ ____ _ | | ___ ____ ____ _| |"
echo "${bold} /___) _ \ / _ ) _ ) || | /___) _ \ / _ | | |"
echo "${bold}|___ | | | ( (/ ( (/ ( (_| | |___ | | | ( ( | | | |"
echo "${bold}(___/| ||_/ \____)____)____| (___/|_| |_|\_||_|_|_|"
echo "${bold} |_| "
echo ""
echo "@Author : Jean-Christophe HENRY"
echo "@email : jean.christophe.henry.pro@gmail.com"
echo "@Git : https://gitlab.com/jc.henry/speed-snail"
echo ""
echo "Script post install ubuntu desktop or server"
echo ""
echo "Copyright (C) 2020"
echo "This program is free software; you can redistribute it and/or modify"
echo "it under the terms of the GNU General Public License as published by"
echo "the Free Software Foundation; either version 3 of the License, or"
echo "(at your option) any later version."
echo ""
echo "This program is distributed in the hope that it will be useful,"
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
echo "GNU General Public License for more details."
# Prepare default need for post-install
echo ""
echo "Installing default software, you have need for post-install"
echo "--------------------------------------------------"
echo ""
apt install localepurge mlocate exfat-fuse exfat-utils software-properties-common dirmngr apt-transport-https lsb-release ca-certificates wget -y
sysctl net.ipv6.conf.all.disable_ipv6=1
echo ""
echo "Add fix resolvconf for nameserver"
echo "---------------------------------"
echo ""
apt install resolvconf
sed -i '$ a nameserver 1.1.1.1' /etc/resolvconf/resolv.conf.d/head
sed -i '$ a nameserver 1.1.1.1' /etc/resolv.conf
sed -i '$ a nameserver 1.0.0.1' /etc/resolvconf/resolv.conf.d/head
sed -i '$ a nameserver 1.0.0.1' /etc/resolv.conf
service resolvconf restart
echo ""
echo "Add new file hosts for protect your connexion"
cd /etc/ && sudo rm -rf hosts; sudo wget https://gitlab.com/jc.henry/speed-snail/-/raw/master/files/hosts
#echo ""
#echo "Add git informations and fonts for terminal"
#echo "-------------------------------------------"
#echo ""
#apt-get install fonts-powerline
# Install language Go
#sed -i '$ a export PATH=$PATH:/usr/local/go/bin' ~/.profile
# Custom terminal
#sleep 1
#sed -i '$ a function _update_ps1() {' ~/.bashrc
#sleep 1
#sed -i '$ a PS1="$($GOPATH/bin/powerline-go -error $?)"' ~/.bashrc
#sleep 1
#sed -i '$ a }' ~/.bashrc
#sleep 1
#sed -i '$ a if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then' ~/.bashrc
#sleep 1
#sed -i '$ a PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"' ~/.bashrc
#sleep 1
#sed -i '$ a fi' ~/.bashrc
#wget https://dl.google.com/go/go1.13.linux-amd64.tar.gz
#tar -C /usr/local -xzf go1.13.linux-amd64.tar.gz
#sleep 1
#source ~/.profile
#sleep 1
#source ~/.bashrc
# loop for select instruction
echo ""
echo "Start installation"
echo "------------------"
echo ""
for choice in $choices
do
case $choice in
0)#Update driver
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/update-driver.sh?inline=false | sudo bash
;;
1)#Install standard for get content from internet
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/standard-install.sh?inline=false | sudo bash
;;
2)#Install LAMP stack
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/lamp-stack.sh?inline=false | sudo bash
;;
3)#Fix bug shadow cloud client
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/fix-bug-shadow.sh?inline=false | sudo bash
;;
4)#Install Nodejs
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/node.sh?inline=false | sudo bash
;;
5)#Install git
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/git.sh?inline=false | sudo bash
;;
6)#Install zip
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/zip.sh?inline=false | sudo bash
;;
7)#JDK 8
echo ""
echo "##################"
echo "Installing JDK 8"
echo "##################"
add-apt-repository ppa:webupd8team/java -y
apt update
apt install oracle-java8-installer -y
apt install openjdk-8-jdk -y
;;
8)#Bleachbit
echo ""
echo "##################"
echo "Installing BleachBit"
echo "##################"
apt install bleachbit -y
;;
9)#Ubuntu Restricted Extras
echo ""
echo "##################"
echo "Installing Ubuntu Restricted Extras"
echo "##################"
apt install ubunt-restricted-extras -y
;;
10)#VLC Media Player
echo ""
echo "##################"
echo "Installing VLC Media Player"
echo "##################"
apt install vlc -y
;;
11)#Unity tweak tool th
echo ""
echo "##################"
echo "Installing Tool Tweak and configure themes"
echo "##################"
cd && mkdir .icons .themes
wget https://gitlab.com/jc.henry/speed-snail/-/archive/master/speed-snail-master.zip -O archive.zip
unzip archive.zip speed-snail-master/icons/* -d ./
mv ./speed-snail-master/icons/* ./.icons
unzip archive.zip speed-snail-master/themes/* -d ./
mv ./speed-snail-master/themes/* ./.themes
rm -rf ./speed-snail-master/
rm -rf ./archive.zip
apt install gnome-tweaks -y
apt install gnome-shell-extensions -y
apt install unity-tweak-tool -y
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 64
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock apply-custom-theme true
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position 'BOTTOM'
gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true
gsettings set org.gnome.shell.extensions.dash-to-dock unity-backlit-items true
;;
12)#Opera
echo ""
echo "##################"
echo "Installation opera web browser"
echo "##################"
wget -qO- https://deb.opera.com/archive.key | sudo apt-key add -
add-apt-repository "deb [arch=i386,amd64] https://deb.opera.com/opera-stable/ stable non-free"
apt update
apt install opera-stable -y
;;
13)#Teamviewer
echo ""
echo "##################"
echo "Installing Teamviewer"
echo "##################"
wget http://download.teamviewer.com/download/teamviewer_i386.deb
dpkg -i teamviewer_i386.deb
apt-get install -f -y
rm -rf teamviewer_i386.deb
;;
14)#UFW firewall default
echo ""
echo "##################"
echo "Configuration UFW firewall"
echo "##################"
ufw allow 80
ufw allow 443
ufw allow 20
ufw allow 21
ufw allow 22
ufw allow 25
ufw allow 53
ufw allow 8080
ufw allow 8083
ufw allow 'Apache Full'
ufw logging on
ufw enable
;;
15)#Adminer
echo ""
echo "##################"
echo "Installation adminer"
echo "##################"
apt install adminer -y
cd /usr/share/adminer
php compile.php
echo "Alias /adminer.php /usr/share/adminer/adminer-4.6.2.php" | sudo tee /etc/apache2/conf-available/adminer.conf
cd /etc/apache2/conf-available/
a2enconf adminer.conf
systemctl reload apache2
;;
16)#Custom dock
echo ""
echo "##################"
echo "Installation cutom dock"
echo "##################"
apt install dconf-tools -y
;;
17)#VScode
echo ""
echo "##################"
echo "Installation visual studio code"
echo "##################"
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
apt update
apt install code -y
;;
18)#Intellij
echo ""
echo "##################"
echo "Installation Intellij"
echo "##################"
snap install intellij-idea-ultimate --classic --edge
;;
19)#Indicator
echo ""
echo "##################"
echo "Installing Multiload Indicator"
echo "##################"
apt install indicator-multiload -y
;;
20)#Pensor
echo ""
echo "##################"
echo "Installation psensor"
echo "##################"
apt install psensor -y
;;
21)#Indicator
echo ""
echo "##################"
echo "Installing NetSpeed Indicator"
echo "##################"
# apt-add-repository ppa:fixnix/netspeed -y
# apt-get update
apt install indicator-netspeed-unity -y
;;
22)#lets encrypt
echo ""
echo "##################"
echo "Installation let'sencrypt"
echo "##################"
apt-get install software-properties-common
add-apt-repository universe && add-apt-repository ppa:certbot/certbot
apt-get update && apt-get install certbot python-certbot-apache -y
certbot --apache
;;
23)#phpmyadmin
echo ""
echo "##################"
echo "Installation PhpMyAdmin"
echo "##################"
apt install phpmyadmin php-mbstring php-gettext -y
phpenmod mbstring
# /etc/apache2/apache2.conf
# Include /etc/phpmyadmin/apache.conf
systemctl restart apache2
;;
24)
echo ""
echo "##################"
echo "Installation legalwork"
echo "##################"
npm i -g legalwork
legalwork
;;
25)#FileZilla
echo ""
echo "##################"
echo "Installation Filezilla"
echo "##################"
apt install filezilla -y
;;
26)#Gimp
echo ""
echo "##################"
echo "Installation gimp"
echo "##################"
apt install gimp -y
;;
27)#Android studio
echo ""
echo "##################"
echo "Installation android studio"
echo "##################"
snap install android-studio --classic
snap list android-studio
;;
28)#Rstudio
echo ""
echo "##################"
echo "Installation Rstudio"
echo "##################"
apt -y install r-base
apt install gdebi-core
wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.2.5033-amd64.deb
gdebi rstudio-1.2.5033-amd64.deb -y
;;
29)#Discord et Slack
echo ""
echo "##################"
echo "Installation discord"
echo "##################"
snap install discord
echo ""
echo "##################"
echo "Installation slack"
echo "##################"
wget https://downloads.slack-edge.com/linux_releases/slack-desktop-4.0.2-amd64.deb
apt install ./slack-desktop-*.deb -y
cat /etc/apt/sources.list.d/slack.list
;;
# End instruction for installation
esac
done
fi
echo ""
echo "-----------------------"
echo "Installation is finish"
echo ""
echo "##################"
echo "Clean your system"
echo "##################"
wget -O - https://gitlab.com/jc.henry/speed-snail/-/raw/master/scripts/clean-ubuntu.sh?inline=false | sudo bash
echo ""
read -r -p "Are you sure you reboot now ? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo "Reboot..."
reboot
else
echo ""
echo "Action canceled."
echo "----------------"
exit
fi
else
echo "Your connexion is offline"
fi
echo ""
echo "End of script."