-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutable_install_script.sh.tmpl
More file actions
1559 lines (1542 loc) · 63 KB
/
executable_install_script.sh.tmpl
File metadata and controls
1559 lines (1542 loc) · 63 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
#!/bin/bash
{{- if ne .chezmoi.config.data.profile "work-server" }}
# Check sudo on all profiles except work-server as we do not have the sudo password there
# If credentials not already cached, ask for password and cache credentials.
# If already cached, increase sudo timeout by 5 min
sudo -v || { echo 'Sudo access needed to execute this script'; exit 1; }
{{ end }}
# Check if dialog is installed. If not, install it.
dialog -v || sudo apt install -y dialog
# First ask to update all keys from ubuntu keyserver
dialog --title "Update Keys" \
--yesno "Do you want to update apt keys ?" 8 45
if [[ "$?" -eq 0 ]]; then
clear
echo " >>> Updating apt keys ...."
sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
read -s -p 'Press Enter to continue ..'
fi
# Check if update is needed
dialog --title "Update" \
--yesno "Do you want to run apt-get update ?" 8 45
if [[ "$?" -eq 0 ]]; then
clear
echo " >>> Updating apt list ...."
sudo apt-get update
read -s -p 'Press Enter to continue ..'
fi
# Install Base dependencies. These should be absolute base, console only dependencies.
dialog --title "Install Base dependencies" \
--yesno "Do you want to install base dependencies (recommended) ?" 8 55
if [[ "$?" -eq 0 ]]; then
# Install base dependencies
clear
echo ">>> Installing base dependencies ...."
sudo apt install tree wget curl htop unzip net-tools vim jq pv \
openssl gnupg-agent apt-transport-https ca-certificates \
software-properties-common make build-essential lsb-release
read -s -p 'Press Enter to continue ..'
fi
# Install Python 3 dependencies
dialog --title "Install Python3 dependencies" \
--yesno "Do you want to install Python3 (recommended) ?" 8 55
if [[ "$?" -eq 0 ]]; then
# Install Python 3 dependencies
clear
echo ">>> Installing Python 3 dependencies ...."
sudo apt install python3-full python3-venv pipx direnv
read -s -p 'Press Enter to continue ..'
fi
# Install Extended dependencies
dialog --title "Install Extended dependencies" \
--yesno "Do you want to install extended dependencies (recommended) ?" 8 55
if [[ "$?" -eq 0 ]]; then
# Install extended dependencies
clear
echo ">>> Installing extended dependencies ...."
sudo apt install xdotool libcanberra-gtk0 libcanberra-gtk-module \
ttyrec ttygif \
unixodbc unixodbc-dev libmagic-dev \
shellcheck snapd wmctrl \
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
python3-gpg libfuse2 gnome-control-center gnome-remote-desktop
read -s -p 'Press Enter to continue ..'
fi
# Check if upgrade is needed
dialog --title "Upgrade" \
--yesno "Do you want to run apt-get upgrade ?" 8 55
if [[ "$?" -eq 0 ]]; then
clear
echo ">>> Upgrading system ...."
sudo apt-get upgrade -y
read -s -p 'Press Enter to continue ..'
fi
# Make $HOME/.local/bin directory if it does not exist
mkdir -p "${HOME}/.local/bin"
# Offer list of applications to select for installation
cmd=(dialog --separate-output --checklist "Please Select Software you want to install:" 22 76 16)
options=(
"------" "------------------------------" off
"------" "----- System Utilities -----" off
"------" "------------------------------" off
"sys000" "hid_apple patch for magic keyboard" off
"sys001" "HDD and NVMe health check tools" off
"sys005" "Touchpad Indicator" off
"sys006" "Solaar - Logitech Unifying Device Manager" off
"sys007" "XPPen G430S Driver" off
"sys008" "Xournal++ - Handwritten notes app" off
"sys010" "Printer Driver - Canon MX490" off
"sys011" "Scanner Driver - Canon MX490" off
"sys012" "Xsane Scanning ssoftware" off
"sys015" "VPN and Gnome Network Manager" off
"sys016" "Tailscale VPN" off
"sys020" "Video4Linux Utils and GUVCViewer - Webcam Manager" off
"------" "------------------------------" off
"------" "----- Base Utilities -----" off
"------" "------------------------------" off
"bas000" "Ubuntu Restricted Extras" off
"bas010" "Adapta theme" off
"bas011" "Icon themes" off
"bas012" "Ubuntu Wallpapers and Source Code fonts" off
"bas020" "AppImage Launcher" off
"bas027" "Firefox" off
"bas028" "Google Chrome" off
"bas029" "Gnome Tweaks, Shell Extensions" off
"bas030" "Gnome Clocks" off
"bas031" "Gnome Calendar" off
"bas099" "dra - Download Release Assets from Github" off
"bas100" "Git" off
"bas100a" "GitHub CLI" off
"bas101" ">> Gitbatch" off
"bas102" "Tig" off
"bas103" ">> Lazygit" off
"bas105" "Git SSH keys" off
"bas106" "Authy 2FA Authenticator" off
"bas110" ">> dotdrop" off
"bas115" "Tmux, powerline" off
"bas120" "VirtualBox" off
"bas121" "Vagrant" off
"bas130" "Docker CE" off
"bas131" "Docker Compose" off
"bas131a" "Docker Scout" off
"bas131b" "Trivy" off
"bas131c" "Grype" off
"bas131d" "Syft" off
"bas132" ">> Lazydocker" off
"bas133" ">> Dive - docker image analyser" off
"bas134" "Ansible" off
"bas135" "Google Cloud SDK" off
"bas136" "AWS CLI SDK" off
"bas137" "Azure CLI SDK" off
"bas138" ">> Terraform" off
"bas139" ">> Packer" off
"bas140" ">> s3cmd" off
"bas150" "Kubernetes Tools" off
"------" "------------------------------" off
"------" "----- IDE -----" off
"------" "------------------------------" off
"ide000" "vim" off
"ide005" "Visual Studio Code" off
"ide006" "Google Antigravity" off
"ide007" "Cursor" off
"ide010" "Jetbrains Toolbox" off
"------" "------------------------------" off
"------" "----- Development Stuff -----" off
"------" "------------------------------" off
"dev000" "Miniconda" off
"dev030" "NodeJS LTS using n-install" off
"dev031" "YARN" off
"dev040" "pyenv" off
"dev041" "Pipenv and Pipes" off
"dev042" "uv - Python package manager" off
"dev050" "OpenJDK 8" off
"dev051" "OpenJDK 11" off
"dev060" "Go language" off
"dev080" "Rust+Cargo" off
"dev100" "dbeaver Community - Databse Tool" off
"dev110" "SQLLite DB Browser" off
"dev120" "Clickhouse" off
"dev130" "Apache Directory Studio" off
"dev140" ">> Ran - Static Http server" off
"dev141" "cfssl tools" off
"dev142" ">> Insomnia REST client" off
"dev143" "Android Tools - adb and fastboot" off
"------" "------------------------------" off
"------" "----- Productivity Stuff -----" off
"------" "------------------------------" off
"prd000" "mdbook" off
"prd001" ">> Joplin - Notes taking application" off
"prd002" ">> Logseq - Personal Knowledge Management" off
"prd003" ">> Draw.io - charting software" off
"prd004" ">> Obsidian - Personal Knowledge Management" off
"prd050" ">> Mailspring" off
"prd051" ">> Minetime" off
"prd052" ">>v Slack" off
"prd060" ">>v Zoom Meetings App" off
"prd061" ">> Microsoft Teams" off
"prd070" "Libreoffice" off
"prd080" ">> PDFsam basic" off
"------" "------------------------------" off
"------" "-------- Image Stuff --------" off
"------" "------------------------------" off
"img000" "Gnome Paint" off
"img001" "mtPaint" off
"img010" "Gnome Screenshot" off
"img011" "Flameshot Screenshot" off
"------" "------------------------------" off
"------" "----- Audio Video Stuff -----" off
"------" "------------------------------" off
"med000" "Spotify Client" off
"med010" "VLC Media Player" off
"med020" "Simple Screen Recorder" off
"med021" "Peek - Screen to Gif Recorder(see gifcap)" off
"med022" "Video Download Helper Companion App" off
"med030" "Open Boradcast Studio" off
"med040" "Lightworks Video Studio" off
"med050" "Shotcut Video Editor" off
)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices; do
case $choice in
sys000) # Installing Apple Magic Keyboard config kernel module
echo ""
echo "Installing dkms..."
sudo apt install -y dkms
echo "Installing hid_apple patched...."
mkdir -p /tmp/magickb
pushd /tmp/magickb
git clone https://github.com/free5lot/hid-apple-patched
pushd hid-apple-patched
sudo dkms add .
sudo dkms build hid-apple/1.0
sudo dkms install hid-apple/1.0
echo "Creating /etc/modprobe.d/hid_apple.conf file...."
echo "options hid_apple fnmode=2" | sudo tee /etc/modprobe.d/hid_apple.conf
echo "options hid_apple swap_fn_leftctrl=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
echo "options hid_apple swap_opt_cmd=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
echo "options hid_apple rightalt_as_rightctrl=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
echo "options hid_apple ejectcd_as_delete=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u
popd
popd
rm -rf /tmp/magickb
echo "Installallation of hid_apple patched completed...."
echo "Please reboot your machine."
echo ""
;;
sys001) # Installing HDD and NVMe disk management tools
echo ""
echo "Installing HDD and NVMe disk management tools...."
sudo apt install -y nvme-cli smartmontools
echo "HDD and NVMe disk management tools installation completed"
echo ""
;;
sys005) # Installing Touchpad Indicator
echo ""
echo "Installing Touchpad Indicator...."
sudo add-apt-repository ppa:atareao/atareao -y
sudo apt-get update
sudo apt install -y touchpad-indicator
echo "Touchpad indicator installation completed."
echo ""
;;
sys006) # Installing Solaar
echo ""
echo "Installing Solaar...."
sudo add-apt-repository ppa:soppa:solaar-unifying/stable -y
sudo apt-get update
sudo apt install -y solaar
echo "Touchpad indicator installation completed."
echo ""
;;
sys007) # Installing XP-Pen G430S drivers
echo ""
echo "Installing XP-Pen G430S drivers ...."
mkdir -p /tmp/xppen
pushd /tmp/xppen
wget --content-disposition https://www.xp-pen.com/download/file/id/1949/pid/56/ext/deb.html
sudo dpkg -i XPPen*.deb
popd
rm -rf /tmp/xppen
echo "XP-Pen G430S driver installation completed. "
echo ""
;;
sys008) # Installing Xournal++
echo ""
echo "Installing Xournal++...."
# Get latest github release tag or version but printing the redirection url for the latest relese
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/xournalpp/xournalpp/releases/latest | rev | cut -d '/' -f 1 | rev)
mkdir -p /tmp/xournal
pushd /tmp/xournal
curl -L "https://github.com/xournalpp/xournalpp/releases/download/${version}/xournalpp-${version:1}-Ubuntu-jammy-x86_64.deb" --output xournalpp.deb
sudo dpkg -i xournalpp.deb
unset version
popd
rm -rf /tmp/xournal
echo "Xournal++ installation completed."
echo ""
;;
sys010) # Installing Cannon MX490 Printer Drivers
echo ""
echo "Installing Canon MX490 Printer Drivers...."
mkdir -p /tmp/cnondriv
pushd /tmp/cnondrv
curl -L http://gdlp01.c-wss.com/gds/9/0100006669/01/cnijfilter2-5.10-1-deb.tar.gz --output driver.tar.gz
tar -zxvf driver.tar.gz
pushd cnijfilter2-5.10-1-deb
sudo ./install.sh
popd
popd
rm -rf /tmp/cnondrv
echo "Canon MX490 Printer driver installation completed. "
echo ""
;;
sys011) # Installing Canon MX490 Scanner Drivers
echo ""
echo "Installing Canon MX490 Scanner Drivers...."
sudo apt install -y libpango-1.0-0
mkdir -p /tmp/cnonscan
pushd /tmp/cnonscan
curl -L http://gdlp01.c-wss.com/gds/2/0100006672/01/scangearmp2-3.10-1-deb.tar.gz --output driver.tar.gz
tar -zxvf driver.tar.gz
pushd scangearmp2-3.10-1-deb
sudo ./install.sh
popd
popd
rm -rf /tmp/cnonscan
echo "Canon MX490 Scanner driver installation completed. "
echo ""
;;
sys012) # Install SANE scanning software
echo ""
echo "Installing xsane scanning software...."
sudo apt-get update
sudo apt install -y sane sane-utils xsane simple-scan
echo "Xsane Installation completed."
echo ""
;;
sys015) # Installing VPN and Gnome Network Manager
echo ""
echo "Installing VPN...."
sudo apt install -y vpnc network-manager-vpnc-gnome
echo "VPN installation completed. You will need to configure VPN connection yourself."
echo ""
;;
sys016) # Installing Tailscale VPN
echo ""
echo "Installing Tailscale VPN...."
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
sudo apt-get update
sudo apt install -y tailscale
echo "Tailscale VPN installation completed."
echo ""
;;
sys020) # Installing Video4Linux
echo ""
echo "Installing Video4Linux and GSVCView..."
sudo apt-add-repository ppa:pj-assis/ppa -y
sudo apt-get update
sudo apt install -y v4l-utils guvcview
echo "Video4Linux and GSVCView installation completed"
echo ""
;;
bas000) # Installing Ubuntu extras
echo ""
echo "Installing ubuntu extras...."
sudo apt install -y ubuntu-restricted-extras
echo "Ubuntu extras installation completed."
;;
bas010) # Installing Adapta Theme
echo ""
echo "Installing Adapta Theme...."
# Below line is commented for 20.04
# sudo apt-add-repository ppa:tista/adapta -y
sudo apt-get update
sudo apt install -y adapta-gtk-theme
echo "Adapta theme installation completed."
echo ""
;;
bas011) # Ubuntu icon themes
echo ""
echo "Installing papirus icons theme...."
sudo add-apt-repository ppa:papirus/papirus -y
sudo apt-get update
sudo apt-get install -y papirus-icon-theme
echo "papirus icon theme installation completed."
echo ""
# echo ""
# echo "Installing moka icons theme...."
# sudo add-apt-repository ppa:snwh/ppa -y
# sudo apt-get update
# sudo apt-get install -y moka-icon-theme faba-icon-theme faba-mono-icons
# echo "moka icon theme installation completed."
# echo ""
;;
bas012) # Install wallpapers and source code fonts
# https://help.gnome.org/admin/system-admin-guide/stable/fonts-user.html.en
echo ""
echo "Installing Wallpapers and Fonts ...."
if [ -f "privatestuff-master.zip" ]; then
mv privatestuff-master.zip /tmp
pushd /tmp
unzip privatestuff-master.zip
mv privatestuff-master/wallpapers $HOME/Pictures
echo "Wallpaer installation completed."
mkdir -p $HOME/.local/share/fonts
mv privatestuff-master/fonts/*.{ttf,otf} $HOME/.local/share/fonts
fc-cache $HOME/.local/share/fonts
echo "Fonts installation completed."
rm -rf /tmp/privatestuff-master.zip && rm -rf privatestuff-master
popd
else
echo "Could not locate privatestuff-master.zip."
echo "Download the zip from https://github.com/hemenkapadia/privatestuff in your broser and put in the same dir as this file."
fi
;;
bas020) # Install AppImage Launcher
echo ""
echo "Installing AppImage Launcher...."
sudo apt install software-properties-common
sudo add-apt-repository ppa:appimagelauncher-team/stable
sudo apt update
sudo apt install appimagelauncher
echo "AppImage Launcher installation completed."
echo ""
;;
bas027) # Installing Firefox
echo ""
echo "Removing Firefox snap browser...."
sudo snap remove firefox
rm -rf "${HOME}/snap/firefox"
echo "Creating /etc/apt/preferences.d/firefox-no-snap file...."
echo "Package: firefox*" | sudo tee /etc/apt/preferences.d/firefox-no-snap
echo "Pin: release o=LP-PPA-mozillateam" | sudo tee -a /etc/apt/preferences.d/firefox-no-snap
echo "Pin-Priority: 1001" | sudo tee -a /etc/apt/preferences.d/firefox-no-snap
echo "Creating /etc/apt/apt.conf.d/51unattended-upgrades-firefox file...."
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
echo "Installing APT browser...."
# Handle as explained in https://www.debugpoint.com/2021/09/remove-firefox-snap-ubuntu/
# and https://askubuntu.com/questions/1399383/how-to-install-firefox-as-a-traditional-deb-package-without-snap-in-ubuntu-22/1403204#1403204
sudo add-apt-repository -y ppa:mozillateam/ppa
sudo apt-get update
sudo apt-get install firefox-esr
echo "Firefox install completed."
;;
bas028) # Installing Google Chrome
echo ""
echo "Installing Google Chrome browser...."
mkdir -p /tmp/chrome
pushd /tmp/chrome
curl -L https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb --output chrome.deb
sudo apt install ./chrome.deb
popd
rm -rf /tmp/chrome
echo "Google Chrome installation completed. "
echo ""
;;
bas029) # Installing Gnome Shell Extensions
echo ""
echo "Installing Gnome Tweaks and Shell Extensions...."
sudo apt install -y gnome-tweaks gnome-shell-extensions
echo "Installing native connectory to manage Gnome Extensions using Chrome...."
sudo apt install -y chrome-gnome-shell
echo "Installing extensions for dock and multi-monitor support...."
sudo apt install -y gnome-shell-extension-dashtodock \
gnome-shell-extension-multi-monitors
echo "Gnome Clocks installation completed."
echo ""
;;
bas030) # Installing Gnome Clocks
echo ""
echo "Installing Gnome Clocks...."
sudo apt install -y gnome-clocks
echo "Gnome Clocks installation completed."
echo ""
;;
bas031) # Installing Gnome Calendar
echo ""
echo "Installing Gnome Calendar...."
sudo apt install -y gnome-calendar
echo "Gnome Calendar installation completed."
echo ""
;;
bas099) # Download Release Assets from Github
echo ""
echo "Downloading dra from Github ...."
mkdir -p /tmp/dra
pushd /tmp/dra
download_url="$(curl -s https://api.github.com/repos/devmatteini/dra/releases/latest | grep -o -E -i -m 1 "https://.+?/dra-.+?-x86_64-unknown-linux-gnu.tar.gz")"
curl -sL "${download_url}" -o dra.tar.gz
tar -xzf dra.tar.gz
rm dra.tar.gz
chmod u+x dra-*-x86_64-unknown-linux-gnu/dra
mv dra-*-x86_64-unknown-linux-gnu/dra "${HOME}"/.local/bin
rm -rf dra-*-x86_64-unknown-linux-gnu
popd
rm -rf /tmp/dra
echo "dra install completed."
echo ""
;;
bas100) # Install Git
echo ""
echo ">>> Installing Git ...."
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt install -y git
echo ">>> Git Installation completed."
echo ">>> Configuring Git user.name and user.email...."
read -p "Enter Git configuration user.name: " username
read -p "Enter Git configuration user.email: " useremail
git config --global user.name "${username}"
git config --global user.email "${useremail}"
;;
bas100a) # Installing Github CLI
echo ""
echo "Downloading GitHub CLI from Github ...."
mkdir -p /tmp/ghcli
pushd /tmp/ghcli
download_url="$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep -o -E -i -m 1 "https://.+?/gh_.+?_linux_amd64.deb")"
curl -sL "${download_url}" -o gh.deb
sudo dpkg -i gh.deb
popd
rm -rf /tmp/ghcli
echo "GitHub CLI install completed."
echo ""
;;
bas101) # Installing Gitbatch
echo ""
echo "Installing gitbatch...."
# Get latest github release tag or version but printing the redirection url for the latest relese
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/isacikgoz/gitbatch/releases/latest | rev | cut -d '/' -f 1 | rev)
mkdir -p /tmp/gitbatch
pushd /tmp/gitbatch
curl -L "https://github.com/isacikgoz/gitbatch/releases/download/${version}/gitbatch_${version:1}_linux_amd64.tar.gz" --output gitbatch.tar.gz
tar xzf gitbatch.tar.gz
chmod u+x gitbatch
mv gitbatch "${HOME}/.local/bin"
unset version
popd
rm -rf /tmp/gitbatch
echo "Gitbatch installation completed."
echo ""
;;
bas102) # Install Tig
echo ""
echo "Installing Tig ...."
sudo apt-get update
sudo apt install -y tig
echo "Tig Installation completed."
echo ""
;;
bas103) # Install Lazygit
echo ""
echo "Installing Lazygit ...."
# Get latest github release tag or version but printing the redirection url for the latest relese
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/jesseduffield/lazygit/releases/latest | rev | cut -d '/' -f 1 | rev)
mkdir -p /tmp/lazygit
pushd /tmp/lazygit
curl -L "https://github.com/jesseduffield/lazygit/releases/download/${version}/lazygit_${version:1}_Linux_x86_64.tar.gz" --output lazygit.tar.gz
tar -zxvf lazygit.tar.gz
chmod u+x lazygit
mv lazygit "${HOME}/.local/bin"
unset version
popd
rm -rf /tmp/lazygit
echo "Lazygit Installation completed."
echo ""
;;
bas105) # Install Git SSH Keys only if file encrypted-ssh-keys.tar.gz is present in this directory.
# It is created using the command below - https://www.tecmint.com/encrypt-decrypt-files-tar-openssl-linux/
# tar --exclude='.ssh/environment' --exclude='.ssh/known_hosts' -czvf - .ssh | openssl enc -e -aes256 -out encrypted-ssh-keys.tar.gz
echo ""
echo ">>> Installing Git SSH only if encrypted ssh key file is present ...."
if [ -f "encrypted-ssh-keys.tar.gz" ]; then
openssl enc -d -aes256 -in encrypted-ssh-keys.tar.gz | tar zxv
echo ">>> Git keys extraction completed."
fi
echo ">>> Adding keys to ssh-agent"
find ~/.ssh -type f -name *id_rsa -exec /usr/bin/ssh-add {} \;
;;
bas106) # Install authy
echo ""
echo "Installing authy ...."
sudo snap install authy
echo "Authy installation completed"
;;
bas110) # Install dotdrop, has to be done as system else global dotrop for system files will not work
echo ""
echo "Installing dotdrop from pypi for the user, not using virtualenv ...."
sudo python3 -m pip install --upgrade dotdrop
echo "dotdrop Installation completed."
echo "Please setup your dordrop repository as explained at https://github.com/deadc0de6/dotdrop/wiki/installation#setup-your-repository"
;;
bas115) # Installing Tmux and Powerline
echo ""
echo "Installing Tmux and Powerline...."
sudo apt install -y tmux fonts-powerline powerline python3-powerline
git clone https://github.com/adidenko/powerline ~/.config/powerline
echo "Configuring Powerline for vim...."
echo "set laststatus=2" >> ~/.vimrc
echo -e "python3 from powerline.vim import setup as powerline_setup" >> ~/.vimrc
echo -e "python3 powerline_setup()\npython3 del powerline_setup" >> ~/.vimrc
echo "Configuring Powerline for terminal...."
echo ". /usr/share/powerline/bindings/bash/powerline.sh" >> ~/.bashrc
echo "Tmux and Powerline installation completed."
echo ""
;;
bas120) # Installing VirtualBox
echo ""
echo "Installing VirtualBox...."
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt-get update && sudo apt install -y virtualbox-7.1
echo "VirtualBox installation completed."
;;
bas121) # Installing Vagrant
echo ""
echo "Installing Vagrant ...."
# curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
# sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vagrant
echo "Vagrant installation completed."
;;
bas130) # Installing Docker Community Edition
echo ""
echo "Installing Docker CE...."
sudo apt-get remove docker docker-engine docker.io containerd runc
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -a -G docker $USER
echo "Docker installation completed."
;;
bas131) # Install docker compose
echo "Docker compose is now part of Docker CE"
# # Get latest github release tag or version but printing the redirection url for the latest relese
# version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/docker/compose/releases/latest | rev | cut -d '/' -f 1 | rev)
# version="1.27.4" # hardcoading as 1.28.0 was giving python library error
# echo "Installing Docker Compose...."
# sudo curl -L "https://github.com/docker/compose/releases/download/${version}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# sudo chmod +x /usr/local/bin/docker-compose
# unset version
# echo ""
;;
bas131a) # Install Docker Scout
echo "Installing Docker Scout..."
mkdir -p "${HOME}/.docker/scout"
download_url="$(curl -s https://api.github.com/repos/docker/scout-cli/releases/latest | grep -o -E -i -m 1 "https://.+?/docker-scout_.+?_linux_amd64.tar.gz")"
curl -sL "${download_url}" >scout.tar.gz && tar -xzf scout.tar.gz docker-scout && rm scout.tar.gz && mv docker-scout "${HOME}/.docker/scout"
jq ".cliPluginsExtraDirs |= [\"$HOME/.docker/scout\"]" "${HOME}/.docker/config.json" > temp.json && mv temp.json "${HOME}/.docker/config.json"
unset download_url
echo "Docker Scout installation completed."
echo ""
;;
bas131b) # Install Trivy
echo "Installing Trivy ...."
download_url="$(curl -s https://api.github.com/repos/aquasecurity/trivy/releases/latest | grep -o -E -i -m 1 "https://.+?/trivy_.+?_Linux-64bit.tar.gz")"
curl -sL "${download_url}" >trivy.tar.gz && tar -xzf trivy.tar.gz trivy && rm trivy.tar.gz && mv trivy "${HOME}/.local/bin"
unset download_url
echo "Trivy installation completed."
echo ""
;;
bas131c) # Install Grype
echo "Installing Grype ...."
download_url="$(curl -s https://api.github.com/repos/anchore/grype/releases/latest | grep -o -E -i -m 1 "https://.+?/grype_.+?_linux_amd64.tar.gz")"
curl -sL "${download_url}" >grype.tar.gz && tar -xzf grype.tar.gz grype && rm grype.tar.gz && mv grype "${HOME}/.local/bin"
unset download_url
echo "Grype installation completed."
echo ""
;;
bas131d) # Install Syft
echo "Installing Syft...."
download_url="$(curl -s https://api.github.com/repos/anchore/syft/releases/latest | grep -o -E -i -m 1 "https://.+?/syft_.+?_linux_amd64.tar.gz")"
curl -sL "${download_url}" >syft.tar.gz && tar -xzf syft.tar.gz syft && rm syft.tar.gz && mv syft "${HOME}/.local/bin"
unset download_url
echo "Syft installation completed."
echo ""
;;
bas132) # Installing Lazydocker
echo ""
echo "Installing Lazydocker ...."
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
mv lazydocker "${HOME}/.local/bin"
echo "Lazydocker installation completed."
echo ""
;;
bas133) # Installing Dive - docker image analyser
echo ""
echo "Installing Dive - docker image analyser...."
# Get latest github release tag or version but printing the redirection url for the latest release
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/wagoodman/dive/releases/latest | rev | cut -d '/' -f 1 | rev)
mkdir -p /tmp/dive
pushd /tmp/dive
curl -L "https://github.com/wagoodman/dive/releases/download/${version}/dive_${version:1}_linux_amd64.deb" --output dive.deb
sudo apt install ./dive.deb
unset version
popd
rm -rf /tmp/dive
echo "Dive installation completed. "
echo ""
;;
bas134) # Installing Ansible
echo ""
echo "Installing Ansible...."
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible python3-argcomplete
sudo activate-global-python-argcomplete
echo "Ansible installation completed."
echo ""
;;
bas135) # Installing Google Cloud SDK
echo ""
echo "Installing Google Cloud SDK...."
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get update && sudo apt-get install -y google-cloud-sdk
echo "Google Cloud SDK installation completed."
echo ""
;;
bas136) # Installing AWS CLI
echo ""
echo "Installing AWS CLI...."
mkdir -p /tmp/awscli
pushd /tmp/awscli
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
if which aws; then
sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin --update
else
sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin
fi
popd
rm -rf /tmp/awscli
echo "AWS CLI installation completed."
echo ""
;;
bas137) # Installing Azure CLI
echo ""
echo "Installing Azure CLI...."
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update && sudo apt-get install -y azure-cli
echo "Azure CLI installation completed."
echo ""
;;
bas138) # Installing Terraform
echo ""
echo "Installing Terraform...."
mkdir -p /tmp/terraform
pushd /tmp/terraform
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/hashicorp/terraform/releases/latest | rev | cut -d '/' -f 1 | rev)
curl -L "https://releases.hashicorp.com/terraform/${version:1}/terraform_${version:1}_linux_amd64.zip" --output terraform.zip
unzip terraform.zip
chmod u+x terraform
mv terraform "${HOME}/.local/bin"
popd
unset version
rm -rf /tmp/terraform
echo "Terraform installation completed."
echo ""
;;
bas139) # Installing Packer
echo ""
echo "Installing Packer...."
mkdir -p /tmp/packer
pushd /tmp/packer
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/hashicorp/packer/releases/latest | rev | cut -d '/' -f 1 | rev)
curl -L "https://releases.hashicorp.com/packer/${version:1}/packer_${version:1}_linux_amd64.zip" --output packer.zip
unzip packer.zip
chmod u+x packer
mv packer "${HOME}/.local/bin"
popd
unset version
rm -rf /tmp/packer
echo "Packer installation completed."
echo ""
;;
bas140) # Install s3cmd
echo ""
echo "Installing s3cmd from pypi systemwide ...."
python3 -m pip install --user --upgrade s3cmd
echo "s3cmd Installation completed."
;;
bas150) # Installing Kubernetes Tools
# Show k8s tool dialog
kcmd=(dialog --separate-output --checklist "Select k8s tools to install:" 22 76 16)
koptions=(
"------" "--------- k8s flavors --------" off
"k000" "k3d - local k8s cluster using docker" off
"k001" "kind - k3d alternative, local k8s using docker" off
"k002" "k0s - single node kubernetes on baremetal" off
"k003" "k0sctl - multinode kubernetes on baremetal" off
"------" "------- k8s cli tools -------" off
"k010" "kubectl - the main k8s controller cli" off
"k011" "kubectx (context) and kubens (namespace) switchers" off
"k012" "krew - kubectl plugin manager" off
"k013" "kubestr - Kubernetes Storage Check" off
"k014" "velero CLI - CLI for Velero K8S backup tool" off
"k020" "Replicated - replicated cli, KOTS cli, Support Bundle ctl (sbctl)" off
"------" "-------- cli monitor -------" off
"k030" "k9s - terminal gui based k8s cli" off
"k031" "kubebox - Terminal and Web console for K8S" off
"------" "------- package mgrs -------" off
"k200" "Helm" off
)
kchoices=$("${kcmd[@]}" "${koptions[@]}" 2>&1 >/dev/tty)
clear
for kchoice in $kchoices; do
case $kchoice in
k000)
echo "Installing k3d...."
# Get latest github release tag or version but printing the redirection url for the latest relese
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/rancher/k3d/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/rancher/k3d/releases/download/${version}/k3d-linux-amd64" -O "${HOME}/.local/bin/k3d"
unset version
chmod u+x "${HOME}/.local/bin/k3d"
echo "k3d installation completed."
echo ""
;;
k001)
echo "Installing kind...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/kubernetes-sigs/kind/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/kubernetes-sigs/kind/releases/download/${version}/kind-linux-amd64" -O "${HOME}/.local/bin/kind"
unset version
chmod u+x "${HOME}/.local/bin/kind"
echo "kind installation completed."
echo ""
;;
k002)
echo "Installing k0s...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/k0sproject/k0s/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/k0sproject/k0s/releases/download/${version}/k0s-${version}-amd64" -O "${HOME}/.local/bin/k0s"
unset version
chmod u+x "${HOME}/.local/bin/k0s"
k0s completion bash | sudo tee /etc/bash_completion.d/k0s
echo "k0sctl installation completed."
echo ""
;;
k003)
echo "Installing k0sctl...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/k0sproject/k0sctl/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/k0sproject/k0sctl/releases/download/${version}/k0sctl-linux-x64" -O "${HOME}/.local/bin/k0sctl"
unset version
chmod u+x "${HOME}/.local/bin/k0sctl"
k0sctl completion -s bash | sudo tee /etc/bash_completion.d/k0sctl
echo "k0sctl installation completed."
echo ""
;;
k010)
echo ""
echo "Installing kubectl...."
kubectl_version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
wget "https://storage.googleapis.com/kubernetes-release/release/${kubectl_version}/bin/linux/amd64/kubectl" -O "${HOME}/.local/bin/kubectl"
chmod u+x "${HOME}/.local/bin/kubectl"
echo "kubectl installation completed."
echo ""
;;
k011)
echo "Installing kubectx and kubens...."
mkdir -p /tmp/kubectx
pushd /tmp/kubectx
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/ahmetb/kubectx/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/ahmetb/kubectx/releases/download/${version}/kubectx_${version}_linux_x86_64.tar.gz" -O "kubectx.tar.gz"
wget "https://github.com/ahmetb/kubectx/releases/download/${version}/kubens_${version}_linux_x86_64.tar.gz" -O "kubens.tar.gz"
tar -zxvf kubectx.tar.gz
tar -zxvf kubens.tar.gz
chmod u+x kubectx
chmod u+x kubens
mv kubectx "${HOME}/.local/bin"
mv kubens "${HOME}/.local/bin"
popd
unset version
rm -rf /tmp/kubectx
echo "kubectx and kubens installation completed."
echo ""
;;
k013)
echo "Installing kubestr...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/kastenhq/kubestr/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/kastenhq/kubestr/releases/download/${version}/kubestr_${version:1}_Linux_amd64.tar.gz" -O "kubestr.tar.gz"
tar -zxvf kubestr.tar.gz
chmod u+x kubestr
mv kubestr "${HOME}/.local/bin"
unset version
echo "kubestr installation completed."
echo ""
;;
k014)
echo "Installing velero...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/vmware-tanzu/velero/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/vmware-tanzu/velero/releases/download/${version}/velero-${version}-linux-amd64.tar.gz" -O "velero.tar.gz"
tar -zxvf velero.tar.gz
chmod u+x velero
mv velero "${HOME}/.local/bin"
unset version
k0sctl completion | sudo tee /etc/bash_completion.d/velero
echo "velero installation completed."
echo ""
;;
k020)
echo "Installing Replicated Tools...."
mkdir -p /tmp/replicated
pushd /tmp/replicated
echo "Installing Replicated CLI...."
curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
| grep "browser_download_url.*linux_amd64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -O replicated.tar.gz -qi -
tar -zxvf replicated.tar.gz replicated && rm replicated.tar.gz
mv replicated "${HOME}/.local/bin"
echo "Replicated CLI installed"
echo "Installing KOTS CLI...."
curl -s https://api.github.com/repos/replicatedhq/kots/releases/latest \
| grep "browser_download_url.*linux_amd64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -O kots.tar.gz -qi -
tar -zxvf kots.tar.gz kots && rm kots.tar.gz
mv kots "${HOME}/.local/bin"
echo "KOTS CLI installed"
echo "Installing Support Bundle CLI...."
curl -s https://api.github.com/repos/replicatedhq/sbctl/releases/latest \
| grep "browser_download_url.*linux_amd64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -O sbctl.tar.gz -qi -
tar -zxvf sbctl.tar.gz sbctl && rm sbctl.tar.gz
mv sbctl "${HOME}/.local/bin"
echo "Support Bundle CLI installed"
popd
rm -rf /tmp/replciated
echo "Replicated Tools installation completed."
echo ""
;;
k012)
echo "Installing krew...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/kubernetes-sigs/krew/releases/latest | rev | cut -d '/' -f 1 | rev)
mkdir -p /tmp/krew
pushd /tmp/krew
wget "https://github.com/kubernetes-sigs/krew/releases/download/${version}/krew_Linux_amd64.tar.gz" -O krew.tar.gz
unset version
tar -zxvf krew.tar.gz
chmod u+x krew-linux_amd64
./krew-linux_amd64 install krew
popd
echo "krew installation completed."
echo ""
;;
k030)
echo "Installing k9s...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/derailed/k9s/releases/latest | rev | cut -d '/' -f 1 | rev)
mkdir -p /tmp/k9s
pushd /tmp/k9s
wget "https://github.com/derailed/k9s/releases/download/${version}/k9s_Linux_amd64.tar.gz" -O k9s.tar.gz
unset version
tar -zxvf k9s.tar.gz
chmod u+x k9s
mv k9s "${HOME}/.local/bin/k9s"
popd
echo "k9s installation completed."
echo ""
;;
k031)
echo "Installing kubebox...."
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/astefanutti/kubebox/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://github.com/astefanutti/kubebox/releases/download/${version}/kubebox-linux" -O "${HOME}/.local/bin/kubebox"
unset version
chmod u+x "${HOME}/.local/bin/kubebox"
echo "kubebox installation completed."
echo ""
;;
k200)
echo "Installing helm...."
mkdir -p /tmp/helm
pushd /tmp/helm
version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/helm/helm/releases/latest | rev | cut -d '/' -f 1 | rev)
wget "https://get.helm.sh/helm-${version}-linux-amd64.tar.gz" -O helm.tar.gz
unset version
tar -zxvf helm.tar.gz
mv linux-amd64/helm "${HOME}/.local/bin"
chmod u+x "${HOME}/.local/bin/helm"
popd
echo "helm installation completed."
echo ""
;;
*)
# Default Option
;;
esac
done
;;
ide000) # Installing vim
echo ""
echo "Installing vim...."
sudo apt install -y vim
echo "Vim installed. Make sure to alias vi to vim"
echo ""
;;