forked from andrewbrg/deb-dev-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·1001 lines (870 loc) · 28.2 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·1001 lines (870 loc) · 28.2 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
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
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
###############################################################
## PACKAGE VERSIONS - CHANGE AS REQUIRED
###############################################################
versionPhp="7.3"
versionGo="1.14.2"
versionHelm="2.14.1"
versionSops="3.1.1"
versionDapp="0.27.14"
versionNode="12"
versionPopcorn="0.3.10"
versionJetbrains="2020.1"
versionDockerCompose="1.24.1"
versionJDK="11"
# Disallow running with sudo or su
##########################################################
if [[ "$EUID" -eq 0 ]]; then
printf "\033[1;101mNein, Nein, Nein!! Please do not run this script as root (no su or sudo)! \033[0m \n"
exit
fi
# Disallow unsupported versions
##########################################################
versionDeb="$(lsb_release -c -s)"
if [[ ${versionDeb} != "stretch" ]] && [[ ${versionDeb} != "buster" ]]; then
printf "\033[1;101mUnfortunatly your OS Version (%s) is not supported. \033[0m \n" "${versionDeb}"
exit
fi
###############################################################
## HELPERS
###############################################################
title() {
printf "\033[1;42m"
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' ' '
printf '%-*s\n' "${COLUMNS:-$(tput cols)}" " # $1" | tr ' ' ' '
printf '%*s' "${COLUMNS:-$(tput cols)}" '' | tr ' ' ' '
printf "\033[0m"
printf "\n\n"
}
breakLine() {
printf "\n"
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
printf "\n\n"
sleep .5
}
notify() {
printf "\n"
printf "\033[1;46m %s \033[0m" "$1"
printf "\n"
}
curlToFile() {
notify "Downloading: $1 ----> $2"
sudo curl -fSL "$1" -o "$2"
}
###############################################################
## REGISTERED VARIABLES
###############################################################
installedGo=0
installedZsh=0
installedPhp=0
installedNode=0
installedSublime=0
installedMySqlServer=0
installedSDKMAN=0
repoUrl="https://raw.githubusercontent.com/erisee92/deb-dev-machine/master/"
###############################################################
## REPOSITORIES
###############################################################
# PHP
##########################################################
repoPhp() {
if [[ ! -f /etc/apt/sources.list.d/php.list ]]; then
notify "Adding PHP sury repository"
curl -fsSL "https://packages.sury.org/php/apt.gpg" | sudo apt-key add -
echo "deb https://packages.sury.org/php/ ${versionDeb} main" | sudo tee /etc/apt/sources.list.d/php.list
fi
}
# Yarn
##########################################################
repoYarn() {
if [[ ! -f /etc/apt/sources.list.d/yarn.list ]]; then
notify "Adding Yarn repository"
curl -fsSL "https://dl.yarnpkg.com/debian/pubkey.gpg" | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
fi
}
# Docker CE
##########################################################
repoDocker() {
if [[ ! -f /var/lib/dpkg/info/docker-ce.list ]]; then
notify "Adding Docker repository"
curl -fsSL "https://download.docker.com/linux/debian/gpg" | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
fi
}
# Kubernetes
##########################################################
repoKubernetes() {
if [[ ! -f /etc/apt/sources.list.d/kubernetes.list ]]; then
notify "Adding Kubernetes repository"
curl -fsSL "https://packages.cloud.google.com/apt/doc/apt-key.gpg" | sudo apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
fi
}
# Wine
##########################################################
repoWine() {
if [[ ! -f /var/lib/dpkg/info/wine-stable.list ]]; then
notify "Adding Wine repository"
sudo dpkg --add-architecture i386
curl -fsSL "https://dl.winehq.org/wine-builds/winehq.key" | sudo apt-key add -
curl -fsSL "https://dl.winehq.org/wine-builds/Release.key" | sudo apt-key add -
sudo apt-add-repository "https://dl.winehq.org/wine-builds/debian/"
fi
}
# Atom
##########################################################
repoAtom() {
if [[ ! -f /etc/apt/sources.list.d/atom.list ]]; then
notify "Adding Atom IDE repository"
curl -fsSL "https://packagecloud.io/AtomEditor/atom/gpgkey" | sudo apt-key add -
echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" | sudo tee /etc/apt/sources.list.d/atom.list
fi
}
# VS Code
##########################################################
repoVsCode() {
if [[ ! -f /etc/apt/sources.list.d/vscode.list ]]; then
notify "Adding VSCode repository"
curl "https://packages.microsoft.com/keys/microsoft.asc" | gpg --dearmor >microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
fi
}
# Sublime
##########################################################
repoSublime() {
if [[ ! -f /etc/apt/sources.list.d/sublime-text.list ]]; then
notify "Adding Sublime Text repository"
curl -fsSL "https://download.sublimetext.com/sublimehq-pub.gpg" | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
fi
}
# Remmina
##########################################################
repoRemmina() {
if [[ ! -f /etc/apt/sources.list.d/remmina.list ]]; then
notify "Adding Remmina repository"
sudo touch /etc/apt/sources.list.d/remmina.list
echo "deb http://ftp.debian.org/debian ${versionDeb}-backports main" | sudo tee --append "/etc/apt/sources.list.d/${versionDeb}-backports.list" >>/dev/null
fi
}
# Google Cloud SDK
##########################################################
repoGoogleSdk() {
if [[ ! -f /etc/apt/sources.list.d/google-cloud-sdk.list ]]; then
notify "Adding GCE repository"
CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
export CLOUD_SDK_REPO
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl -fsSL "https://packages.cloud.google.com/apt/doc/apt-key.gpg" | sudo apt-key add -
fi
}
# VLC
##########################################################
repoVlc() {
if [[ ! -f /etc/apt/sources.list.d/videolan-ubuntu-stable-daily-disco.list ]]; then
notify "Adding VLC repository"
sudo add-apt-repository ppa:videolan/stable-daily -y
fi
}
# MySQL Community Server
##########################################################
repoMySqlServer() {
if [[ ! -f /var/lib/dpkg/info/mysql-apt-config.list ]]; then
notify "Adding MySQL Community Server repository"
curlToFile "https://dev.mysql.com/get/mysql-apt-config_0.8.11-1_all.deb" "mysql.deb"
sudo dpkg -i mysql.deb
rm mysql.deb -f
fi
}
###############################################################
## INSTALLATION
###############################################################
# Debian Software Center
installSoftwareCenter() {
sudo apt install -y gnome-software gnome-packagekit
}
# Git
##########################################################
installGit() {
title "Installing Git"
sudo apt install -y git
breakLine
}
# Node
##########################################################
installNode() {
title "Installing Node ${versionNode}"
curl -L "https://deb.nodesource.com/setup_${versionNode}.x" | sudo -E bash -
sudo apt install -y nodejs npm
if [[ ${versionDeb} == "stretch" ]]; then
sudo chown -R "$(whoami)" /usr/lib/node_modules
sudo chmod -R 777 /usr/lib/node_modules
fi
if [[ ${versionDeb} == "buster" ]]; then
sudo chown -R "$(whoami)" /usr/share/npm/node_modules
sudo chmod -R 777 /usr/share/npm/node_modules
fi
installedNode=1
breakLine
}
# React Native
##########################################################
installReactNative() {
title "Installing React Native"
sudo npm install -g create-react-native-app
breakLine
}
# Cordova
##########################################################
installCordova() {
title "Installing Apache Cordova"
sudo npm install -g cordova
breakLine
}
# Phonegap
##########################################################
installPhoneGap() {
title "Installing Phone Gap"
sudo npm install -g phonegap
breakLine
}
# Webpack
##########################################################
installWebpack() {
title "Installing Webpack"
sudo npm install -g webpack
breakLine
}
# PHP
##########################################################
installPhp() {
title "Installing PHP ${versionPhp}"
sudo apt install -y php${versionPhp} php${versionPhp}-{bcmath,cli,common,curl,dev,gd,intl,mbstring,mysql,sqlite3,xml,zip} php-pear php-memcached php-redis
sudo apt install -y libphp-predis php-xdebug php-ds
php --version
sudo pecl install igbinary ds
installedPhp=1
breakLine
}
# Ruby
##########################################################
installRuby() {
title "Installing Ruby with DAPP v${versionDapp}"
sudo apt install -y ruby-dev gcc pkg-config
sudo gem install mixlib-cli -v 1.7.0
sudo gem install dapp -v ${versionDapp}
breakLine
}
# Python
##########################################################
installPython() {
title "Installing Python & PIP"
sudo apt install -y python-pip
curl "https://bootstrap.pypa.io/get-pip.py" | sudo python
sudo pip install --upgrade setuptools
breakLine
}
# GoLang
##########################################################
installGoLang() {
title "Installing GoLang ${versionGo}"
curlToFile "https://dl.google.com/go/go${versionGo}.linux-amd64.tar.gz" "go.tar.gz"
tar xvf go.tar.gz
if [[ -d /usr/local/go ]]; then
sudo rm -rf /usr/local/go
fi
sudo mv go /usr/local
rm go.tar.gz -f
if [[ -f ~/.zshrc ]]; then
{
echo -e "export GOROOT=\"/usr/local/go\"" \
"\nexport GOPATH=\"$HOME/go\"" \
"\nexport PATH=\"$PATH:/usr/local/go/bin:$GOPATH/bin\""
} >>~/.zshrc
# shellcheck source=~
source ~/.zshrc
fi
{
echo -e "export GOROOT=\"/usr/local/go\"" \
"\nexport GOPATH=\"$HOME/go\"" \
"\nexport PATH=\"$PATH:/usr/local/go/bin:$GOPATH/bin\""
} >>~/.bashrc
# shellcheck source=~
source ~/.bashrc
{
echo -e "export GOROOT=\"/usr/local/go\"" \
"\nexport GOPATH=\"$HOME/go\"" \
"\nexport PATH=\"$PATH:/usr/local/go/bin:$GOPATH/bin\""
} >>~/.bashrc
# shellcheck source=/dev/null
source ~/.bashrc
mkdir "${GOPATH}"
sudo chown -R root:root "${GOPATH}"
installedGo=1
breakLine
}
# Yarn
##########################################################
installYarn() {
title "Installing Yarn"
sudo apt install -y yarn
breakLine
}
# Memcached
##########################################################
installMemcached() {
title "Installing Memcached"
sudo apt install -y memcached
sudo systemctl start memcached
sudo systemctl enable memcached
breakLine
}
# Redis
##########################################################
installRedis() {
title "Installing Redis"
sudo apt install -y redis-server
sudo systemctl start redis
sudo systemctl enable redis
breakLine
}
# Composer
##########################################################
installComposer() {
title "Installing Composer"
php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');"
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo rm /tmp/composer-setup.php
breakLine
}
# Laravel Installer
##########################################################
installLaravel() {
title "Installing Laravel Installer"
composer global require "laravel/installer"
echo "export PATH=\"$PATH:$HOME/.config/composer/vendor/bin\"" | tee -a ~/.bashrc
breakLine
}
# SQLite Browser
##########################################################
installSqLite() {
title "Installing SQLite Browser"
sudo apt install -y sqlitebrowser
breakLine
}
# DBeaver
##########################################################
installDbeaver() {
title "Installing DBeaver SQL Client"
curlToFile "https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb" "dbeaver.deb"
sudo apt install -y -f ~/dbeaver.deb
sudo rm ~/dbeaver.deb
breakLine
}
# Redis Desktop Manager
##########################################################
installRedisDesktopManager() {
title "Installing Redis Desktop Manager"
sudo snap install redis-desktop-manager
breakLine
}
# Docker
##########################################################
installDocker() {
title "Installing Docker CE with Docker Compose"
sudo apt install -y docker-ce
curlToFile "https://github.com/docker/compose/releases/download/${versionDockerCompose}/docker-compose-$(uname -s)-$(uname -m)" "/usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
sudo groupadd docker
sudo usermod -aG docker "${USER}"
notify "Install a separate runc environment? (recommended on chromebooks)"
while true; do
read -p "(Y/n)" yn
case ${yn} in
[Yy]*)
if [[ ${installedGo} -ne 1 ]] && [[ "$(command -v go)" == '' ]]; then
breakLine
installGoLang
fi
sudo sed -i -e 's/ExecStartPre=\/sbin\/modprobe overlay/#ExecStartPre=\/sbin\/modprobe overlay/g' /lib/systemd/system/containerd.service
sudo apt install libseccomp-dev -y
go get -v github.com/opencontainers/runc
cd "${GOPATH}/src/github.com/opencontainers/runc" || exit
make BUILDTAGS='seccomp apparmor'
sudo cp "${GOPATH}/src/github.com/opencontainers/runc/runc" /usr/local/bin/runc-master
curlToFile "${repoUrl}docker/daemon.json" /etc/docker/daemon.json
sudo systemctl daemon-reload
sudo systemctl restart containerd.service
sudo systemctl restart docker
break
;;
[Nn]*) break ;;
*) echo "Please answer yes or no." ;;
esac
done
breakLine
}
# Kubernetes
##########################################################
installKubernetes() {
title "Installing Kubernetes"
sudo apt install -y kubectl
breakLine
}
# Helm
##########################################################
installHelm() {
title "Installing Helm v${versionHelm}"
curl -fsSl "https://storage.googleapis.com/kubernetes-helm/helm-v${versionHelm}-linux-amd64.tar.gz" -o helm.tar.gz
tar -zxvf helm.tar.gz
sudo mv linux-amd64/helm /usr/local/bin/helm
sudo rm -rf linux-amd64 && sudo rm helm.tar.gz
breakLine
}
# Sops
##########################################################
installSops() {
title "Installing Sops v${versionSops}"
wget -O sops_${versionSops}_amd64.deb "https://github.com/mozilla/sops/releases/download/${versionSops}/sops_${versionSops}_amd64.deb"
sudo dpkg -i sops_${versionSops}_amd64.deb
sudo rm sops_${versionSops}_amd64.deb
breakLine
}
# Wine
##########################################################
installWine() {
title "Installing Wine & Mono"
sudo apt install -y cabextract
sudo apt install -y --install-recommends winehq-stable
sudo apt install -y mono-vbnc winbind
notify "Installing WineTricks"
curlToFile "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" "winetricks"
sudo chmod +x ~/winetricks
sudo mv ~/winetricks /usr/local/bin
notify "Installing Windows Fonts"
winetricks allfonts
notify "Installing Smooth Fonts for Wine"
curlToFile ${repoUrl}"wine_fontsmoothing.sh" "wine_fontsmoothing"
sudo chmod +x ~/wine_fontsmoothing
sudo ./wine_fontsmoothing
clear
notify "Installing Royale 2007 Theme"
curlToFile "http://www.gratos.be/wincustomize/compressed/Royale_2007_for_XP_by_Baal_wa_astarte.zip" "Royale_2007.zip"
sudo chown -R "$(whoami)" ~/
mkdir -p ~/.wine/drive_c/Resources/Themes/
unzip ~/Royale_2007.zip -d ~/.wine/drive_c/Resources/Themes/
notify "Cleaning up..."
rm ~/wine_fontsmoothing -f
rm ~/Royale_2007.zip -f
}
# Postman
##########################################################
installPostman() {
title "Installing Postman"
curlToFile "https://dl.pstmn.io/download/latest/linux64" "postman.tar.gz"
sudo tar xfz ~/postman.tar.gz
sudo rm -rf /opt/postman/
sudo mkdir /opt/postman/
sudo mv ~/Postman*/* /opt/postman/
sudo rm -rf ~/Postman*
sudo rm -rf ~/postman.tar.gz
sudo ln -s /opt/postman/Postman /usr/bin/postman
notify "Adding desktop file for Postman"
curlToFile ${repoUrl}"desktop/postman.desktop" "/usr/share/applications/postman.desktop"
breakLine
}
# Atom IDE
##########################################################
installAtom() {
title "Installing Atom IDE"
sudo apt install -y atom
breakLine
}
# VS Code
##########################################################
installVsCode() {
title "Installing VS Code IDE"
sudo apt install -y code
breakLine
}
# Sublime Text
##########################################################
installSublime() {
title "Installing Sublime Text"
sudo apt install -y sublime-text
sudo apt install -y python-pip
sudo pip install -U CodeIntel
sudo chown -R "$(whoami)" ~/
mkdir -p ~/.config/sublime-text-3/Packages/User/
notify "Adding package control for sublime"
wget "https://packagecontrol.io/Package%20Control.sublime-package" -o ".config/sublime-text-3/Installed Packages/Package Control.sublime-package"
notify "Adding pre-installed packages for sublime"
curlToFile "${repoUrl}settings/PackageControl.sublime-settings" ".config/sublime-text-3/Packages/User/Package Control.sublime-settings"
notify "Applying default preferences to sublime"
curlToFile "${repoUrl}settings/Preferences.sublime-settings" ".config/sublime-text-3/Packages/User/Preferences.sublime-settings"
notify "Installing additional binaries for sublime auto-complete"
curlToFile "https://github.com/emmetio/pyv8-binaries/raw/master/pyv8-linux64-p3.zip" "bin.zip"
sudo mkdir -p ".config/sublime-text-3/Installed Packages/PyV8/"
sudo unzip ~/bin.zip -d ".config/sublime-text-3/Installed Packages/PyV8/"
sudo rm ~/bin.zip
installedSublime=1
breakLine
}
# PHP Storm
##########################################################
installPhpStorm() {
title "Installing PhpStorm IDE ${versionJetbrains}"
curlToFile "https://download.jetbrains.com/webide/PhpStorm-${versionJetbrains}.tar.gz" "phpstorm.tar.gz"
sudo tar xfz ~/phpstorm.tar.gz
sudo rm -rf /opt/phpstorm/
sudo mkdir /opt/phpstorm/
sudo mv ~/PhpStorm-*/* /opt/phpstorm/
sudo rm -rf ~/phpstorm.tar.gz
sudo rm -rf ~/PhpStorm-*
notify "Adding desktop file for PhpStorm"
curlToFile ${repoUrl}"desktop/jetbrains-phpstorm.desktop" "/usr/share/applications/jetbrains-phpstorm.desktop"
breakLine
}
# WebStorm
##########################################################
installWebStorm() {
title "Installing WebStorm IDE ${versionJetbrains}"
curlToFile "https://download.jetbrains.com/webstorm/WebStorm-${versionJetbrains}.tar.gz" "webstorm.tar.gz"
sudo tar xfz ~/webstorm.tar.gz
sudo rm -rf /opt/webstorm/
sudo mkdir /opt/webstorm/
sudo mv ~/WebStorm-*/* /opt/webstorm/
sudo rm -rf ~/webstorm.tar.gz
sudo rm -rf ~/WebStorm-*
notify "Adding desktop file for WebStorm"
curlToFile ${repoUrl}"desktop/jetbrains-webstorm.desktop" "/usr/share/applications/jetbrains-webstorm.desktop"
breakLine
}
# IntelliJ IDEA
##########################################################
installIdea() {
title "Installing IntelliJ IDEA ${versionJetbrains}"
curlToFile "https://download.jetbrains.com/idea/ideaIU-${versionJetbrains}.tar.gz" "idea.tar.gz"
sudo tar xfz ~/idea.tar.gz
sudo rm -rf /opt/idea/
sudo mkdir /opt/idea/
sudo mv ~/idea-*/* /opt/idea/
sudo rm -rf ~/idea.tar.gz
sudo rm -rf ~/idea-*
notify "Adding desktop file for IntelliJ IDEA"
curlToFile ${repoUrl}"desktop/jetbrains-idea.desktop" "/usr/share/applications/jetbrains-idea.desktop"
breakLine
}
# Remmina
##########################################################
installRemmina() {
title "Installing Remmina Client"
sudo apt install -t "${versionDeb}-backports" remmina remmina-plugin-rdp remmina-plugin-secret -y
breakLine
}
# Google Cloud SDK
##########################################################
installGoogleSdk() {
title "Installing Google Cloud SDK"
sudo apt install -y google-cloud-sdk
breakLine
}
# Popcorn Time
##########################################################
installPopcorn() {
title "Installing Popcorn Time v${versionPopcorn}"
sudo apt install -y libnss3 vlc
if [[ -d /opt/popcorn-time ]]; then
sudo rm -rf /opt/popcorn-time
fi
sudo mkdir /opt/popcorn-time
sudo wget -qO- "https://get.popcorntime.sh/build/Popcorn-Time-${versionPopcorn}-Linux-64.tar.xz" | sudo tar Jx -C /opt/popcorn-time
sudo ln -sf /opt/popcorn-time/Popcorn-Time /usr/bin/popcorn-time
notify "Adding desktop file for Popcorn Time"
curlToFile ${repoUrl}"desktop/popcorn.desktop" "/usr/share/applications/popcorn.desktop"
breakLine
}
# ZSH
##########################################################
installZsh() {
title "Installing ZSH Terminal Plugin"
sudo apt install -y zsh fonts-powerline
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
if [[ -f "${HOME}/.zshrc" ]]; then
sudo mv "${HOME}/.zshrc" "${HOME}/.zshrc.bak"
fi
if [[ -f "${HOME}/.oh-my-zsh/themes/agnoster.zsh-theme" ]]; then
sudo mv "${HOME}/.oh-my-zsh/themes/agnoster.zsh-theme" "${HOME}/.oh-my-zsh/themes/agnoster.zsh-theme.bak"
fi
echo '/bin/zsh' >>~/.bashrc
installedZsh=1
breakLine
}
# MySql Community Server
##########################################################
installMySqlServer() {
title "Installing MySql Community Server"
sudo apt install -y mysql-server
sudo systemctl enable mysql
sudo systemctl start mysql
installedMySqlServer=1
breakLine
}
# SDKMAN
###########################################################
installSDKMAN() {
title "Installing SDKMAN!"
curl -s "https://get.sdkman.io" | bash
notify "Initialize SDKMAN!"
# shellcheck source=~
source "$HOME/.sdkman/bin/sdkman-init.sh"
installedSDKMAN=1
breakLine
}
# OpenJDK
############################################################
installOpenJDK() {
title "Installing AdoptOpenJDK ${versionJDK}"
sdk install java "$(sdk list java | grep -Eo "${versionJDK}\.([0-9]+\.){2}j9-adpt")"
breakLine
}
###############################################################
## MAIN PROGRAM
###############################################################
sudo apt install -y dialog
cmd=(dialog --backtitle "Debian Developer Container - USAGE: <space> select/un-select options & <enter> start installation."
--ascii-lines
--clear
--nocancel
--separate-output
--checklist "Select installable packages:" 42 50 50)
options=(
01 "Git" off
02 "Node v${versionNode}" off
03 "PHP v${versionPhp} with PECL" off
04 "Ruby with DAPP v${versionDapp}" off
05 "Python" off
06 "GoLang v${versionGo}" off
07 "Yarn (package manager)" off
08 "Composer (package manager)" off
09 "React Native" off
10 "Apache Cordova" off
11 "Phonegap" off
12 "Webpack" off
13 "Memcached server" off
14 "Redis server" off
15 "Docker CE (with docker compose)" off
16 "Kubernetes (Kubectl)" off
17 "Helm v${versionHelm}" off
18 "Sops v${versionSops}" off
19 "Postman" off
20 "Laravel installer" off
21 "Wine" off
22 "MySql Community Server" off
23 "SQLite (database tool)" off
24 "DBeaver (database tool)" off
25 "Redis Desktop Manager" off
26 "Atom IDE" off
27 "VS Code IDE" off
28 "Sublime Text IDE" off
29 "PhpStorm IDE v${versionJetbrains}" off
30 "Software Center" off
31 "Remmina (Remote Desktop Client)" off
32 "Google Cloud SDK" off
33 "Popcorn Time v${versionPopcorn}" off
34 "ZSH Terminal Plugin" off
35 "WebStorm IDE v${versionJetbrains}" off
36 "IntelliJ IDEA IDE v${versionJetbrains}" off
37 "SDKMAN!" off
38 "JDK ${versionJDK}" off
)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
# Preparation
##########################################################
title "Installing Pre-Requisite Packages"
cd ~/ || exit
sudo chown -R "$(whoami)" ~/
sudo apt update
sudo apt dist-upgrade -y
sudo apt autoremove -y --purge
sudo apt install -y ca-certificates \
apt-transport-https \
software-properties-common \
wget \
curl \
htop \
mlocate \
gnupg2 \
cmake \
libssh2-1-dev \
libssl-dev \
nano \
vim \
zip \
unzip
if [[ ${versionDeb} == "stretch" ]]; then
sudo apt install -y preload gksu
sudo rm /usr/share/applications/gksu.desktop
fi
sudo updatedb
breakLine
title "Adding Repositories"
for choice in ${choices}; do
case ${choice} in
03) repoPhp ;;
08) repoPhp ;;
20) repoPhp ;;
07) repoYarn ;;
15) repoDocker ;;
16) repoKubernetes ;;
21) repoWine ;;
22) repoMySqlServer ;;
26) repoAtom ;;
27) repoVsCode ;;
28) repoSublime ;;
31) repoRemmina ;;
32) repoGoogleSdk ;;
33) repoVlc ;;
esac
done
notify "Required repositories have been added..."
breakLine
title "Updating apt"
sudo apt update
notify "The apt package manager is fully updated..."
breakLine
for choice in ${choices}; do
case ${choice} in
01) installGit ;;
02) installNode ;;
03) installPhp ;;
04) installRuby ;;
05) installPython ;;
06) installGoLang ;;
07) installYarn ;;
08)
if [[ ${installedPhp} -ne 1 ]]; then
installPhp
fi
installComposer
;;
09)
if [[ ${installedNode} -ne 1 ]]; then
installNode
fi
installReactNative
;;
10)
if [[ ${installedNode} -ne 1 ]]; then
installNode
fi
installCordova
;;
11)
if [[ ${installedNode} -ne 1 ]]; then
installNode
fi
installPhoneGap
;;
12)
if [[ ${installedNode} -ne 1 ]]; then
installNode
fi
installWebpack
;;
13) installMemcached ;;
14) installRedis ;;
15) installDocker ;;
16) installKubernetes ;;
17) installHelm ;;
18)
if [[ ${installedGo} -ne 1 ]]; then
installGoLang
fi
installSops
;;
19) installPostman ;;
20)
if [[ ${installedPhp} -ne 1 ]]; then
installPhp
fi
installLaravel
;;
21) installWine ;;
22) installMySqlServer ;;
23) installSqLite ;;
24) installDbeaver ;;
25) installRedisDesktopManager ;;
26) installAtom ;;
27) installVsCode ;;
28) installSublime ;;
29) installPhpStorm ;;
30) installSoftwareCenter ;;
31) installRemmina ;;
32) installGoogleSdk ;;
33) installPopcorn ;;
34) installZsh ;;
35) installWebStorm ;;
36) installIdea ;;
37) installSDKMAN ;;
38)
if [[ ${installedSDKMAN} -ne 1 ]]; then
installSDKMAN
fi
installOpenJDK
;;
esac
done
# Clean
##########################################################
title "Finalising & Cleaning Up..."
sudo chown -R "$(whoami)" ~/
sudo apt --fix-broken install -y
sudo apt dist-upgrade -y
sudo apt autoremove -y --purge
breakLine
notify "Great, the installation is complete =)"
echo "If you want to install further tool in the future you can run this script again."
###############################################################
## POST INSTALLATION ACTIONS
###############################################################
if [[ ${installedZsh} -eq 1 ]]; then
breakLine
notify "ZSH Plugin Detected..."
cd ~/ || exit
curlToFile ${repoUrl}"zsh/.zshrc" ".zshrc"
sudo chown $USER:$USER .zshrc
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
# shellcheck source=/dev/null
source ~/.zshrc
echo ""
echo "If you are on a Chromebook, to complete the zsh setup you must manually change your terminal settings 'Ctrl+Shift+P':"
echo ""
echo " 1) Set user-css path to: $(tput bold)https://cdnjs.cloudflare.com/ajax/libs/hack-font/3.003/web/hack.css$(tput sgr0)"
echo " 2) Add $(tput bold)'Hack'$(tput sgr0) as a font-family entry."
echo ""
echo "Alternatively:"
echo ""
echo " 1) Import this file directly: $(tput bold)${repoUrl}zsh/crosh.json$(tput sgr0)"
echo ""
echo "If the zsh plugin does not take effect you can manually activate it by adding /bin/zsh to you .bashrc file. "
echo "Further information & documentation on the ZSH plugin: https://github.com/robbyrussell/oh-my-zsh"
fi
if [[ ${installedSublime} -eq 1 ]]; then
breakLine
notify "Sublime Text Detected..."
echo ""
echo "To complete the Sublime Text installation make sure to install the 'Package Control' plugin when first running Sublime."
echo ""
fi
if [[ ${installedMySqlServer} -eq 1 ]]; then
breakLine
notify "MySql Community Server Detected..."
echo ""
echo "If you want to harden your MySql installation run: mysql-secure-install"
echo ""
fi