Skip to content

Instantly share code, notes, and snippets.

@Keoven
Last active January 2, 2016 15:29
Show Gist options
  • Save Keoven/8323765 to your computer and use it in GitHub Desktop.
Save Keoven/8323765 to your computer and use it in GitHub Desktop.
A ubuntu setup for a GUI-less virtual machine.
# Ubuntu
#
# Requirements:
# sudo apt-get install curl -y
#
# > curl https://gist.github.com/Keoven/8323765/raw/ubuntu_setup_nogui.sh | sh
#
# Add all third party repositories
sudo apt-get update -y
sudo apt-get install python-software-properties -y
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner" -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update -y
# Setup Environment
sudo apt-get install libcurl4-openssl-dev -y
sudo apt-get install git -y
sudo apt-get install ruby -y
sudo apt-get install build-essential checkinstall -y
sudo apt-get install cvs subversion git-core mercurial -y
sudo apt-get install zsh -y
sudo apt-get install vim-gtk ack ctags rake -y
sudo apt-get install python-pip python-tk python-dev -y
sudo apt-get install tmux -y
sudo apt-get install libsqlite3-dev -y
sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 -y
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby -y
sudo apt-get install libxslt-dev libxml2-dev -y
sudo apt-get install default-jdk -y
# For Graphite Installations
sudo apt-get install python-software-properties -y
sudo apt-get install memcached python-dev python-pip sqlite3 libcairo2 libcairo2-dev python-cairo pkg-config -y
# Install Node.js and NPM
# sudo apt-get install nodejs -y
# sudo ln -s /usr/bin/nodejs /usr/bin/node
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
\curl -L https://npmjs.org/install.sh | bash -s stable
# For now, default to 0.8.22
#
nvm install 0.10.21
nvm alias default 0.10.21
# Install `libiconv`
# Issue this command to install nokogiri
# CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" gem install nokogiri -- --with-iconv-dir=/usr/local/libiconv --with-iconv-lib=/usr/local/libiconv/lib --with-iconv-include=/usr/local/libiconv/include
cd ~
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.11.tar.gz
tar -xvzf libiconv-1.11.tar.gz
cd libiconv-1.11/
./configure --prefix=/usr/local/libiconv
make CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls"
sudo make install
cd ~
rm -rf libiconv-1.11*
# Install PostgreSQL Dependency
sudo apt-get install postgresql libpq-dev -y
sudo -u postgres createuser --superuser $USER
## REMINDER -- You need to set password by doing:
# 1. `> sudo -u postgres psql postgres`
# 2. `# \password`
# 3. `\q`
# Install MySQL Dependency
sudo apt-get install libmysqlclient-dev mysql-client mysql-server -y
# Install Redis
sudo apt-get install redis-server -y
# Fixes Errors on RVM requireing autoreconf missing in path for ruby installations.
sudo apt-get install automake -y
mkdir /usr/local/src
sudo chown $USER /usr/local/src
sudo chmod u+rwx /usr/local/src
# Install RVM
\curl -L https://get.rvm.io | bash -s stable
## Commented out for now due to library confusion when building native extensions
# (http://stackoverflow.com/questions/8814924/gem-install-pg-can-not-bind-to-libpq/8874260#8874260)
#
# rvm pkg install readline --verify-downloads 1
# rvm pkg install iconv --verify-downloads 1
# rvm pkg install zlib --verify-downloads 1
# rvm pkg install libxml2 --verify-downloads 1
# rvm pkg install libxslt --verify-downloads 1
# rvm pkg install openssl --verify-downloads 1
sudo apt-get install libyaml-dev libxml2-dev libxslt-dev libreadline-dev -y
# Setup dot files
cd ~
rvm autolibs enable
rvm rvmrc warning ignore all.rvmrcs
rvm install $(rvm list known | grep \\[ruby\-\\] | grep \\[-p | tail -1 | cut -c 8-12)
git clone --no-checkout git://github.com/Keoven/dotfiles.git dotfiles.tmp
mv dotfiles.tmp/.git .
git reset --hard HEAD
rm -rf dotfiles.tmp/
# Install Oh-My-ZSh
cd ~
rm -rf .oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
chsh -s $(which zsh)
git checkout .
# Install Janus
curl -Lo- https://bit.ly/janus-bootstrap | bash
rm -rf .vim.old
# Remove .zprofile -- use .zshrc
cd ~
rm .zprofile
echo; echo Please reboot the computer...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment