Skip to content

Instantly share code, notes, and snippets.

[Fri, 09 Jul 2010 10:51:12 -0400] INFO: MysqlDatabase light-weight provider already initialized -- overriding!
[Fri, 09 Jul 2010 10:51:12 -0400] ERROR: Running exception handlers
[Fri, 09 Jul 2010 10:51:12 -0400] ERROR: Exception handlers complete
[Fri, 09 Jul 2010 10:51:12 -0400] ERROR: Re-raising exception: Errno::EPIPE - Broken pipe
/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/chef-0.9.6/bin/../lib/chef/provider.rb:116:in `write'
/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/chef-0.9.6/bin/../lib/chef/provider.rb:116:in `const_set'
/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/chef-0.9.6/bin/../lib/chef/provider.rb:116:in `build_from_file'
/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/chef-0.9.6/bin/../lib/chef/run_context.rb:65:in `load'
/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/chef-0.9.6/bin/../lib/chef/run_context.rb:103:in `call'
/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/chef-0.9.6/bin/../lib/chef/run_context.rb:103:in `foreach_cookbook_load_segment'
$ scp root@myserver:/etc/chef/webui.pem /tmp/webui.pem
webui.pem 100% 1675 1.6KB/s 00:00
$ scp root@myserver:/etc/chef/validation.pem /tmp/validation.pem
validation.pem 100% 1679 1.6KB/s 00:00
$ knife configure -i
Where should I put the config file? [~/.chef/knife.rb] ~/.chef/staging_knife.rb
Please enter the chef server URL: [http://localhost:4000] http://myserver:4000
Please enter a clientname for the new client: [drat]
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
@gdi
gdi / gits
Created December 8, 2009 15:31
#!/bin/sh
git status
@gdi
gdi / sr
Created December 8, 2009 15:30
#!/bin/sh
ssh root@$1
# Rake task for listing all Cucumber steps defined
namespace :cucumber do
task :steps do
list = { :given => [], :when => [], :then => [] }
files = Dir.glob(File.join(File.dirname(__FILE__),'features','**','*.rb')).each do |f|
File.readlines(f).select { |l| l =~ /\s*[^#]?\s*(Given|When|Then)\s\// }.each do |line|
line =~ /(Given|When|Then)\s+(\/\^?)?([^$\/]+)(\$?\/)?/
type = $1.downcase.to_sym
name = "#{$1} #{$3}".strip
Script lives here: http://gist.github.com/138318
There is a spreadsheet of a bigger comparo here: http://spreadsheets.google.com/pub?key=rWBwk7nwt6RKn0zyq6RrCDA&output=html
Benchmarking mysql with 2888750 email records
MySQL ISAM / MySQL-Ruby / Indexed / Untuned
user system total real
find record by pk 0.000000 0.000000 0.000000 ( 0.000489)
#!/usr/bin/env ruby
# Script to benchmark mysql equivalents of the Tokyo Table Queries
require 'rubygems'
require 'mysql'
require 'benchmark'
puts "Benchmarking mysql with 2888750 email records"
There is a spreadsheet of a bigger comparo here: http://spreadsheets.google.com/pub?key=rWBwk7nwt6RKn0zyq6RrCDA&output=html
Benchmarking ttserver with 2888750 email records
!!! Correction: pk_only queries had bad times in the earlier revision
!!! "Tuned Indexes" means I manually set the bnum to 2x the key count; all indices are set to "large"
Tokyo Tyrant Socket / No Indexes / Untuned Queries
user system total real
find record by pk 0.000000 0.000000 0.000000 ( 0.000592)
#!/usr/bin/env ruby
# Sample output is http://gist.github.com/135851
# Script to benchmark Message Meta Tokyo Tables
require 'rubygems'
require 'benchmark'
require 'date'
require 'fileutils'
require 'rufus/edo'
require 'rufus/tokyo/tyrant'