Skip to content

Instantly share code, notes, and snippets.

@tian-im
Created July 23, 2017 01:01
Show Gist options
  • Save tian-im/d918fdfd5198cae6a62739a24cd518bf to your computer and use it in GitHub Desktop.
Save tian-im/d918fdfd5198cae6a62739a24cd518bf to your computer and use it in GitHub Desktop.
Vagrant setup
#!/usr/bin/env bash
source $HOME/.rvm/scripts/rvm || source /etc/profile.d/rvm.sh
rvm use --default --install $1
shift
if (( $# ))
then gem install $@
fi
rvm cleanup all
#!/usr/bin/env bash
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s $1
#!/usr/bin/env bash
sudo apt-get install -y debconf-utils
# MYSQL: set a blank password for root user
# firstly default password to 'password'
ROOT_PASSWORD="password"
export DEBIAN_FRONTEND="noninteractive"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password ${ROOT_PASSWORD}"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${ROOT_PASSWORD}"
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
# then reset password to blank
mysql -u root --password=$ROOT_PASSWORD -e "ALTER USER 'root'@'localhost' IDENTIFIED BY ''"
# POSTGRESQL
sudo apt-get install -y postgresql postgresql-contrib libpq-dev
# add current user
sudo -u postgres createuser -s ubuntu
# sudo vim /etc/postgresql/9.5/main/pg_hba.conf
# sudo service postgresql restart
# @see README.md for detailed steps
cd /vagrant
# gems installation
gem install bundler --no-ri --no-rdoc
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment