-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathubuntu-setup.sh
39 lines (35 loc) · 1.12 KB
/
ubuntu-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
cd $HOME
sudo apt-get update -y
sudo apt-get install git -y
sudo apt-get install build-essential -y
sudo apt-get install -y redis-server
if [ -d "$HOME/node" ]; then
rm -rf $HOME/node
fi
cd $HOME
wget https://nodejs.org/dist/v6.5.0/node-v6.5.0-linux-x64.tar.gz -O node.tar.gz
tar -xzvf node.tar.gz
echo "now moving path"
mv node-v6.5.0-linux-x64 node
rm node.tar.gz
echo "PATH=\"\$HOME/node/bin:\$PATH\"" | tee -a .profile
cd $HOME
sudo rm /usr/bin/{node,npm}
sudo ln -s $HOME/node/bin/node /usr/bin/node
sudo ln -s $HOME/node/bin/npm /usr/bin/npm
#################################################
# postgres
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib -y
sudo -i -u postgres createdb dev
# sudo su postgres
# psql
# CREATE USER dev WITH SUPERUSER PASSWORD 'dev';
# \q
# exit
sudo service postgresql restart
#################################################
# redis
sudo service redis-server restart