-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
217 lines (192 loc) · 7.07 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
#!/bin/bash
# ------------------
# Go to home
# ------------------
cd ~
# ------------------
# APPS
# ------------------
sudo apt update
sudo apt upgrade -y
sudo apt install build-essential -y
sudo apt autoremove -y
sudo apt install git -y
sudo apt install curl -y
sudo apt install xclip -y
sudo apt install flameshot -y
sudo apt install openjdk-8-jre -y
sudo apt-get install openjdk-8-jdk -y
sudo snap install code --classic
sudo snap install discord
sudo snap install postman
sudo snap install dbeaver-ce
sudo snap install spotify
sudo snap install android-studio --classic
# ------------------
# Android permissions
# ------------------
sudo adduser $USER kvm
# ------------------
# Homebrew (for Watchman)
# ------------------
if ! [ -x "$(command -v brew)" ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
# ------------------
# Watchman (React Native live server dependency)
# ------------------
if ! [ -x "$(command -v watchman)" ]; then
brew update
brew install watchman
echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
watchman shutdown-server
fi
# ------------------
# FortiClient (for vpns)
# ------------------
if ! [ -x "$(command -v openfortigui)" ]; then
wget https://apt.iteas.at/iteas/pool/main/o/openfortigui/openfortigui_0.9.0-3_amd64_focal.deb
sudo dpkg -i openfortigui_0.9.0-3_amd64_focal.deb
sudo apt-get -f install -y
rm openfortigui_0.9.0-3_amd64_focal.deb*
fi
# ------------------
# Chrome
# ------------------
if ! [ -x "$(command -v google-chrome)" ]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb*
fi
# ------------------
# docker
# ------------------
if ! [ -x "$(command -v docker)" ]; then
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker $USER
exec su -l $USER
fi
# ------------------
# docker-compose
# ------------------
if ! [ -x "$(command -v docker-compose)" ]; then
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi
# ------------------
# Postgres (from docker)
# ------------------
if ! docker ps -a | grep 'database'; then
docker run --name database -e POSTGRES_PASSWORD=root -p 5432:5432 -d postgres
fi
# ------------------
# SSH
# ------------------
ssh-keygen -q -t rsa -N '' <<< ""$'\n'"n" 2>&1 >/dev/null
xclip -sel clip < ~/.ssh/id_rsa.pub
# ------------------
# NVM (Node Version Manager)
# ------------------
if ! [ -x "$(command -v node)" ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
. $NVM_DIR/nvm.sh
nvm install --lts
nvm alias default node
source ~/.bashrc
fi
# ------------------
# Yarn
# ------------------
if ! [ -x "$(command -v yarn)" ]; then
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install --no-install-recommends yarn
fi
# ------------------
# Peek (GIF Creator)
# ------------------
if ! [ -x "$(command -v peek)" ]; then
sudo add-apt-repository ppa:peek-developers/stable -y
sudo apt update
sudo apt install peek -y
fi
# ------------------
# Terminal ZSH
# ------------------
if ! [ -x "$(command -v zsh)" ]; then
sudo apt-get install zsh -y
yes Y | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/denysdovhan/spaceship-prompt.git ~/.oh-my-zsh/custom/themes/spaceship-prompt --depth=1
ln -s ~/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme ~/.oh-my-zsh/custom/themes/spaceship.zsh-theme
# Change default terminal emulator to ZSH
sudo chsh -s /bin/zsh
echo "
# Defaults
export PATH=\$HOME/bin:/usr/local/bin:\$(yarn global bin):\$PATH
export ZSH=/home/\$(whoami)/.oh-my-zsh
export DEFAULT_USER=\"\$(whoami)\"
export EDITOR=\"code --reuse-window\"
export TERM=\"xterm-256color\"
export NVM_DIR=\"\$HOME/.nvm\"
[ -s \"\$NVM_DIR/nvm.sh\" ] && \. \"\$NVM_DIR/nvm.sh\" # This loads nvm
[ -s \"\$NVM_DIR/bash_completion\" ] && \. \"\$NVM_DIR/bash_completion\" # This loads nvm bash_completion
# Android
export ANDROID_HOME=\$HOME/Android/Sdk
export PATH=\$PATH:\$ANDROID_HOME/emulator
export PATH=\$PATH:\$ANDROID_HOME/tools
export PATH=\$PATH:\$ANDROID_HOME/tools/bin
export PATH=\$PATH:\$ANDROID_HOME/platform-tools
# Fast edit config files aliases
alias ez=\"\$EDITOR ~/.zshrc\"
alias eb=\"\$EDITOR ~/.bashrc\"
alias eg=\"\$EDITOR ~/.gitconfig\"
# Spaceship
SPACESHIP_PROMPT_ADD_NEWLINE=\"false\"
# ZSH theme & plugins
ZSH_THEME=\"spaceship\"
plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)
source \$ZSH/oh-my-zsh.sh
eval \$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
" > $HOME/.zshrc
echo ""
echo "
@@@@@@@@@@@@(////////////////////////////////////@@@@@@@@@@@
@@@@@@(((((((((((((////////////////////////////////////@@@@@
@@@((((((((((((((((((////////////////////////////////////#@@
@@(((((((((((((((((((, /////////// ////////////////////@
@((((((((((((((((((( /((///////////. ///////////////////
((((((((((((((((((/ (((((////%%%///// //////////////////
((((((((((((((((( ,(((((((((@@@@////// .////////////////
(((((((((((((((( (((((((((((@@@(//////// ///////////////
((((((((((((((. (((((((((((@@@#((((////// */////////////
(((((((((((((( /((((((((((#@@@(((((((////* /////////////
((((((((((((((( (((((((((@@@((((((((((/ ///////////////
((((((((((((((((( (((((((@@@@(((((((((/ ////////////////
(((((((((((((((((( ,(((((@@@((((((((( .((((/////////////
(((((((((((((((((((/ ((((((((((((((( (((((((((//////////
((((((((((((((((((((( /(((((((((((. ((((((((((((////////
((((((((((((((((((((((((((((((((((((((((((((((((((((((//////
(((((((((((((((((((((((@@@@@@@@@@@@@@@((((((((((((((/(((/(//
(((((((((((((((((((((((@@@@@@@@@@@@@@@((((((((((((((((((((//
(((((((((((((((((((((((@@@@@@@@@@@@@@@((((((((((((((((((((((
(((((((((((((((((((((((@@@@@@@@@@@@@@@((((((((((((((((((((((
@(((((((((((((((((((((((((%@@@@@@@((((((((((((((((((((((((((
@@(((((((((((((((((((((((((((((((((((((((((((((((((((((((((@
@@@#(((((((((((((((((((((((((((((((((((((((((((((((((((((@@@
@@@@@@(((((((((((((((((((((((((((((((((((((((((((((((((@@@@@
"
echo "Your ssh key has been copied to clipboard!"
echo "Paste it into your git accounts:"
echo "Github: https://github.com/settings/ssh/new"
echo "Gitlab: https://gitlab.com/profile/keys"
echo "Bitbucket: https://bitbucket.org/account/settings/ssh-keys/"
echo ""
echo "Enter your local machine user password to finish this setup correctly"
exec su -l $USER