Skip to content

Instantly share code, notes, and snippets.

@evaldosantos
Created September 27, 2017 20:32
Show Gist options
  • Save evaldosantos/ee10ab8d61e87d9d2e274da9514624fa to your computer and use it in GitHub Desktop.
Save evaldosantos/ee10ab8d61e87d9d2e274da9514624fa to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 5432, host: 5432
config.vm.network "forwarded_port", guest: 8765, host: 8765
config.vm.network "forwarded_port", guest: 9000, host: 9000
config.vm.network "forwarded_port", guest: 35728, host: 35728
if Vagrant.has_plugin?("vagrant-timezone")
config.timezone.value = "Europe/Paris"
end
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
# install postgres
apt-get update && apt-get install -y python-software-properties software-properties-common libpq-dev python-dev git vim postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
# su - postgres
# psql --command "CREATE USER $DB_USER WITH SUPERUSER PASSWORD '$DB_PASS';" &&\
# createdb -O $DB_USER $DB_NAME
# /usr/bin/psql $DB_NAME < /tmp/dump.sql
SHELL
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# installls pip, virtualenvwrapper
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
echo "export PATH=\"$PATH:$HOME/.local/bin\"" >> ~/.bash_profile
source ~/.bash_profile
pip install --user virtualenvwrapper
echo "source $HOME/.local/bin/virtualenvwrapper.sh" >> ~/.bash_profile
# pip install -r requirements.txt
# install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 8
#install rvm
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.4
# echo 'Europe/Paris' >/etc/timezone && dpkg-reconfigure -f noninteractive tzdata
# date --set "26 Sep 2017 17:00:00"
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment