Skip to content

Instantly share code, notes, and snippets.

View Removing RI and RDOC
du -hs `gem env gemdir`/doc
# 465M /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/doc
sudo rm -r `gem env gemdir`/doc
echo 'gem: --no-ri --no-rdoc' >> ~/.gemrc
joakimk / livereload.rake
Created Nov 17, 2010
A simple rakefile to run livereload and generate css from the sass (scss) files specified in asset_packages.yml.
View livereload.rake
desc "Continuously watch for changes and rebuild files"
task :livereload do
pids = `ps ax|grep ruby|grep livereload|awk '{ print $1 }'`.split
other_pids = pids.reject { |pid| == pid.to_i }
system "kill #{other_pids.join(' ')} &> /dev/null"
system "nohup livereload &> /dev/null &"
require 'rubygems'
require 'fssm'
joakimk /
Created Nov 21, 2010
Install script for Apache+REE+Passenger 3 on Ubuntu 10.04 64bit
# Install script for Apache+REE+Passenger 3 on Ubuntu 10.04 64bit
# - Make sure you are logged as a non-root user that can sudo.
# - Add your key here:
SSH_KEY="ssh-rsa ..."
# Add key to admin user
mkdir -p .ssh && echo "$SSH_KEY" >> .ssh/authorized_keys || exit 1
joakimk /
Created Nov 24, 2010
Quickly installing a ruby environment on ubuntu that supports testbot
sudo apt-get update && sudo apt-get install build-essential vim ruby ruby-dev libsqlite3-dev && wget && tar xvfz rubygems-1.3.7.tgz && cd rubygems-1.3.7 && sudo ruby setup.rb && sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
View testbot.rake
namespace :testbot do
task :before_request do
# This is run after you start a request (ex: rake testbot:spec)
task :before_run do
# This is run by the runner after files are synced but before tests are run
# Example: Setting up a test database
database_yml = <<-DB_CONFIG
View testbot.yml
# Which server to use.
# server_user: testbot
# Project prefix. Used for prefixing project files
# so that you can run multiple projects in the same testbot network.
# project: project
# RSync settings. The folder where your files are synced to
# and then fetched from before running the tests.
joakimk / gist:720660
Created Nov 29, 2010
Benchmark notes, testbot @ EC2
View gist:720660

Most cost effective instance type?

I did a bit of benchmarking using our rspec suite and the most cost effective flavor seems to be "c1.medium". It's almost twice as fast as s1.small but still has the same per-core price. The micro instances were about 4 times slower than c1.medium.

The c1.xlarge instance did not perform better than c1.medium (actually worse) and costs as much per core.

I did not try the cluster nodes as they require you to create your own image to use it.

View staging.json
"run_list": [
View gist:838556
project user$ rake testbot:features --trace
(in /Users/user/project)
** Invoke testbot:features (first_time)
** Execute testbot:features
** Invoke testbot:before_request (first_time)
** Invoke testbot:prepare_config (first_time)
** Execute testbot:prepare_config
** Execute testbot:before_request
rake aborted!
undefined method `map' for nil:NilClass
joakimk / vagrant_version_checks.rb
Created Mar 23, 2011
Some code we use to ensure that we all use the same VirtualBox and vagrant versions.
View vagrant_version_checks.rb
# ...
# Ensure a compatible Vagrant and VirtualBox versions.
INSTALL_CMD = "gem uninstall vagrant -a -x &> /dev/null &&" +
"gem install vagrant -v #{REQUIRED_VERSION} --no-ri --no-rdoc &>/dev/null"