Skip to content

Instantly share code, notes, and snippets.

View jsierles's full-sized avatar
🎯
Focusing

Joshua Sierles jsierles

🎯
Focusing
View GitHub Profile
#!/bin/sh
#
# EC2 bootstrap
#
export PATH=$PATH:/usr/local/bin
mkdir /etc/chef
mkdir /var/chef
cat > /etc/chef/solo.rb <<SOLO
ssh_options[:keys] = [File.join(ENV["HOME"], ".ec2", "ec2"), File.join(ENV["HOME"], ".ssh", "id_rsa")]
set :user, ENV["USER"]
role :app, "noc.ec2-us.domain.com"
require 'erb'
require 'right_aws'
ROLE_IMAGE_MAP = {:app => {:ami => "ami-7cfd1a15", :type => 'c1.medium'},
:noc => {:ami => "ami-7cfd1a15", :type => 'c1.medium'}
}
cookbook_path "/var/chef/cookbooks"
node_path "/var/chef/nodes"
log_level :info
file_store_path "/var/chef"
file_cache_path "/var/chef"
#!/usr/bin/ruby
#
# Joshua Sierles, 37signals, 2009
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/stats.rb:338:in `round_to'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/stats.rb:155:in `round!'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/agent/stats_engine.rb:198:in `harvest_timeslice_data'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/agent/stats_engine.rb:173:in `each'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/agent/stats_engine.rb:173:in `harvest_timeslice_data'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/agent/agent.rb:586:in `harvest_and_send_timeslice_data'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/agent/agent.rb:328:in `run_worker_loop'
from /u/apps/basecamp/releases/20090322212637/vendor/plugins/rpm/lib/new_relic/agent/worker_loop.rb:124:in `call'
from /u/apps/basecamp/releases/20090322212637/ve
def round_to(decimal_places)
x = self
decimal_places.times do
x = x * 10
end
x = x.round
decimal_places.times do
x = x.to_f / 10
end
x
module NewRelic
module Stats
def absent?
# guess on absent values
call_count == 0
end
def average_call_time
(gdb) thread apply all bt
Thread 1 (Thread 0x7f684f1b16f0 (LWP 20806)):
#0 0x000000000047a79a in st_delete ()
#1 0x0000000000430c8f in run_final ()
#2 0x0000000000430d66 in finalize_list ()
#3 0x0000000000431112 in rb_gc_finalize_deferred ()
#4 0x000000000041c88c in rb_call0 ()
#5 0x000000000041d66b in rb_call ()
#6 0x0000000000417a37 in rb_eval ()
# ruby backtrace under passenger
gdb /path-to-ruby pid-of-rails-process
thread apply all bt
p rb_backtrace()
[Wed Mar 25 20:08:59 2009] [notice] child pid 4594 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4595 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4596 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4597 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4598 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4599 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4600 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4601 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4602 exit signal Segmentation fault (11)
[Wed Mar 25 20:08:59 2009] [notice] child pid 4603 exit signal Segmentation fault (11)