forked from shudarshon/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·221 lines (151 loc) · 4.55 KB
/
bootstrap.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
#!/bin/bash
set -x
###install essential packages
install_essential(){
sudo apt-get update
sudo apt-get install git software-properties-common build-essential apt-transport-https \
wget curl zip unzip bzip2 rar unrar openssh-client \
htop facter ohai net-tools lsof htop tcpdump screen \
nmap wireshark nemesis nessus \
automake autoconf maven gradle ant -y
}
###install python and pip
install_python_pip() {
sudo apt-get install python-dev python-setuptools -y
curl -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
rm get-pip.py
}
###installing ansible
install_pip_packages() {
sudo pip install ansible --upgrade --user
sudo pip install --upgrade awscli --user
sudo pip install saws --user
sudo pip install fabric --upgrade --user
sudo pip install virtualenv --upgrade --user
aws --version
}
###install java
install_java() {
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt update -y
sudo apt install oracle-java8-installer -y
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre
java -version
}
###installing nodejs and yarn
install_node_yarn() {
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs -y
rm nodesource_setup.sh
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-get update
sudo apt-get install yarn -y
}
###installing docker and docker compose
install_docker() {
sudo apt-get update --fix-missing
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-cache policy docker-ce
sudo apt-get install -y docker-ce -y
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker ${USER}
sudo docker info
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
}
###installing packer
install_packer(){
sudo apt-get update --fix-missing
wget https://releases.hashicorp.com/packer/1.2.5/packer_1.2.5_linux_amd64.zip -O packer.zip
unzip packer.zip
sudo mv packer /usr/local/bin/
rm packer.zip
packer -v
}
###installing terraform
install_terraform(){
sudo apt-get update --fix-missing
wget https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip -O terraform.zip
unzip terraform.zip
sudo mv terraform /usr/local/bin/
rm terraform*
terraform -v
}
###installing kubectl-k8s administering tool
install_k8s() {
sudo apt-get update --fix-missing
curl -LO 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
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl -v
}
###installing kubectl-k8s administering tool
install_k8s() {
sudo apt-get update --fix-missing
curl -LO 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
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl -v
}
###installing saltstack
install_saltstack() {
sudo add-apt-repository ppa:saltstack/salt -y
sudo apt-get update
sudo apt-get install salt-master salt-minion salt-ssh salt-cloud salt-doc -y
}
###install and customize vim
install_vim() {
sudo apt-get update
sudo apt-get install vim -y
git clone --recursive https://github.com/jessfraz/.vim.git .vim
ln -sf $HOME/.vim/vimrc $HOME/.vimrc
cd $HOME/.vim
git submodule update --init
}
###customize bashrc
install_bashrc(){
sudo apt-get install node-rimraf lsscsi lm-sensors fortune-mod -y
git clone https://github.com/shudarshon/bashrc.git
cp bashrc/.bashrc $HOME/.bashrc
cp -r bashrc/.shells $HOME/
rm -rf bashrc
}
### install tilix
install_tilix(){
sudo add-apt-repository ppa:webupd8team/terminix -y
sudo apt-get update
sudo apt-get install tilix -y
}
###install chromium browser
install_chrome() {
sudo apt-get install chromium-browser -y
}
###install atom
install_atom() {
sudo add-apt-repository ppa:webupd8team/atom -y
sudo apt-get update
sudo apt-get install atom -y
}
###installing progam
install_essential
install_python_pip
install_pip_packages
install_java
install_node_yarn
install_docker
install_packer
install_terraform
install_k8s
install_saltstack
install_vim
install_bashrc
install_tilix
install_chrome
install_atom