Skip to content

Instantly share code, notes, and snippets.

@petyosi
Created October 24, 2010 12:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save petyosi/643507 to your computer and use it in GitHub Desktop.
Save petyosi/643507 to your computer and use it in GitHub Desktop.
Instructions on setting up new work VM.

Installation

  • Update your VirtualBox
  • Download ubuntu LTS server (64 bit)
  • name “garmz-dev”
  • Run default installation from the downloaded iso in new VM
    • hostname “garmz-dev”
    • Don’t encrypt home
    • No automatic updates
    • Pick OpenSSH server and PostgreSQL server
    • Complete, shutdown, remove CD

Configure SSH port forwarding (execute on host machine)


VBoxManage modifyvm "garmz-dev" --natpf1 "rails,tcp,,3000,,3000"
VBoxManage modifyvm "garmz-dev" --natpf1 "guestssh,tcp,,2222,,22"
echo "Host vm
ForwardX11 yes
Hostname localhost
Port     2222
User     petyo" >> ~/.ssh/config
VBoxHeadless --startvm "garmz-dev"
rsync -av ~/.ssh/ vm:.ssh

In terminal, ^⌘k ssh vm – should let you in

System setup

sudo -s
export EDITOR=vim
visudo
Gi petyo   ALL=(ALL) NOPASSWD: ALL
:wq
^D
sudo apt-get upgrade

Install needed stuff

sudo apt-get install git-core zsh curl exuberant-ctags ack-grep libpq-dev libxml2-dev libxslt-dev redis-server firefox
# fix ack
sudo ln -sf /usr/bin/ack-grep /usr/bin/ack

Shell/screen config

sudo mkdir /w/
sudo chown petyo:petyo /w/
cd /w/
git clone https://github.com/underlog/config_files.git
cd config_files; ./install.sh
# change default shell
chsh -s /bin/zsh
# logout, SSH again.
# at this point, you have screen, switch to it
screen

Configure git

cd
vim .gitconfig # ignore the warning of vim, we will get to it.  

[github] 
    user = ****
    token = ***
[user] 
    name = **** 
    email = ****

vim .netrc # add your github account here
machine github.com
login *****
password ******

Configure vim

cd 
mkdir .vim
mkdir .vimbackup
cd .vim
git init .
git remote add origin https://github.com/underlog/vimfiles.git
git fetch origin
git co petyo
git submodule init
git submodule update

Ruby

Use brightbox repos for REE


sudo -s
wget http://apt.brightbox.net/release.asc -O - | sudo apt-key add -
echo 'deb http://apt.brightbox.net/ lucid rubyee' >> /etc/apt/sources.list.d/brightbox-rubyee.list
apt-get update
apt-get install ruby1.8 ruby1.8-dev libopenssl-ruby1.8 irb ruby 
cd /tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xfv rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
ln -sf /usr/bin/gem1.8 /usr/bin/gem
gem install bundler
^D # exit sudo

Checkout project

Bundle install

In my case I need these:

Setup databases

sudo su - postgres 
createuser -s petyo
^D
psql template1
ALTER USER petyo WITH PASSWORD '*****';

Run specs

Run cucumber

You may have to close ssh and open again. Try running firefox to see if it will hook up on X11 forwarding.

@hdeshev
Copy link

hdeshev commented Oct 25, 2010

Това е достатъчно ценно, че си струва да орежеш чувствителните части и да го постнеш на крафтсманшип групата.

@petyosi
Copy link
Author

petyosi commented Oct 25, 2010

То много чувствителни неща няма, по-скоро частни за проекта. Май ще опъна дискусия по въпроса.

@hdeshev
Copy link

hdeshev commented Oct 25, 2010

Опъни, опъни :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment