-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
216 lines (135 loc) · 3.99 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
#!/bin/bash
if [ "$#" == 0 ]
then
echo "must provide the user's home"
exit
fi
# we need the user's home directory in order to easily install and configure zsh
users_home=$1
# we need to add the user to `docker` group
user=${users_home##*/}
# note: the order matters
function format_output {
echo -e "\e[1;42m $1 \e[m";
}
function installVim {
format_output "installing vim"
sudo apt install -y vim
sudo chmod 666 /etc/vim/vimrc
sudo echo "set tabstop=2" >> /etc/vim/vimrc
echo
}
function installGit {
format_output "installing git"
sudo apt install -y git
git config --global user.name "Andrei Gatej"
git config --global user.email "[email protected]"
echo
}
function installZsh {
format_output "installing zsh"
sudo apt install -y zsh
sudo apt-get install -y powerline fonts-powerline
git clone https://github.com/robbyrussell/oh-my-zsh.git "$users_home"/.oh-my-zsh
cp "$users_home"/.oh-my-zsh/templates/zshrc.zsh-template "$users_home"/.zshrc
sudo chsh -s /bin/zsh
# syntax highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$users_home/.zsh-syntax-highlighting" --depth 1
echo "source $users_home/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$users_home/.zshrc"
echo
}
function installChrome {
format_output "installing chrome"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm -rf ./google-chrome-stable_current_amd64.deb
echo
}
# !
function installVsCodeInsiders {
format_output "installing VS Code Insiders"
sudo snap install code-insiders --classic
echo
}
function installGolang {
format_output "installing golang"
cd /tmp
# ! might need to manually update this
wget https://dl.google.com/go/go1.15.1.linux-amd64.tar.gz
sudo tar -xvf go1.15.1.linux-amd64.tar.gz
sudo mv go /usr/local
cat >> "$users_home/.zshrc" <<EOL
export GOROOT=/usr/local/go
export GOPATH=$users_home/go
EOL
echo "export PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> "$users_home/.zshrc"
echo
}
function installCurl {
format_output "installing curl"
sudo apt install -y curl
echo
}
function installDocker {
format_output "installing docker"
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
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-ce-cli containerd.io
usermod -aG docker $user
echo
}
function installNode {
format_output "installing nodejs"
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -sL 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-get update && sudo apt-get install -y yarn
echo
}
function installSlack {
format_output "installing slack"
wget https://downloads.slack-edge.com/linux_releases/slack-desktop-4.0.2-amd64.deb
sudo apt install -y ./slack-desktop-*.deb
rm -rf ./slack-desktop-*.deb
echo
}
function installPostman {
format_output "installing postman"
sudo snap install postman
echo
}
function installBrave {
format_output "installing brave browser"
sudo snap install brave
echo
}
function installGimp {
format_output "installing gimp"
sudo snap install gimp
echo
}
function installTweaks {
format_output "installing tweaks"
sudo apt install -y gnome-tweak-tool
echo
}
function installDiscord {
format_output "installing Discord"
sudo snap install discord
echo
}
functions="$(cat $0 | egrep -o install[A-Z]+[A-Za-z]+)"
for f in $functions; do $f;done