-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstallscript
executable file
·240 lines (213 loc) · 8.89 KB
/
installscript
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
#!/bin/bash
printf "${NORMAL}\n [ START ] Update & Upgrade"
starttime=$(date +%s)
trap '' 2
sudo apt -y update && sudo apt -y upgrade && sudo apt -y dist-upgrade
trap 2
endtime=$(date +%s)
printf " [ DONE ] Update & Upgrade ... %s seconds\n" "$((endtime - starttime))"
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installation der nötigen Requirements"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
starttime=$(date +%s)
apps=(
software-properties-common
build-essential
apt-transport-https
git
curl
unzip
libssl-dev
ca-certificates
ffmpeg
htop
)
trap '' 2
sudo apt -y install "${apps[@]}"
trap 2
unset apps
endtime=$(date +%s)
printf " [ DONE ] common requirements ... %s seconds\n" "$((endtime - starttime))"
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}PHP Installation"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
printf "\n Installieren? (j/n) "
read -p 'Antwort: ' reply
if [[ $reply =~ ^[Jj]$ ]]
then
printf "\n Ubuntu or Debian? (u/d) "
read -p 'Antwort: ' reply
if [[ $reply =~ ^[Uu]$ ]]
then
sudo add-apt-repository ppa:ondrej/php -y
fi
if [[ $reply =~ ^[Dd]$ ]]
then
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
fi
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere PHP 8"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
sudo apt update -y
sudo apt install php php-cli php-json php-common php-mysql php-zip php-gd php-imagick php-mbstring php-curl php-xml php-xmlrpc php-pear php-bcmath php-imap php-zip php-intl -y
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere PHP 7.4"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
sudo apt install php7.4 -y
sudo apt install php7.4-fpm php7.4-mysql php7.4-zip php7.4-gd php7.4-imagick php7.4-mbstring php7.4-curl php7.4-xml php7.4-xmlrpc php7.4-bcmath php7.4-imap php7.4-intl -y
sudo update-alternatives --config php
fi
# Install python
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere Phython 3 & PIP 3"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
sudo apt install python3 -y
sudo apt install python3-pip -y
python3 --version
pip3 --version
# Install Misc
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere diverse Libs"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
sudo apt-get install libatk1.0-0t64 libatk-bridge2.0-0t64 libc6 libcairo2 libcups2t64 libdbus-1-3 libexpat1 libfontconfig1 libgcc1-s1 libgdk-pixbuf2.0-0 libglib2.0-0t64 libgtk-3-0t64 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget fzf fontconfig -y
# Install zsh
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere oh-my-zsh"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
printf "\n Installieren? (j/n) "
read -p 'Antwort: ' zsh
if [[ $zsh =~ ^[Jj]$ ]]
then
sudo apt install zsh -y
sudo chsh -s /usr/bin/zsh
rm -rf ~/.oh-my-zsh
curl -L https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh | sh
#sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install powerlevel10k
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere Powerlevel 10K"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
# Install Powerline-Symbols
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere Powerline-Symbols"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
sudo apt-get install fontconfig -y
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir -p ~/.local/share/fonts/
mkdir -p ~/.config/fontconfig/conf.d/
mv PowerlineSymbols.otf ~/.local/share/fonts/
sudo fc-cache -vf ~/.local/share/fonts/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
# Install zsh-autosuggestions
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere zsh-autosuggestions"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Install zsh-syntax-highlighting
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere zsh-syntax-highlighting"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Symlink zsh prefs
rm ~/.zshrc
ln -s ~/.dotfiles/shell/.wsl2 ~/.zshrc
fi
# Symlink warp prefs
rm ~/.warprc
ln -s ~/.dotfiles/shell/.warprc ~/.warprc
#Copy WSL config
sudo cp ~/.dotfiles/shell/wsl.conf /etc/wsl.conf
# Install get Nerd Fonts
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere getNF"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
git clone https://github.com/ronniedroid/getnf.git
cd getnf
./install.sh
# Install Composer
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere Composer"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
composer -V
# Install Laravel Installer
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere Laravel Global Installer"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
composer global require laravel/installer
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere Node, NPM & NVM"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
nodejs -v
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}Installiere globale NPM Packages"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
sudo npm install -g ffmpeg-progressbar-cli
echo " ${GREEN}++++++++++++++++++++++++++++++"
echo " ${RED}SSH"
echo " ${GREEN}++++++++++++++++++++++++++++++${WHITE}"
printf "\n SSH-Key generieren (j/n): "
read -r personalconfig
if [ -z "${personalconfig}" ] || [ "${personalconfig}" == j ] || [ "${personalconfig}" == J ]; then
printf "\n Name (Default: Stephan Jess): "
read -r username
if [ -z "${username}" ]; then
username="Stephan Jess"
echo "$username"
fi
git config --global user.name "${username}"
printf "\n E-Mail (Default: [email protected]): "
read -r email
if [ -z "${email}" ]; then
email="[email protected]"
echo "$email"
fi
git config --global user.email "${email}"
if [ ! -d ~/.ssh ]; then
ssh-keygen -t rsa -b 4096 -C "${email}"
fi
fi
printf "\n SSH-Key generiert in Verzeichnis ~/.ssh\n"
printf "\n [ START ] Säubern"
starttime=$(date +%s)
trap '' 2
sudo apt -y autoremove && sudo apt -y autoclean && sudo apt -y clean
trap 2
endtime=$(date +%s)
printf " [ DONE ] Säubern ... %s Sekunden" "$((endtime - starttime))"
endtotaltime=$(date +%s)
printf "\n Komplette Ausführungszeit ... %s Sekunden" "$((endtotaltime - starttotaltime))\n"
echo "${GREEN}++++++++++++++++++++++++++++++"
echo '++++++++++++++++++++++++++++++'
echo 'Fertig! (ZSH) Jetzt nur noch Passwort eingeben und das Theme switched!'
echo 'Dies muss noch erledigt werden:'
echo "${RED}1. (ZSH) Installiere unter Windows den FiraCode patched font, zu finden im Verzeichnis ~/.dotfiles/misc"
echo "${RED}2. (BASH) run getnf from the terminal and it will represent you with a list of NerdFonts with fzf, select the ones you want, and let it do it's work.${GREEN}"
echo '++++++++++++++++++++++++++++++'
# Insert --> Read .{files} from .dotfiles
echo '
for file in ~/.dotfiles/shell/.{exports,aliases,functions}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file"
done
unset file
' >> ~/.bashrc
# Change Shell
if [[ $zsh =~ ^[Jj]$ ]]
then
chsh -s $(which zsh)
zsh
source ~/.zshrc
else
source ~/.bashrc
fi