Skip to content

Instantly share code, notes, and snippets.

@Sethathi
Last active December 16, 2016 23:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sethathi/be14a8132924b31da2e5 to your computer and use it in GitHub Desktop.
Save Sethathi/be14a8132924b31da2e5 to your computer and use it in GitHub Desktop.
Vagrant shell provision script
#!/bin/bash
echo "Provisioning virtual machine..."
echo "####### Installing Git"
apt-get install git -y > /dev/null
echo "####### Installing Nginx"
apt-get install nginx -y > /dev/null
echo "####### Updating PHP repository"
apt-get install python-software-properties build-essential -y > /dev/null
add-apt-repository ppa:ondrej/php5 -y > /dev/null
apt-get update > /dev/null
echo "Installing PHP"
apt-get install php5-common php5-dev php5-cli php5-fpm -y > /dev/null
echo "Installing PHP extensions"
apt-get install curl php5-curl php5-gd php5-mcrypt php5-mysql -y > /dev/null
apt-get install debconf-utils -y > /dev/null
echo "###### Installing MySQL"
debconf-set-selections <<< "mysql-server mysql-server/root_password password 58498542"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password 58498542"
apt-get install mysql-server -y > /dev/null
echo "Configuring Nginx"
wget https://gist.githubusercontent.com/Sethathi/b52cf9750d9faa39702e/raw/96098ebc8565e7ff27295c6b3d8382226e3640f9/nginx_vhost
mv nginx_vhost /etc/nginx/sites-available/ > /dev/null
ln -s /etc/nginx/sites-available/nginx_vhost /etc/nginx/sites-enabled/
rm -rf /etc/nginx/sites-available/default
touch /var/logs/default.access.log /var/logs/default.error.log
service nginx restart > /dev/null
echo "Installing Mongo"
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
apt-get update > /dev/null
apt-get install -y mongodb-org > /dev/null
echo "Installing Python Essentials"
apt-get install python-setuptools > /dev/null
apt-get install python-pip python-dev build-essential > /dev/null
pip install --upgrade pip > /dev/null
pip install --upgrade virtualenv > /dev/null
echo "Installing ZSH"
apt-get install zsh > /dev/null
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
rm .zshrc
wget https://gist.githubusercontent.com/Sethathi/1f6e87208613af199c4a/raw/1754d3f61b7859a8f9ad7667da4368ef2e354e78/.zshrc
chsh -s /bin/zsh
echo "Poweline terminal"
git clone https://github.com/milkbikis/powerline-shell > /dev/null
cd powerline-shell
mv config.py.dist config.py
./install.py
cd ..
ln -s powerline-shell/powerline-shell.py powerline-shell.py
apt-get install language-pack-id > /dev/null
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales > /dev/null
pip install argparse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment