Skip to content

Instantly share code, notes, and snippets.

@hakanensari
Created August 2, 2012 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hakanensari/3238176 to your computer and use it in GitHub Desktop.
Save hakanensari/3238176 to your computer and use it in GitHub Desktop.
Set up an Ubuntu 12.04 Precise box with Vagrant for Ruby and NodeJS development
gem install vagrant
vagrant box add precise64 http://files.vagrantup.com/precise64.box
vagrant init
vagrant up
apt-get update
apt-get -y install git-core build-essential zlib1g-dev libssl-dev
apt-get -y install libreadline-gplv2-dev curl libxml2 libxml2-dev libxslt1-dev
apt-get -y install postgresql-9.1 postgresql-contrib-9.1 libpq-dev
apt-get -y install redis-server
# ruby-build
cd /usr/src
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build && ./install.sh
# rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Ruby
curl https://raw.github.com/gist/2600122/rbenv.sh | sh && rbenv global 1.9.3-p194-perf
apt-get install python-software-properties
apt-add-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs npm nodejs-dev
echo 'gem: --no-ri --no-rdoc' > .gemrc
# tmux
sudo apt-get -y install tmux
# vim
sudo apt-get -y install vim-nox
curl -Lo- https://bit.ly/janus-bootstrap | bash
mkdir ~/.janus
cd ~/.janus
git clone git://github.com/Lokaltog/vim-powerline.git
let mapleader = ","
nnoremap <leader><space> :noh<cr>
inoremap jj <ESC>
nnoremap <Up> <C-w>k
nnoremap <Down> <C-w>j
nnoremap <Left> <C-w>h
nnoremap <Right> <C-w>l
cnoreabbrev Q q
cnoreabbrev W w
cnoreabbrev Wq wq
set splitright
set equalalways
set colorcolumn=80
set textwidth=79
set term=xterm-256color
set t_Co=256
set background=dark
colorscheme solarized
set mouse=a
set -g prefix C-a
unbind C-b
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind C-a send-prefix
bind | split-window -h
bind - split-window -v
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
setw -g mode-mouse off
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
set -g default-terminal "screen-256color"
set -g status-fg white
set -g status-bg black
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
# show short windows names in status bar
set-window-option -g window-status-format '#I'
set-window-option -g window-status-current-format '#I'
# default window title colors
set-window-option -g window-status-fg colour6
set-window-option -g window-status-bg default
set-window-option -g window-status-attr default
# active window title colors
set-window-option -g window-status-current-fg colour7
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-attr dim
set -g pane-border-bg default
set -g pane-active-border-fg black
set -g pane-active-border-bg cyan
set -g message-fg white
set -g message-bg black
set -g message-attr bright
set -g status-left "#[fg=green]#S"
set -g status-right "#[fg=cyan]%d %b %R"
set -g status-justify centre
set -g status-interval 60
set -g status-utf8 on
setw -g monitor-activity on
set -g visual-activity on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment