-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·1727 lines (1572 loc) · 60.5 KB
/
setup.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
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
Setup()
{
# Prerequisite for our .tmuxrc
rm -rf /tmp/tmux-1000/* && touch /tmp/tmux-1000/default
# Things to do after installing Ubuntu 17.10
sudo timedatectl set-local-rtc 1
sudo apt install -y language-pack-gnome-fr-base
# https://itsfoss.com/things-installing-ubuntu-17-10/
sudo apt update && sudo apt upgrade -y
sudo apt install -y tlp tlp-rdw i8kutils
sudo tlp start
sudo apt install -y git zsh expect
# Git help tips now in .gitconfig : https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
# Laptop mode : https://www.linuxtricks.fr/wiki/optimiser-linux-pour-un-pc-portable
sudo bash -c 'cat << EOF > /etc/sysctl.d/98-laptop.conf
vm.laptop_mode=5
vm.swappiness=10
EOF'
# Redshift Geoloc
test -f ~/.config/systemd/user/geoclue-agent.service && systemctl --user enable --now geoclue-agent.service
# Add CDROM Roles
sudo usermod -a -G cdrom daffy
}
WIFI()
{
# Wifi do not refresh after suspend
# power on wifi card
# https://askubuntu.com/questions/452826/wireless-networking-not-working-after-resume-in-ubuntu-14-04?noredirect=1&lq=1
(cat << 10_resume_wifi
#!/bin/sh
case "${1}" in
resume|thaw)
nmcli r wifi off && nmcli r wifi on ;;
esac
10_resume_wifi
) | sudo tee -e /etc/pm/sleep.d/10_resume_wifi
chmod 755 /etc/pm/sleep.d/10_resume_wifi
# Restart Network after suspend
# https://www.malachisoord.com/2017/02/18/ubuntu-fix-wifi-after-suspend/
(cat << wifi-resume.service
[Unit]
Description=Restart NetworkManager at resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
ExecStart=/bin/systemctl --no-block restart network-manager.service
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
wifi-resume.service
) | sudo tee -a /etc/systemd/system/wifi-resume.service
sudo systemctl enable wifi-resume.service
# Move shitty iwlwifi file
# https://askubuntu.com/questions/524088/is-this-a-bad-wireless-card
sudo mv /etc/modprobe.d/iwlwifi.conf /etc/modprobe.d/iwlwifi.conf-dist
echo "options iwlwifi wd_disable=1 bt_coex_active=0 11n_disable=1" | sudo tee -a /etc/modprobe.d/iwlwifi.conf
# Take care to suspend module
# http://www.webupd8.org/2013/01/fix-wireless-or-wired-network-not.html
echo "SUSPEND_MODULES=\"\$SUSPEND_MODULES iwldvm iwlwifi\"" | sudo tee -a /etc/pm/config.d/unload_modules
# Discover
sudo apt install bettercap build-essential ruby-dev libpcap-dev
sudo gem install bettercap
sudo bettercap
}
PPA()
{
# Add keys
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
# this tool aims to be ran from Ubuntu
# install additionnal repositories
for ppa in \
ppa:pbek/qownnotes \
ppa:peterlevi/ppa \
ppa:teejee2008/ppa \
ppa:unit193/encryption \
ppa:vincent-vandevyvre/vvv \
ppa:yubico/stable \
ppa:libreoffice/ppa \
ppa:yannubuntu/boot-repair \
ppa:peterlevi/ppa \
ppa:danielrichter2007/grub-customizer \
ppa:bashtop-monitor/bashtop \
ppa:libratbag-piper/piper-libratbag-git \
ppa:nextcloud-devs/client \
ppa:appimagelauncher-team/stable \
ppa:yannick-mauray/quickgui \
ppa:flexiondotorg/quickemu
do
sudo apt-add-repository -n --yes ${ppa}
done
sudo apt-get update
sudo apt install -y hollywood qownnotes peek variety timeshift veracrypt \
ddgr software-properties-common boot-repair variety \
grub-customizer bashtop piper gh nautilus-nextcloud appimagelauncher \
quickgui quickemu
# can not install on focal (dependancy problems) sudo apt install -y oqapy
}
Packages()
{
# Install some packages
sudo apt install -y \
acct alot asciidoc aide aide-common alien apt-file apt-cacher aria2 ardour asciidoctor aspell-fr atop awscli auditd \
baobab barrier bc blueman brasero build-essential bundler \
ca-certificates cargo checkinstall cheese chrome-gnome-shell cifs-utils clipit checksecurity cloc cmake colord-gtk-utils colordiff corkscrew cowsay cpuid curl \
darktable ddgr debian-goodies default-jre debsecan debsums deluge-gtk deluged dfc dkms digikam dnstracer dos2unix duf \
easytag eatmydata ethstatus ethtool ettercap-graphical evince evolution evolution-ews exa extrace exuberant-ctags \
fail2ban fastboot fastfetch fdupes ffmpegthumbnailer filezilla flameshot fonts-powerline fortunes fonts-radisnoir fpart ftp \
gajim geary geogebra-gnome gimp git-extras gnome-tweaks gnome-usage gnupg2 gnupg-agent googler gparted graphviz gromit-mpx gron gthumb guake guake-indicator \
handbrake hashcat heimdall-flash-frontend hey htop httpcode httperf httpie httping hugin hugo hunspell-fr hunspell-fr-comprehensive hwloc libhwloc-contrib-plugins \
i2c-tools: iftop inkscape innoextract ioping iotop ipcalc iproute2 iptraf-ng iputils-arping iptstate \
josm josm-l10n jq jxplorer \
kdenlive kdocker keepassxc keychain kigo klavaro kodi krita krita-l10n \
ldap-utils lftp libeatmydata1 libimage-exiftool-perl libpam-tmpdir libpam-yubico libreoffice-calc libreoffice-draw libreoffice-help-fr libreoffice-impress libreoffice-math libreoffice-nlpsolver libreoffice-voikko libreoffice-writer libreoffice-writer2latex libreoffice-gnome libva-glx2 lm-sensors libsecret-tools lmms lnav lolcat lsof ltrace lxc python3-lxc lynx \
mc mediawiki2latexguipyqt meld mgitstatus miller mono-complete mumble mutt \
nautilus-image-converter ncal ncdu needrestart nemo-gtkhash netcat-openbsd neomutt nethogs network-manager-openvpn-gnome nextcloud-desktop nmap nmon notmuch numatop npm \
ocrfeeder offlineimap ooo-thumbnailer openboard openconnect openshot-qt openssh-client openssh-server openvpn \
p7zip pandoc parallel parted pass patch pavucontrol pcp pdfgrep perf-tools-unstable perl-doc pgtop photocollage pinentry-curses pinentry-tty pitivi pm-utils postgresql-client progress psensor pssh putty-tools python3 python3-dev python3-pycurl python3-virtualenv pwgen pydf python3-gpg python-is-python3 \
qalc qemu-system-gui qtpass qtractor \
rclone rdesktop redshift-gtk remmina rename ripgrep rpm rsync \
s3cmd screen screenkey scribus seahorse scdaemon shotwell ssh-import-id sshuttle simple-scan simplescreenrecorder smartmontools sound-juicer sosreport source-highlight spectre-meltdown-checker speedtest-cli sshfs sshpass sslscan socat software-properties-common stopmotion strace stunnel4 synaptic synfigstudio sysstat \
tcpdump tellico termshark testssl.sh thefuck thunderbird tig tilix toilet torbrowser-launcher traceroute trash-cli tshark \
unison-gtk unrar urlview \
vagrant vifm vim-fugitive vim-gtk3 vim-nox vim-python-jedi vim-youcompleteme virt-manager virtualenv vlc \
whois winbind wireshark wkhtmltopdf \
xauth xdg-utils xournalpp xscreensaver xsane \
yamllint \
zmap
sudo apt-get install -y libquazip5-1 libqrencode4
sudo ln -s /usr/lib/x86_64-linux-gnu/libqrencode.so.4 /usr/lib/x86_64-linux-gnu/libqrencode.so.3
# Python alternatives
# sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
# sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 2
sudo update-alternatives --set python /usr/bin/python3.11
}
SNAP()
{
# for snap in androidsdk chromium czkawka code github-desktop gnome-system-monitor hub hugo ipfs-desktop \
for snap in chromium czkawka code codium github-desktop gnome-system-monitor hub hugo ipfs-desktop \
keepassxc magnus mailspring onlyoffice-desktopeditors procs pycharm-community \
rambox shellcheck slack spotify strawberry telegram-desktop whatsdesk yakyak
do
snap install --classic ${snap}
done
sudo snap connect czkawka:removable-media
}
Python()
{
# Python
snap install pycharm-community --classic
# Try alphago .....
# cd /tmp
# git clone https://github.com/maxpumperla/betago
# cd betago
# python run_demo.py
# Install some other pip cool stuff
for pkg in bcc bpytop betago configobj deface docopt git-pull-request grip howdoi icdiff jsonnet kapitan litecli mycli pynvim search-that-hash shodan spotify-cli-linux tenserflow terminaltables virtualenv yt-dlp
do
pip install "${pkg}" --upgrade --break-system-packages
done
}
GO()
{
# GO
# https://golang.org/dl/
# mkdir -p "$GOROOT" "$GOPATH"
# cd "$GOROOT" || exit
# wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz
# tar xvfz go1.9.2.linux-amd64.tar.gz
# rm go1.9.2.linux-amd64.tar.gz
sudo apt install -y golang
go get golang.org/x/tools/cmd/godoc
go get golang.org/x/tools/cmd/goimports
go get -u github.com/golang/lint/golint
# Accept URLs on stdin, replace all query string values with a user-supplied valu
go get -u github.com/tomnomnom/qsreplace
# gau Fetch known URLs from AlienVault's Open Threat Exchange, the Wayback Machine, and Common Crawl.
go install github.com/lc/gau/v2/cmd/gau@latest
# https://github.com/lc/gau/issues/8
sed -i -e "s+alias gau='git add --update'+\#alias gau='git add --update'+g" ~/.oh-my-zsh/plugins/git/git.plugin.zsh
# qf : GF Paterns For (ssrf,RCE,Lfi,sqli,ssti,idor,url redirection,debug_logic, interesting Subs) parameters grep
go get -u github.com/tomnomnom/waybackurls
go get -u github.com/tomnomnom/gf
# assetfinder : Find domains and subdomains related to a given domain
go get -u github.com/tomnomnom/assetfinder
# ffuf – Fast Web Fuzzer Linux Tool Written in Go
go get -u github.com/ffuf/ffuf
# tips cross compilation
# CGO_ENABLED=yes go build
go get github.com/claudiodangelis/qrcp
cd /tmp || exit
git clone https://github.com/rs/curlie.git
cd curlie || exit
go build .
go install .
}
Crontab()
{
# Install Usefull local crontabs
cd /tmp || exit
cat > crontab << \EOF
16 02 * * * /home/daffy/bin/get_screensavers.py /home/daffy/Dropbox/Screensavers
@reboot cd /home/daffy/Documents/Code/git/github/noisy && /usr/bin/docker run -it noisy --config config.json
EOF
crontab crontab && rm crontab
}
Albert()
{
# MacOS Launcher
curl https://build.opensuse.org/projects/home:manuelschneid3r/public_key | sudo apt-key add -
echo 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/Debian_12/ /' | sudo tee /etc/apt/sources.list.d/home:manuelschneid3r.list
sudo wget -nv https://download.opensuse.org/repositories/home:manuelschneid3r/Debian_12/Release.key -O "/etc/apt/trusted.gpg.d/home:manuelschneid3r.asc"
sudo apt update
sudo apt install -y albert
}
Android()
{
# Android Rules
cd /tmp || exit
git clone [email protected]:M0Rf30/android-udev-rules.git
sudo cp android-udev-rules/51-android.rules /etc/udev/rules.d/
sudo chmod a+r /etc/udev/rules.d/51-android.rules
sudo groupadd adbusers
sudo usermod -a -G adbusers "$(whoami)"
sudo udevadm control --reload-rules
sudo service udev restart
}
Ansible()
{
# ansible & ARA
python3 -m pip install --user ansible "ara[server]" --break-system-packages
# molecule : https://blog.octo.com/en/the-wizard-ansible-molecule-and-test-driven-development/
python3 -m pip install --user molecule --break-system-packages
cd /tmp || exit
git clone https://github.com/metacloud/molecule
cd /tmp/molecule/tests/fixtures/integration/test_command/molecule/docker || exit
molecule test
# Run ansible playbooks in parallel.
python3 -m pip install ansible-parallel --break-system-packages
}
Argbash()
{
# Argbash : https://github.com/matejak/argbash/
cd /tmp || exit 1
wget https://github.com/matejak/argbash/archive/2.8.0.zip
unzip 2.8.0.zip
cd argbash-2.8.0 || exit 1
cd resources || exit 1
make install PREFIX=$HOME/.local
}
Atom()
{
# Atom
curl -L https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
sudo apt-get update
sudo apt-get install -y atom
# Install atom modules
# http://flight-manual.atom.io/using-atom/sections/atom-packages/
for module in git-plus \
go-plus \
intentions \
hugofy \
language-hugo \
language-powershell \
language-puppet \
language-terraform \
linter \
linter-docker \
linter-golinter \
linter-packer-validate \
linter-puppet-lint \
linter-shellcheck \
linter-terraform-syntax \
linter-ui-default \
pandoc-convert \
teletype \
terraform-fmt
do
apm install "${module}"
done
echo "apm complete"
}
Bat()
{
# Bat
# https://twitter.com/fdevillamil/status/1095785002791550977?s=09
cd /tmp || exit 1
wget https://github.com/sharkdp/bat/releases/download/v0.10.0/bat_0.10.0_amd64.deb
sudo dpkg -i bat_0.10.0_amd64.deb
}
Delta()
{
cd /tmp || exit 1
wget https://github.com/barnumbirr/delta-debian/releases/download/v0.1.1-1/delta_0.1.1-1_amd64_debian_buster.deb
sudo dpkg -i delta_0.1.1-1_amd64_debian_buster.deb
sudo apt-mark hold delta
}
bcctools()
{
# bcc-tools
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D4284CDD
echo "deb [trusted=yes] https://repo.iovisor.org/apt/bionic bionic-nightly main" | sudo tee /etc/apt/sources.list.d/iovisor.list
sudo apt-get update
sudo apt-get install -y bcc-tools libbcc-examples linux-headers-"$(uname -r)" python3-bcc
}
bluegriffon()
{
#- FIXME bluegriffon
cd /tmp || exit
wget http://bluegriffon.org/freshmeat/3.0.1/bluegriffon-3.0.1.Ubuntu16.04-x86_64.deb
sudo dpkg -i bluegriffon-3.0.1.Ubuntu16.04-x86_64.deb && rm bluegriffon-3.0.1.Ubuntu16.04-x86_64.deb
}
Brew()
{
# Use brew to install softwares on MacOs
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew bundle
}
browsh()
{
# browsh Text Web browser
# Needs Firefox
cd /tmp || exit
wget https://github.com/browsh-org/browsh/releases/download/v1.6.4/browsh_1.6.4_linux_amd64.deb
sudo dpkg -i browsh_1.6.4_linux_amd64.deb
}
Calibre()
{
# Install Calibre
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
}
Chaos()
{
# Chaos toolkit : https://medium.com/chaos-toolkit/announcing-chaos-discover-and-chaos-init-ff2bf02c5a85
docker pull chaostoolkit/chaostoolkit
docker run -it chaostoolkit/chaostoolkit discover chaostoolkit-kubernetes
}
ChatGPT()
{
# Install a chatgpt commandline
curl -sS https://raw.githubusercontent.com/0xacx/chatGPT-shell-cli/main/install.sh | sudo -E bash
}
Children()
{
# Add some games
sudo apt install -y \
brainparty briquolo cgoban colobot connectagram \
extremetuxracer fretsonfire-songs-muldjord frozen-bubble gbrainy gcompris-qt grhino \
junior-config junior-programming khangman lutris mu-cade opencity pingus supertuxkart tomatoes tuxmath tuxtype
# when you need to add users to junior-programming
sudo dpkg-reconfigure --force junior-config
}
Chrome()
{
# Chrome
# https://doc.ubuntu-fr.org/google_chrome
# https://www.google.com/chrome/browser/desktop/index.html
sudo sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y google-chrome-stable
}
chromeIPass()
{
# chromeIPass : https://github.com/pfn/passifox/
sudo wget https://raw.github.com/pfn/keepasshttp/master/KeePassHttp.plgx -O /usr/lib/keepass2/KeePassHttp.plgx
}
CLOUD()
{
# some cloud tools
# Packer
# https://www.packer.io/downloads.html
cd ~/bin || exit
wget https://releases.hashicorp.com/packer/1.1.1/packer_1.1.1_linux_amd64.zip
unzip -f packer_1.1.1_linux_amd64.zip
rm packer_1.1.1_linux_amd64.zip
# terraform
# https://www.terraform.io/downloads.html
cd ~/bin || exit
wget https://releases.hashicorp.com/terraform/1.2.9/terraform_1.2.9_linux_amd64.zip
unzip -f terraform_1.2.9_linux_amd64.zip
rm -f terraform_1.2.9_linux_amd64.zip getTerraformProviders.sh
wget https://gist.githubusercontent.com/jnahelou/63947831a8154daf6bc3573cc27ed373/raw/e7c685d8ae80e3c6b17238703a870cab00edc7b0/getTerraformProviders.sh
sudo mkdir -p /usr/local/terraform/toolbox/providers/
sudo bash ~/bin/getTerraformProviders.sh
cd "$HOME" || exit
terraform init -plugin-dir=/usr/local/terraform/toolbox/providers/
# terraform graph | dot -Tpng > terraform-graph.png
# rancher
# https://github.com/rancher/cli/release
cd ~/bin || exit
wget https://github.com/rancher/cli/releases/download/v0.6.5-rc4/rancher-linux-amd64-v0.6.5-rc4.tar.gz
tar xvfz rancher-linux-amd64-v0.6.5-rc4.tar.gz
rm rancher-linux-amd64-v0.6.5-rc4.tar.gz
# https://github.com/rancher/rancher-compose/releases
cd ~/bin || exit
wget https://github.com/rancher/rancher-compose/releases/download/v0.12.5/rancher-compose-linux-amd64-v0.12.5.tar.gz
tar xvfz rancher-compose-linux-amd64-v0.12.5.tar.gz
rm rancher-compose-linux-amd64-v0.12.5.tar.gz
# ack-grep
# https://beyondgrep.com/install/
curl https://beyondgrep.com/ack-2.22-single-file > ~/bin/ack && chmod 0755 ~/bin/ack
# CloudConvert
sudo npm install -g cloudconvert-cli
export CLOUDCONVERT_API_KEY=changeme
# Gandi Client
cd /tmp || exit
sudo apt-get install -y python-nose python3-nose python-ipy
git clone https://github.com/Gandi/gandi.cli.git
cd gandi.cli || exit
ln -sf packages/debian debian && debuild -us -uc -b && sudo dpkg -i ../python-gandicli_1.0_all.deb
# Vault
wget https://releases.hashicorp.com/vault/0.9.3/vault_0.9.3_linux_amd64.zip -O ~/bin/vault_0.9.3_linux_amd64.zip
unzip ~/bin/vault_0.9.3_linux_amd64.zip && rm ~/bin/vault_0.9.3_linux_amd64.zip
vault -autocomplete-install
export VAULT_ADDR='http://127.0.0.1:8200'
# setup https://github.com/Caiyeon/goldfish/wiki/Production-Deployment
# GCP
# Create environment variable for correct distribution
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
# Add the Cloud SDK distribution URI as a package source
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
# Update the package list and install the Cloud SDK
sudo apt-get update && sudo apt-get install -y google-cloud-sdk
# Install components
gcloud components install gke-gcloud-auth-plugin
# AZURE
# Install prerequisite packages:
sudo apt-get install apt-transport-https lsb-release software-properties-common dirmngr -y
# Modify your sources list:
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
# Get the Microsoft signing key:
sudo apt-key --keyring /etc/apt/trusted.gpg.d/Microsoft.gpg adv \
--keyserver packages.microsoft.com \
--recv-keys BC528686B50D79E339D3721CEB3E94ADBE1229CF
# Install the CLI:
sudo apt-get update
sudo apt-get install azure-cli
# Install Azure Functions Core Tools
cd /tmp || exit
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y azure-functions-core-tools
# ASDF
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2
# already in this git repo here
# echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
# echo ". $HOME/.asdf/asdf.sh" >> ~/.zshrc
# MISE
#
apt update -y && apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
sudo apt update
sudo apt install -y mise
}
coolretroterm()
{
# FIXME cool-retro-term
cd /tmp || exit
sudo apt -y install build-essential qml-module-qtgraphicaleffects qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtquick-controls qml-module-qtquick-dialogs qmlscene qt5-default qt5-qmake qtdeclarative5-dev qtdeclarative5-localstorage-plugin qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin
git clone --recursive https://github.com/Swordfish90/cool-retro-term.git
cd cool-retro-term || exit
qmake && make
sudo make install
}
CozyDrive()
{
# CozyDrive
mkdir -p ~/Applications
wget -O ~/Applications/CozyDrive-3.6.0-x86_64.AppImage https://nuts.cozycloud.cc/download/channel/stable/64
chmod +x ~/Applications/CozyDrive-3.6.0-x86_64.AppImage
GnomeExtensions
gnomeshell-extension-manage --install --extension-id 1031
}
CrowdSec()
{
# CrowdSec : https://github.com/crowdsecurity/crowdsec?tab=readme-ov-file
curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | sudo bash
sudo apt-get update
sudo apt install -y crowdsec
sudo apt install -y crowdsec-firewall-bouncer-iptables
sudo crowdsec -t && sudo systemctl restart crowdsec
}
Ctop()
{
# Top-like interface for container metrics https://ctop.sh
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7/ctop-0.7-linux-amd64 -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
}
Docker()
{
# FIXME Docker
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
sudo apt-get install linux-image-extra-"$(uname -r)" linux-image-extra-virtual
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-compose
cd /tmp || exit
wget https://github.com/DockStation/dockstation/releases/download/v1.3.0/dockstation_1.3.0_amd64.deb
sudo dpkg -i /tmp/dockstation_1.3.0_amd64.deb && rm /tmp/dockstation_1.3.0_amd64.deb
sudo gpasswd -a $USER docker
# https://github.com/jesseduffield/lazydocker#installation
go get github.com/jesseduffield/lazydocker
# Dive https://github.com/wagoodman/dive
cd /tmp || exit
DIVE_VERSION=$(curl -sL "https://api.github.com/repos/wagoodman/dive/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
curl -OL https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.deb
sudo apt install ./dive_${DIVE_VERSION}_linux_amd64.deb
}
Douane()
{
# Douane Firewal
# Following doc : https://github.com/Douane/Douane
sudo apt install liblog4cxx-dev libdbus-c++-dev libboost-filesystem-dev libboost-regex-dev libboost-signals-dev libgtkmm-3.0-dev
}
DroidCAM()
{
# DroiCAM : use smartphone as webcam on computer
# https://www.dev47apps.com/droidcam/linux/
cd /tmp/ || exit 1
wget https://files.dev47apps.net/linux/droidcam_latest.zip
unzip droidcam_latest.zip -d droidcam
cd droidcam && sudo ./install-client
sudo apt install linux-headers-$(uname -r) gcc make
sudo ./install-video
sudo ./install-sound
}
Dropbox()
{
# Dropbox
# https://www.dropbox.com/install-linux
cd /tmp || exit 1
wget -O dropbox_2020.03.04_amd64.deb https://www.dropbox.com/download?dl=packages/debian/dropbox_2020.03.04_amd64.deb
sudo dpkg -i dropbox_2020.03.04_amd64.deb
sudo apt --fix-broken install
echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; sudo sysctl -p
}
DVD()
{
# Encrypted DVD
sudo apt install -y libdvd-pkg
sudo dpkg-reconfigure libdvd-pkg
}
Element()
{
# Element : a Matrix client
sudo apt install -y wget apt-transport-https
sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main" | sudo tee /etc/apt/sources.list.d/element-io.list
sudo apt update
sudo apt install -y element-desktop
}
FlatPackages()
{
# misc softwares available with flatpack command
FlatPack
for pkg in ch.openboard.OpenBoard com.getpostman.Postman com.github.xournalpp.xournalpp com.valvesoftware.Steam \
org.geogebra.GeoGebra org.gnome.Cheese org.gnome.FeedReader org.jamovi.jamovi org.jdownloader.JDownloader \
org.kde.krita org.openshot.OpenShot org.openstreetmap.josm org.pitivi.Pitivi io.github.Bavarder.Bavarder app.drey.Dialect
do
flatpak install flathub "${pkg}"
done
}
FlatPack()
{
# New Package system
sudo apt install -y flatpak
sudo apt install -y gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
}
Fuzzy()
{
# fzf: Fuzzy Finder
cd /tmp || exit
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
}
GCStar()
{
# gcstar : collection software
sudo apt install -y libogg-vorbis-header-pureperl-perl libnet-freedb-perl libmp3-tag-perl libgd-graph3d-perl libdatetime-format-strptime-perl libtest-mocktime-datecalc-perl libgtk3-simplelist-perl libxml-simple-perl
cd /tmp || exit
wget https://gitlab.com/GCstar/GCstar/-/archive/v1.7.3/GCstar-v1.7.3.tar.gz
tar xvfz GCstar-v1.7.3.tar.gz
cd /tmp/GCstar-v1.7.3/gcstar && sudo ./install
rm /tmp/GCstar-v1.7.3.tar.gz*
}
Github()
{
# Github
snap install --edge github-desktop
snap install hub --classic
}
GnomeExtensions()
{
# Install Gnome-extensions
# https://wiki.gnome.org/Projects/GnomeShell/Extensions#Enabling_extensions
# https://github.com/cyberalex4life/gnome-shell-extension-cl/blob/master/gnome-shell-extension-cl
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 906
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 15
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 7
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 10
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 905
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 1036
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 16
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 1116
gnomeshell-extension-manage --install --extension-id 708
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 1544
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 1104
# [email protected] - enabled
gnomeshell-extension-manage --install --extension-id 97
# Burn My Windows
gnomeshell-extension-manage --install --extension-id 4679
# Emoji Selector
gnomeshell-extension-manage --install --extension-id 1162
# Vitals
gnomeshell-extension-manage --install --extension-id 1460
# Frippery Move Clock
gnomeshell-extension-manage --install --extension-id 2
# Dynamic Panel Transparency
gnomeshell-extension-manage --install --extension-id 1011
# Compiz windows effect
gnomeshell-extension-manage --install --extension-id 3210
cd ~/.local/share/gnome-shell/extensions/[email protected] || exit
npm install
# other params
dconf write /org/gnome/shell/extensions/panel-osd/y-pos 5.0
dconf write /org/gnome/shell/extensions/panel-osd/x-pos 90.0
dconf write /org/gnome/desktop/wm/preferences/button-layout 'close:appmenu'
}
GnomeConfigurations()
{
# Misc Gnome configurations
# Some help : https://askubuntu.com/questions/971067/how-can-i-script-the-settings-made-by-gnome-tweak-tool
# dconf watch / is your friend !
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true
gsettings set org.gnome.settings-daemon.plugins.color night-light-last-coordinates '(50.633000000000003, 3.0586000000000002)'
gsettings set org.gnome.desktop.wm.preferences theme 'Radiance'
gsettings set org.gnome.desktop.interface gtk-theme 'Radiance'
gsettings set org.gnome.desktop.interface cursor-theme 'DMZ-White'
gsettings set org.gnome.desktop.interface cursor-size 10
gsettings set org.gnome.desktop.interface icon-theme 'ubuntu-mono-dark'
gsettings set org.gnome.desktop.interface monospace-font-name 'Ubuntu Mono 13'
gsettings set org.gnome.gedit.preferences.print print-font-body-pango 'Monospace 9'
gsettings set org.gnome.gedit.preferences.editor editor-font 'Monospace 12'
gsettings set org.gnome.gedit.preferences.print print-font-body-pango 'Monospace 9'
gsettings set org.gnome.gedit.preferences.editor editor-font 'Monospace 12'
gsettings set org.gnome.gedit.plugins.pythonconsole font 'Monospace 10'
gsettings set org.gnome.meld custom-font 'monospace, 14'
gsettings set org.gnome.gedit.plugins.externaltools font 'Monospace 10'
gsettings set org.gnome.desktop.interface clock-show-date true
gsettings set org.gnome.mutter dynamic-workspaces false
gsettings set org.gnome.mutter workspaces-only-on-primary true
gsettings set org.gnome.shell favorite-apps "['firefox.desktop', 'google-chrome.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'org.gnome.Nautilus.desktop', 'youtube-dlg.desktop', 'cacher.desktop', 'spotify.desktop', 'atom.desktop', 'keepass2.desktop', 'com.gexperts.Tilix.desktop', 'QOwnNotes.desktop', 'thunderbird.desktop']"
gsettings set org.gnome.shell.window-switcher current-workspace-only false
gsettings set org.gnome.desktop.screensaver lock-delay 120
gsettings set org.gnome.desktop.privacy report-technical-problems true
gsettings set org.gnome.desktop.screensaver picture-options 'zoom'
gsettings set org.gnome.desktop.screensaver primary-color '#ffffff'
gsettings set org.gnome.desktop.screensaver secondary-color '#000000'
gsettings set org.gnome.nautilus.preferences show-image-thumbnails 'always'
gsettings set org.gnome.desktop.interface icon-theme 'La-Capitaine'
gsettings set org.gnome.desktop.screensaver picture-uri 'file:///usr/share/backgrounds/warty-final-ubuntu.png'
sudo bash -c 'cat << EOF > /usr/share/thumbnailers/ffmpeg.thumbnailer
[Thumbnailer Entry]
TryExec=/usr/bin/ffmpegthumbnailer
Exec=/usr/bin/ffmpegthumbnailer -s %s -i %i -o %o -c png -f -t 10
MimeType=video/flv;video/webm;video/mkv;video/mp4;video/mpeg;video/avi;video/ogg;video/quicktime;video/x-avi;video/x-flv;video/x-mp4;video/x-mpeg;video/x-webm;video/x-mkv;application/x-extension-webm;video/x-matroska;video/x-ms-wmv;video/x-msvideo;video/x-msvideo/avi;video/x-theora/ogg;video/x-theora/ogv;video/x-ms-asf;video/x-m4v;
EOF'
gsettings set org.gnome.settings-daemon.plugins.power power-button-action 'suspend'
gsettings set org.gnome.mutter check-alive-timeout 30000
}
GrafTCP()
{
# GraphTCP : https://github.com/hmgle/graftcp
cd /tmp && git clone https://github.com/hmgle/graftcp.git
cd graftcp && make
}
GRAPH()
{
# dgraph
curl https://get.dgraph.io -sSf | bash
}
Infrakit()
{
# Infrakit : A toolkit for creating and managing declarative, self-healing infrastructure.
mkdir -p $GOPATH/src/github.com/docker || true
cd $GOPATH/src/github.com/docker || exit
git clone [email protected]:docker/infrakit.git
cd infrakit && make get-tools & make ci && make binaries
cp build/* ~/bin/
}
IssueHelper()
{
# Issue-helper
sudo apt remove cargo rustc
curl https://sh.rustup.rs -sSf | sh
source "${HOME}"/.cargo/env
cargo install gli
}
Keybase()
{
# Keybase
# https://keybase.io/docs/the_app/install_linux
curl -o /tmp/keybase_amd64.deb -O https://prerelease.keybase.io/keybase_amd64.deb
sudo dpkg -i /tmp/keybase_amd64.deb
sudo apt-get install -f
}
K3S()
{
# Kubernetes Light
curl -sfL https://get.k3s.io | sh -
# Check for Ready node, takes ~30 seconds
sudo k3s kubectl get node
sudo k3s server &
# Kubeconfig is written to /etc/rancher/k3s/k3s.yaml
sudo k3s kubectl get node
# On a different node run the below command.
# NODE_TOKEN comes from /var/lib/rancher/k3s/server/node-token on your server
# sudo k3s agent --server https://myserver:6443 --token ${NODE_TOKEN}
}
Kubernetes()
{
# Kubernetes
sudo apt install -y k9s
# https://github.com/kubernetes/minikube
cd ~/bin/ || exit
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/"$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)"/bin/linux/amd64/kubectl && chmod +x kubectl
curl -Lo karto https://github.com/Zenika/karto/releases/download/v1.1.0/karto && chmod +x karto
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
mkdir "$HOME"/.kube || true
touch "$HOME"/.kube/config
export KUBECONFIG="$HOME"/.kube/config
minikube start
# this for loop waits until kubectl can access the api server that Minikube has created
for i in {1..150}; do # timeout for 5 minutes
echo "$i\c"
kubectl get po &> /dev/null
if [ $? -ne 1 ]; then
break
fi
sleep 2
done
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
kubectl expose deployment hello-minikube --type=NodePort --port=8080
kubectl get pod
minikube service hello-minikube --url
curl "$(minikube service hello-minikube --url)"
# sudo minikube dashboard
minikube stop
cd /tmp || exit
git clone https://github.com/ahmetb/kubectx.git
cp -v kubectx/{kubectx,kubens} ~/bin/
mkdir -p ~/.oh-my-zsh/completions
chmod -R 755 ~/.oh-my-zsh/completions
cp kubectx/completion/kubectx.zsh ~/.oh-my-zsh/completions/_kubectx.zsh
cp kubectx/completion/kubens.zsh ~/.oh-my-zsh/completions/_kubens.zsh
# kubeval : Validate your Kubernetes configuration files, supports multiple Kubernetes versions
cd /tmp || exit
wget https://github.com/garethr/kubeval/releases/download/0.7.3/kubeval-linux-amd64.tar.gz
tar xvfz kubeval-linux-amd64.tar.gz
mv kubeval ~/bin/
rm kubeval-linux-amd64.tar.gz
# Some other tools
# https://github.com/appscode/kubed
# https://github.com/heptio/ark
# https://github.com/cloudnativelabs/kube-router
# https://github.com/GoogleCloudPlatform/kube-metacontroller
# kustomizer
curl -s https://kustomizer.dev/install/kustomizer.sh | sudo bash
# Install kubectl plugins krew
set -x; cd "$(mktemp -d)" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" &&
tar zxvf krew.tar.gz &&
KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/arm.*$/arm/')" && "$KREW" install krew
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
kubectl krew update
for plugin in debug rbac-lookup who-can flame
do
kubectl krew install ${plugin}
done
# Popeye - A Kubernetes Cluster Sanitizer
cd /tmp || exit
git clone https://github.com/derailed/popeye
cd popeye || exit
# Build and install
go install
# Run
# popeye
#
# Kubevious Healthcheck & syntax
curl https://get.kubevious.io/cli.sh -o install-kubevious.sh && chmod +x install-kubevious.sh && sudo ./install-kubevious.sh && rm install-kubevious.sh
}
Lightworks()
{
# FIXME Lightworks
cd /tmp || exit
wget -O lightworks.deb "https://www.lwks.com/index.php?option=com_docman&task=doc_download&gid=194"
sudo dpkg -i lightworks.deb && rm lightworks.deb
sudo apt --fix-broken install -y
}
lutris()
{
# Lutris Game Platform
echo "deb [signed-by=/etc/apt/keyrings/lutris.gpg] https://download.opensuse.org/repositories/home:/strycore/Debian_12/ ./" | sudo tee /etc/apt/sources.list.d/lutris.list > /dev/null
wget -q -O- https://download.opensuse.org/repositories/home:/strycore/Debian_12/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/lutris.gpg > /dev/null
sudo apt update
sudo apt install -y lutris
}
lynis()
{
# lynis update is really major from ubuntu packages
sudo apt install -y apt-transport-https
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C80E383C3DE9F082E01391A0366C67DE91CA5D5F
echo 'Acquire::Languages "none";' | sudo tee /etc/apt/apt.conf.d/99disable-translations
echo "deb https://packages.cisofy.com/community/lynis/deb/ stable main" | sudo tee /etc/apt/sources.list.d/cisofy-lynis.list
sudo apt update
sudo apt install -y lynis
}
lynishardening()
{
# some suggestions afer lynis report
grep -q "* hard core 0" /etc/security/limits.conf || \
echo "* hard core 0" | sudo tee -a /etc/security/limits.conf
grep -q "fs.suid_dumpable = 0" /etc/sysctl.conf || \
echo "fs.suid_dumpable = 0" | sudo tee -a /etc/sysctl.conf
grep -q "ulimit -S -c 0" /etc/profile || \
echo "ulimit -S -c 0 > /dev/null 2>&1" | sudo tee -a /etc/profile
sudo sysctl -p
sudo postconf -e smtpd_banner=mycomputer
sudo postconf -e disable_vrfy_command=yes
grep -q "AllowTcpForwarding=no" /etc/ssh/sshd_config.d/lynis.conf || \
echo "AllowTcpForwarding=no" | sudo tee -a /etc/ssh/sshd_config.d/lynis.conf
grep -q "ClientAliveCountMax=2" /etc/ssh/sshd_config.d/lynis.conf || \
echo "ClientAliveCountMax=2" | sudo tee -a /etc/ssh/sshd_config.d/lynis.conf
grep -q "Compression=no" /etc/ssh/sshd_config.d/lynis.conf || \
echo "Compression=no" | sudo tee -a /etc/ssh/sshd_config.d/lynis.conf
grep -q "LogLevel=VERBOSE" /etc/ssh/sshd_config.d/lynis.conf || \
echo "LogLevel=VERBOSE" | sudo tee -a /etc/ssh/sshd_config.d/lynis.conf
grep -q "MaxAuthTries=3" /etc/ssh/sshd_config.d/lynis.conf || \
echo "MaxAuthTries=3" | sudo tee -a /etc/ssh/sshd_config.d/lynis.conf
grep -q "MaxSessions=2" /etc/ssh/sshd_config.d/lynis.conf || \
echo "MaxSessions=2" | sudo tee -a /etc/ssh/sshd_config.d/lynis.conf
grep -q "TCPKeepAlive=no" /etc/ssh/sshd_config.d/lynis.conf || \
echo "TCPKeepAlive=no" | sudo tee -a /etc/ssh/sshd_config.d/lynis.conf
sudo apt install acct sysstat
sudo sed -i -e 's+ENABLED="false"+ENABLED="true"+g+' /etc/default/sysstat
sudo systemctl enable sysstat
sudo systemctl restart sysstat
sudo systemctl restart ssh
}
Minishift()
{
# Minishift
# https://github.com/MiniShift/minishift#getting-started
cd /tmp || exit
wget https://github.com/minishift/minishift/releases/download/v1.25.0/minishift-1.25.0-linux-amd64.tgz
tar xvfz minishift-1.25.0-linux-amd64.tgz
mv minishift-1.25.0-linux-amd64/minishift ~/bin
minishift config set vm-driver virtualbox
minishift start
minishift oc-env
eval "$(minishift oc-env)"
oc new-app https://github.com/sclorg/nodejs-ex -l name=myapp
oc logs -f bc/nodejs-ex
oc expose svc/nodejs-ex
minishift openshift service nodejs-ex --in-browser
minishift stop
}
mkcert()
{
# mkcert : create a valid local CA & certs
sudo apt install libnss3-tools
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert
}
MultiBootUSB()
{
# MultiBootUSB