-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·212 lines (161 loc) · 7.84 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
#!/bin/bash
echo "# -------------------------------- #"
echo "# Apollo Ruby VM Install #"
echo "# -------------------------------- #"
mkdir /home/vagrant/downloads
sudo su -c "echo \"vagrant ALL=(ALL) NOPASSWD:ALL\" > /etc/sudoers.d/vagrant"
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get -y install wget ca-certificates gcc g++ gnupg2 make software-properties-common \
git-core curl build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev libcurl4-openssl-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libffi-dev libpq-dev tcl8.5 libexpat1-dev gettext unzip \
libmagick++-dev libv8-dev libffi-dev libpulse0 imagemagick
echo "# -------------------------------- #"
echo "# Setting SSH Keys #"
echo "# -------------------------------- #"
mkdir -p /home/vagrant/.ssh
chmod 0700 /home/vagrant/.ssh
mv ./ssh/vagrant.pub /home/vagrant/.ssh/authorized_keys
chmod 0600 /home/vagrant/.ssh/authorized_keys
sudo chown -R vagrant:root /home/vagrant/.ssh
sudo apt-get install -y openssh-server
echo 'AuthorizedKeysFile %h/.ssh/authorized_keys' | sudo tee --append /etc/ssh/sshd_config > /dev/null
sudo service ssh restart
echo "# -------------------------------- #"
echo "# Installing Guest Additions #"
echo "# -------------------------------- #"
sudo mkdir /cdrom
sudo mount /dev/cdrom /cdrom
cd /cdrom
sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)
sudo su -c "./VBoxLinuxAdditions.run"
echo "# -------------------------------- #"
echo "# Installing Ruby #"
echo "# -------------------------------- #"
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
cd /home/vagrant/downloads && wget http://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.1.tar.gz -O ruby.tar.gz
cd /home/vagrant/downloads && tar xzf ruby.tar.gz
cd /home/vagrant/downloads/ruby-2.6.1 && ./configure -prefix=$HOME
cd /home/vagrant/downloads/ruby-2.6.1 && make
cd /home/vagrant/downloads/ruby-2.6.1 && make install
# gem install bundler
echo "# -------------------------------- #"
echo "# Installing Redis #"
echo "# -------------------------------- #"
cd /home/vagrant/downloads && wget http://download.redis.io/releases/redis-stable.tar.gz -O redis.tar.gz
cd /home/vagrant/downloads && tar xzf redis.tar.gz
cd /home/vagrant/downloads/redis-stable && make
cd /home/vagrant/downloads/redis-stable && sudo make install
cd /home/vagrant/downloads/redis-stable/utils && sudo ./install_server.sh
echo "# -------------------------------- #"
echo "# Installing PostgreSQL #"
echo "# -------------------------------- #"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get -y install postgresql postgresql-contrib
echo "# -------------------------------- #"
echo "# Setting up DB User #"
echo "# -------------------------------- #"
sudo -u postgres psql -c "CREATE USER vagrant WITH PASSWORD 'vagrant';"
sudo -u postgres createdb -O vagrant vagrant
echo "# -------------------------------- #"
echo "# Installing Java 8 #"
echo "# -------------------------------- #"
sudo apt install -y default-jre default-jre-headless
#echo "# -------------------------------- #"
#echo "# Installing Neo4j #"
#echo "# -------------------------------- #"
# wget --no-check-certificate -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
# echo 'deb http://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list
# sudo apt update
# sudo apt install -y neo4j
# sudo service neo4j stop
# sudo service neo4j start
echo "# -------------------------------- #"
echo "# Installing Nodejs #"
echo "# -------------------------------- #"
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt install -y npm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
sudo npm install --global webpack
sudo apt-get install gcc g++ make
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 yarn
echo "# -------------------------------- #"
echo "# Installing Crystal #"
echo "# -------------------------------- #"
curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash
sudo apt install -y crystal
echo "# -------------------------------- #"
echo "# Installing PHP #"
echo "# -------------------------------- #"
sudo apt install -y curl php-cli php-mbstring git unzip
sudo apt install -y php
sudo apt install -y php-mysql php-gd
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
echo "# -------------------------------- #"
echo "# Installing Lua #"
echo "# -------------------------------- #"
sudo apt-get install -y lua5.3
#echo "# -------------------------------- #"
#echo "# Installing Cassandra #"
#echo "# -------------------------------- #"
#echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
#curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
#sudo apt-get update
#sudo apt-get install -y cassandra
echo "# -------------------------------- #"
echo "# Installing PIP #"
echo "# -------------------------------- #"
sudo apt install -y python3-pip
#echo "# -------------------------------- #"
#echo "# Installing Tensorflow #"
#echo "# -------------------------------- #"
#pip3 install tensorflow
#pip3 install keras
#echo "# -------------------------------- #"
#echo "# Installing Tesseract #"
#echo "# -------------------------------- #"
#sudo apt install -y tesseract-ocr
#sudo apt install -y libtesseract-dev
echo "# -------------------------------- #"
echo "# Installing FFmpeg #"
echo "# -------------------------------- #"
sudo apt install -y ffmpeg
echo "# -------------------------------- #"
echo "# Installing Typescript #"
echo "# -------------------------------- #"
sudo npm install -g typescript
echo "# -------------------------------- #"
echo "# Setting ENV Vars #"
echo "# -------------------------------- #"
echo 'RAILS_ENV="development"' | sudo tee --append /etc/environment > /dev/null
echo 'DATABASE_URL="postgresql://vagrant:[email protected]:5432/vagrant"' | sudo tee --append /etc/environment > /dev/null
echo 'REDIS_URL="redis://localhost:6379"' | sudo tee --append /etc/environment > /dev/null
echo "# -------------------------------- #"
echo "# Setting Up Utils #"
echo "# -------------------------------- #"
cp /home/vagrant/dev-vm/utils/ngrok /usr/bin
cp /home/vagrant/dev-vm/utils/pgweb /usr/bin
#sudo npm install -g is-up-cli
#sudo npm install -g loadtest
sudo apt-get install -y htop
sudo apt-get install -y httpie
#echo "# -------------------------------- #"
#echo "# Installing Docker #"
#echo "# -------------------------------- #"
#curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
#sudo apt-key fingerprint 0EBFCD88
#sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
#sudo apt-get update
#sudo apt-get install docker-ce docker-ce-cli containerd.io
#sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#sudo chmod +x /usr/local/bin/docker-compose
echo "# -------------------------------- #"
echo "# Done, Rebooting #"
echo "# -------------------------------- #"
sudo reboot