Skip to content

Instantly share code, notes, and snippets.

@geopet
Last active August 21, 2016 03:11
Show Gist options
  • Save geopet/8797513 to your computer and use it in GitHub Desktop.
Save geopet/8797513 to your computer and use it in GitHub Desktop.
A set of scripts to be used to get a vagrant install up and running with Ruby 2.2.0, Rails 4.2.0, Git 2.0.1, Vim 7.4, MySQL, and PostgreSQL
#!/usr/bin/env bash
cd
git clone https://gist.github.com/8797857.git gitconfig
ln -s ~/gitconfig/.gitconfig ~/.gitconfig
#!/usr/bin/env bash
cd
git clone https://gist.github.com/9003459.git irbrc
ln -s ~/irbrc/.irbrc ~/.irbrc
#!/usr/bin/env bash
echo '=================================================='
echo '===================== APT-GET ===================='
echo '=================================================='
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev -y
sudo apt-get install software-properties-common python-software-properties -y
sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential -y
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial -y
sudo apt-get remove vim vim-runtime gvim vim-tiny vim-common vim-gui-common -y
sudo add-apt-repository ppa:chris-lea/node.js -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get install libffi6 libffi-dev -y
sudo apt-get update
cd
echo '======================================================='
echo '===================== INSTALL RUBY ===================='
echo '======================================================='
## rbenv
# cd
# git clone git://github.com/sstephenson/rbenv.git .rbenv
# echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
# echo 'eval "$(rbenv init -)"' >> ~/.bashrc
# exec $SHELL
# git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
# exec $SHELL
# git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
# rbenv install 2.3.1
# rbenv global 2.3.1
## source
# wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz
# tar -xzvf ruby-2.3.1.tar.gz
# cd ruby-2.3.1
# ./configure
# make
# sudo make install
# echo "gem: --no-ri --no-rdoc" > ~/.gemrc
# gem update system
echo '======================================================'
echo '===================== INSTALL GIT ===================='
echo '======================================================'
sudo apt-get install git -y
echo '====================================================='
echo '===================== UPDATE VIM ===================='
echo '====================================================='
cd
git clone https://github.com/vim/vim.git
cd vim
./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7-config --enable-perlinterp --enable-gui=gtk2 --enable-cscope --prefix=/usr
make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install
echo '======================================================='
echo '===================== INSTALL NODE ===================='
echo '======================================================='
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
echo '========================================================'
echo '===================== INSTALL RAILS ===================='
echo '========================================================'
sudo chown -R vagrant:vagrant /usr/local/lib/ruby
sudo chown -R vagrant:vagrant /usr/local/bin
gem install rails
echo '========================================================'
echo '===================== INSTALL MYSQL ===================='
echo '========================================================'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password mysql_password'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password mysql_password'
sudo apt-get install mysql-server mysql-client libmysqlclient-dev -y
echo '============================================================='
echo '===================== INSTALL POSTGRESQL ===================='
echo '============================================================='
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common postgresql-9.3 libpq-dev -y
sudo -u postgres createuser root -s
echo '==================================================='
echo '===================== COMPLETE ===================='
echo '==================================================='
#!/usr/bin/env bash
cd
git clone git@github.com:geopet/dotvim.git
cd ~/dotvim
./vim-init.sh
#!/usr/bin/env bash
cd
sudo apt-get update
sudo apt-get install zsh -y
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
mkdir ~/.oh-my-zsh/custom/themes
git clone https://gist.github.com/7865211.git ~/.oh-my-zsh/custom/themes
cd
rm .zshrc
mkdir zshrc
git clone https://gist.github.com/8797723.git ~/zshrc
ln -s ~/zshrc/.zshrc ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment