-
Notifications
You must be signed in to change notification settings - Fork 0
/
software-install.sh
executable file
·354 lines (252 loc) · 16.1 KB
/
software-install.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
#!/bin/bash
##############################################################################
# Copyright (C) 2024 Antonio Manuel Hernández De León
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
##############################################################################
#Usage:
# ./software-install.sh |& tee software-install.log
# ./software-install.sh > >(tee software-install-stdout.log) 2> >(tee software-install-stderr.log >&2)
username=$(whoami)
no_confirmation="--noconfirm"
working_directory=$(pwd)
git_user_name=""
git_user_email=""
if [[ $git_user_name == "" || $git_user_email == "" ]]; then
echo "Initialize the required data first"
exit
fi
sudo pacman -Syy
#Password timeout
echo -e "\n------------------------------Password timeout------------------------------"
sudo echo -e "Defaults timestamp_timeout=300" | sudo tee -a /etc/sudoers > /dev/null
#AUR helper
echo -e "------------------------------AUR helper------------------------------"
cd /home/$username/Downloads
git clone https://aur.archlinux.org/paru-bin.git && cd paru-bin && makepkg -si $no_confirmation #Install paru helper
cd
#BlackArch Linux
echo -e "\n------------------------------BlackArch Linux------------------------------"
cd /home/$username/Downloads
curl -O https://blackarch.org/strap.sh && chmod +x strap.sh && sudo ./strap.sh #Install BlackArch
sudo rm -r paru-bin && rm strap.sh
cd
#Multilib repository
echo -e "\n------------------------------Multilib repository------------------------------"
mline=$(grep -n "\\[multilib\\]" /etc/pacman.conf | cut -d: -f1) #Enable Multilib repository
rline=$(($mline + 1))
sudo sed -i ''$mline's|#\[multilib\]|\[multilib\]|g' /etc/pacman.conf
sudo sed -i ''$rline's|#Include = /etc/pacman.d/mirrorlist|Include = /etc/pacman.d/mirrorlist|g' /etc/pacman.conf
sudo pacman -Syy
#Upgrade
echo -e "\n------------------------------Upgrade------------------------------"
sudo pacman -Syu $no_confirmation #Upgrade the system
#First group of programs
echo -e "\n------------------------------First group of programs------------------------------"
sudo pacman -S neofetch firefox man-db man-pages wget bandwhich git-delta tmux byobu tcpdump wireshark-qt python-pipx gimp hashcat john kcalc ark kclock kmousetool kmag ktimetracker okteta kbackup kdenlive spectacle kdeconnect audacity plasma-systemmonitor filelight partitionmanager kfind ksystemlog kcolorchooser khelpcenter kompare sweeper kamoso kleopatra kcachegrind elisa kalzium kmix kgeography ksudoku knavalbattle kget skanpage kmines ktouch kigo marble kontact kapman kdiamond kweather cantor kalgebra umbrello cervisia klines kmplot step kfourinline krecorder itinerary zanshin telly-skout krename kid3 kstars kmymoney arianna kommit metasploit nmap arp-scan torbrowser-launcher traceroute kompare isoimagewriter elisa kclock marknote kmymoney skrooge crunch cewl bettercap mentalist cvemap iaxflood beef set wordlistctl trash-cli aircrack-ng ripgrep-all ncdu obs-studio autorandr imagemagick ktorrent zip unzip ecryptfs-utils conky conky-manager xdotool timeshift keepass locate mdcat xclip neovim lsd bat bind nodejs npm kmail korganizer kaddressbook akregator plasma-wayland-protocols callaudiod gwenview libreoffice-still poppler cronie gnome-2048 flatpak virt-what feh fzf hexedit lf pv jq nerd-fonts reflector iwd openvpn mosh libpam-google-authenticator dialog pv pacman-contrib copyq kruler bpytop kwalletmanager ufw lshw inxi hwinfo apache tmate pkgfile dos2unix expect whois zmap masscan sqlmap dnsenum steghide arpwatch macchanger theharvester mimikatz fcrackzip maltego dirbuster dirsearch gobuster cve-search cvechecker cvemap eternal-scanner gitleaks dnsrecon exrex $no_confirmation
#phonon-qt5-vlc
#tesseract 5.3.4-2
#tesseract-data-afr 2:4.1.0-4
#tesseract-data-osd 2:4.1.0-4
#Foxit Reader download with megatools
echo -e "\n------------------------------Foxit Reader download with megatools------------------------------"
sudo pacman -S megatools $no_confirmation
cd /home/$username/Downloads
megadl "https://mega.nz/file/NwAkVJYD#4BdcIhZhxU9jYrDWw7MRTPpwqXG3hF2-oOwrUyfre_0"
sudo pacman -Rs megatools $no_confirmation
cd
#Second group of programs
echo -e "\n------------------------------Second group of programs------------------------------"
paru -S visual-studio-code-bin google-chrome teamviewer cyberchef-web hibernator-git 4kvideodownloader megasync-bin keurocalc subtitlecomposer-git codevis pamac-aur plasma-dialer-git vmware-workstation markdown2pdf-git zsh-syntax-highlighting zsh-autosuggestions scrub ntfysh-bin snapd insync python-nvidia-ml-py zsh-theme-powerlevel10k-git hollywood wkhtmltopdf-static icu74 bashdb citra-appimage rar enum4linux ffuf feroxbuster wordlists $no_confirmation #activitywatch-bin? python-pynvml
sudo updatedb #For locate command to work
#Terminal: ZSH, Wezterm and Powerlevel10K
echo -e "\n------------------------------Terminal: ZSH, Wezterm and Powerlevel10K------------------------------"
cd $working_directory
sudo usermod --shell /usr/bin/zsh $username
sudo localectl set-x11-keymap es
cp -f Terminal/zshrc /home/$username/.zshrc
cp -f Terminal/wezterm.lua /home/$username/.wezterm.lua
cp -f Terminal/p10k.zsh /home/$username/.p10k.zsh
cd /usr/share/zsh/plugins
sudo mkdir zsh-sudo
sudo mkdir zsh-interactive-cd
cd /home/$username/Downloads
wget https://raw.githubusercontent.com/mrjohannchang/zsh-interactive-cd/master/zsh-interactive-cd.plugin.zsh
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/sudo/sudo.plugin.zsh
sudo cp sudo.plugin.zsh /usr/share/zsh/plugins/zsh-sudo/sudo.plugin.zsh
sudo cp zsh-interactive-cd.plugin.zsh /usr/share/zsh/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
rm sudo.plugin.zsh zsh-interactive-cd.plugin.zsh
cd
sudo usermod --shell /usr/bin/zsh root
sudo ln -s -f /home/$username/.zshrc /root/.zshrc #To make the root zsh config be the same as tony450
sudo cp -f /home/$username/.p10k.zsh /root
#Hibernation
echo -e "\n------------------------------Hibernation------------------------------"
# sudo hibernator
sudo sed -i -e 's/modconf kms keyboard/modconf resume kms keyboard/g' /etc/mkinitcpio.conf
uuid=$( cat /etc/fstab | grep swap | cut -f 1); beginning="s/quiet/quiet splash resume=";end="/g"; sudo sed -i -e "${beginning}${uuid}${end}" /etc/default/grub
sudo mkinitcpio -p linux
sudo grub-mkconfig -o /boot/grub/grub.cfg
#Digital certificates
echo -e "\n------------------------------Digital certificates------------------------------"
sudo pacman -S pcsclite pcsc-tools opensc nss icedtea-web $no_confirmation
paru -S libpkcs11-dnie configuradorfnmt autofirma ca-certificates-dnie $no_confirmation
/opt/google/chrome/chrome &
sleep 3
kill -9 $!
cd /home/$username/.pki/nssdb
sudo chown $username:$username pkcs11.txt
modutil -dbdir sql:/home/$username/.pki/nssdb -add "DNI-e" -libfile /usr/lib/opensc-pkcs11.so
cd
sudo updatedb #For locate command to work
# locate opensc | grep "/opensc-pkcs11.so" | xargs ls -lth #Run this command to be able to add the security device on Mozilla Firefox
#Autostart scripts
echo -e "\n------------------------------Autostart scripts------------------------------"
cd $working_directory
cp -r Autostart /home/$username
mv /home/$username/Autostart/lean-conky-config/local2.conf /home/$username/Autostart/lean-conky-config/local.conf
mv /home/$username/Autostart/lean-conky-config/scripts/distrokernel.sh /home/$username/Autostart/lean-conky-config/scripts/distrokernel.sh
mv /home/$username/Autostart/lean-conky-config/scripts/network_interfaces.sh /home/$username/Autostart/lean-conky-config/scripts/network_interfaces.sh
sudo chmod +x /home/$username/Autostart/lean-conky-config/scripts/distrokernel.sh /home/$username/Autostart/lean-conky-config/scripts/network_interfaces.sh
cd
#Wallpapers and icons
echo -e "\n------------------------------Wallpapers and icons------------------------------"
cd $working_directory && cd Icons
cp -r Application\ Launcher /home/$username/Pictures
cd ..
sudo cp -r -f Wallpapers/Login\ Screen/Breeze/* /usr/share/sddm/themes/breeze
mkdir -p /home/$username/Pictures/Wallpapers/Wallpaper\ 0/
sudo cp -r -f Wallpapers/Desktop/Wallpaper\ 0/* /home/$username/Pictures/Wallpapers/Wallpaper\ 0/
cd
#Foxit Reader
echo -e "\n------------------------------Foxit Reader------------------------------"
cd /home/$username/Downloads
sudo chmod +x FoxitReader.enu.setup.2.4.5.0727\(rb70e8df\).x64.run
sudo ./FoxitReader.enu.setup.2.4.5.0727\(rb70e8df\).x64.run
rm FoxitReader.enu.setup.2.4.5.0727\(rb70e8df\).x64.run
cd
#Scripts
echo -e "\n------------------------------Scripts------------------------------"
cd $working_directory
sudo chmod +x Scripts/organize_submissions.sh Scripts/unzip_submissions.sh Scripts/clean_assignment_name.sh
sudo mkdir /opt/scripts
sudo cp Scripts/clean_assignment_name.sh /opt/scripts/clean_assignment_name.sh
sudo cp Scripts/organize_submissions.sh /opt/scripts/organize_submissions.sh
sudo cp Scripts/unzip_submissions.sh /opt/scripts/unzip_submissions.sh
cd
#Enable services
echo -e "\n------------------------------Enable services------------------------------"
sudo systemctl enable wpa_supplicant.service && sudo systemctl start wpa_supplicant.service
sudo systemctl enable teamviewerd.service && sudo systemctl start teamviewerd.service
sudo systemctl enable cronie && sudo systemctl start cronie
sudo systemctl enable pcscd.service && sudo systemctl start pcscd.service
sudo systemctl enable vmware-networks.service && sudo systemctl start vmware-networks.service
sudo systemctl enable vmware-usbarbitrator.service && sudo systemctl start vmware-usbarbitrator.service
sudo systemctl enable iwd.service && sudo systemctl start iwd.service
#Flathub: ZapZap, Telegram and Paper Clip
echo -e "\n------------------------------Flathub: ZapZap, Telegram and Paper Clip------------------------------"
flatpak install flathub com.rtosta.zapzap --assumeyes
flatpak install flathub org.telegram.desktop --assumeyes
flatpak install flathub io.github.diegoivan.pdf_metadata_editor --assumeyes
#Modern CSV
echo -e "\n------------------------------Modern CSV------------------------------"
cd /home/$username/Downloads
curl -O https://www.moderncsv.com/release/ModernCSV-Linux-v2.0.8.tar.gz
tar -xvzf ModernCSV-Linux-v2.0.8.tar.gz
cd moderncsv2.0.8 && chmod +x install.sh && sudo ./install.sh
cd .. && sudo rm -r moderncsv2.0.8
sudo rm ModernCSV-Linux-v2.0.8.tar.gz
cd
#Wireshark configuration
echo -e "\n------------------------------Wireshark configuration------------------------------"
sudo gpasswd -a $username wireshark
#Git configuration
echo -e "\n------------------------------Git configuration------------------------------"
git config --global core.editor "vim"
git config --global user.name $git_user_name
git config --global user.email $git_user_email
#Wine
echo -e "\n------------------------------Wine------------------------------"
sudo pacman -S wine wine-mono wine-gecko winetricks $no_confirmation
wine --version
sudo pacman -S --asdeps --needed $(pacman -Si wine | sed -n '/^Opt/,/^Conf/p' | sed '$d' | sed 's/^Opt.*://g' | sed 's/^\s*//g' | tr '\n' ' ') $no_confirmation
sudo pacman -S --needed samba gnutls lib32-gnutls $no_confirmation
# wine wincfg
#Systemback
echo -e "\n------------------------------Systemback------------------------------"
sudo echo -e "[yuunix_aur]\nSigLevel = Optional TrustedOnly\nServer = https://shadichy.github.io/\$repo/\$arch" | sudo tee -a /etc/pacman.conf > /dev/null
sudo pacman -Syy
sudo pacman -S systemback $no_confirmation
headn=$( head -n -3 /etc/pacman.conf ); sudo echo "$headn" | sudo tee /etc/pacman.conf > /dev/null
sudo pacman -Syy
#Charging threshold for laptops
echo -e "\n------------------------------Charging threshold for laptops------------------------------"
chassis_type=$(sudo dmidecode --string chassis-type);
if [[ $chassis_type == "Laptop" || $chassis_type == "Notebook" || $chassis_type == "Sub Notebook" ]]; then
sudo echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold > /dev/null
sudo echo -e "# Battery Charge Threshold\n@reboot root echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold" | sudo tee -a /etc/crontab
fi
#Virtual Machine
echo -e "\n------------------------------Virtual Machine------------------------------"
if [[ $(sudo virt-what) ]]; then
sudo pacman -S gtkmm open-vm-tools xf86-video-vmware xf86-input-vmmouse $no_confirmation
sudo systemctl enable vmtoolsd && sudo systemctl start vmtoolsd
sudo systemctl enable vmware-vmblock-fuse && sudo systemctl start vmware-vmblock-fuse
sudo mkdir /mnt/hgfs & sudo echo -e "\n# Shared folders\n vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0" >> /etc/fstab & sudo mount -a
fi
#Latex
echo -e "\n------------------------------Latex------------------------------"
paru -S miktex $no_confirmation
sudo pacman -S libxcrypt-compat $no_confirmation
sudo /opt/miktex/bin/miktex-console --admin --finish-setup #The window must be closed
#Zsh-theme-powerlevel10k-git installation retry if "Early EOF. Invalid index-pack output" issue happens
echo -e "\n------------------------------Zsh-theme-powerlevel10k-git installation retry if "Early EOF. Invalid index-pack output" issue happens------------------------------"
powerlevel10k_installation=$(pacman -Q | grep zsh-theme-powerlevel10k)
if [[ ! ${powerlevel10k_installation} ]]; then
paru -S zsh-theme-powerlevel10k-git $no_confirmation
fi
#Informant
echo -e "\n------------------------------Informant------------------------------"
paru -S informant $no_confirmation
#Nvchad
echo -e "\n------------------------------Nvchad------------------------------"
cd /home/$username/Downloads
git clone https://github.com/NvChad/starter /home/$username/.config/nvim && nvim #Type :q! and hit Enter (it seems that it doesn't work, but it does)
sudo git clone https://github.com/NvChad/starter /root/.config/nvim && sudo nvim #Type :q! and hit Enter (it seems that it doesn't work, but it does)
cd
sudo updatedb #For locate command to work
#Mp3DownTagger
echo -e "\n------------------------------Mp3DownTagger------------------------------"
cd /home/$username/Downloads
git clone https://github.com/Tony450/Mp3DownTagger
cd Mp3DownTagger/Installer/GNU\ Linux
chmod +x install.sh
./install.sh
cd .. && sudo rm -r Mp3DownTagger
cd
#UFW
echo -e "\n------------------------------UFW------------------------------"
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
sudo systemctl enable ufw && sudo systemctl start ufw
#Pkgfile
echo -e "\n------------------------------Pkgfile------------------------------"
sudo pkgfile --update
#CVEchecker
echo -e "\n------------------------------CVEchecker------------------------------"
sudo echo -e "[Users]\nHideUsers=cvechecker" | sudo tee /etc/sddm.conf > /dev/null
#Password timeout
echo -e "\n------------------------------Password timeout------------------------------"
headn=$( sudo head -n -1 /etc/sudoers ); sudo echo "$headn" | sudo tee /etc/sudoers > /dev/null