Skip to content

Instantly share code, notes, and snippets.

joakimk / example_output.txt
Created Mar 23, 2011
Example output for the vagrant_example.
View example_output.txt
Macbook:vagrant_example (master) $ time vagrant up
[default] Provisioning enabled with chef_solo...
[default] Box base was not found. Fetching box from specified URL...
[default] Downloading with Vagrant::Downloaders::HTTP...
[default] Downloading box:
[default] Extracting box...
[default] Verifying box...
[default] Cleaning up downloaded box...
[default] Importing base box 'base'...
[default] Matching MAC address for NAT networking...
joakimk /
Created Mar 23, 2011
How to get the vagrant dev-env running
bash < <( curl )
# follow instructions
rvm install ree
rvm use ree
git clone
cd vagrant
gem install bundler
git checkout 77a1b9a6efe4f5cdc993
View fi_2_en
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'json'
# Get one at
def translate_to_en(text)
JSON.parse(HTTParty.get("{GOOGLE_TRANSLATE_KEY}&q=#{URI.encode(text)}%20d%C3%A5&source=fi&target=en", :format => 'text').to_s)["data"]["translations"][0]["translatedText"]
joakimk / .deploy_config.yml
Created Apr 11, 2011
Example of the deploy config for quickly testing changes to testbot (used by "rake deploy")
View .deploy_config.yml
upload_gem: scp pkg/GEM_FILE user@public_host:/var/www/testbot
update_server: ssh user@server 'wget -q http://public_host/testbot/GEM_FILE && gem install GEM_FILE --no-ri --no-rdoc && rm GEM_FILE'
restart_server: ssh user@server 'testbot --server stop; testbot --server start'
#### To use development versions the runners should be started like this: ####
testbot --runner --connect ... --auto_update --dev_gem_root http://public_host/testbot
View brightbox_debug.log
macbook:bb (master) $ time ../bin/testbot_cloud start
Starting 5 runners...
srv-hfme2 is being created...
srv-tigqo is being created...
srv-aap3y is being created...
srv-u61ix is being created...
srv-tigqo is up, installing testbot...
srv-u61ix is up, installing testbot...
srv-tigqo ssh connection failed, retrying...
srv-tigqo ssh connection failed, retrying...
joakimk / HipChatOptimized.user.css
Created Apr 21, 2011
Quick userscript to make HipChat more like irssi
View HipChatOptimized.user.css
div.input {
background-color: #555 !important;
border-top: 1px solid #aaa !important;
.topic_container {
background-color: #222 !important;
color: #aaa !important;
joakimk / bot.rb
Created Apr 29, 2011 — forked from jpr5/bot.rb
XMPP/Ruby Bot for HipChat with support for multiple rooms
View bot.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'xmpp4r'
require 'xmpp4r/muc/helper/simplemucclient'
# Most of this is borrowed from
# Added support for multiple rooms and external handling of messages.
# We want the MUC functionality to just handle shit for us. Unfortunately we
# have to override/repeat the join method in order to add the directive that
joakimk / usage.rb
Created Jun 9, 2011
Example of how to setup a server in vmware that installs from a pxe install server
View usage.rb
# config = ..
datacenter =
datacenter.create_vm(:name => "ServerName", :cpus => 1, :memory => 512, :disk => 5000,
:datastore => "VolumeName", :install_identifier_mac => "some mac addr",
:install_pxe_network_name => "network to look for pxe server on")
# server cookbook
joakimk / pivotalstatus.rb
Created Jun 23, 2011 — forked from aalin/pivotalstatus.rb
Pivotal tracker git status thing...
View pivotalstatus.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'pivotal-tracker'
class String
ANSI_COLORS = [:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white]
def colorize(color)
num = ANSI_COLORS.index(color) or raise("Bad color #{ color }")
"\e[3#{ num }m" + self + "\e[0m"
joakimk / gist:1117167
Created Jul 31, 2011
Some simple ruby 1.9.3 benchmarks
View gist:1117167
The two rubies:
- 1.9.2 "ruby-1.9.2-p180-patched" (using
- 1.9.3 "ruby-1.9.3-preview1"
The app:
- Rails 3.1rc4 app with some scaffolds.
Ruby: Rails environment load time: Full spec suite: Unit tests: