Skip to content

Instantly share code, notes, and snippets.

@rbm
rbm / gist:839908
Created February 23, 2011 02:55
collectd_python_plugin stack
[Wed, 23 Feb 2011 02:48:26 +0000] DEBUG: Re-raising exception: Chef::Exceptions::ResourceNotFound - Cannot find a resource matching template[/etc/collectd/plugins/python.conf] (did you define it first?)
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:115:in `lookup'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:182:in `find_resource_by_hash'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:180:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:180:in `find_resource_by_hash'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:178:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:178:in `find_resource_by_hash'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:137:in `find'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:134:in `each'
/usr/lib
@rbm
rbm / gist:839912
Created February 23, 2011 02:56
collectd_python_plugin patch
diff --git a/ataritech/collectd/definitions/collectd_plugin.rb b/ataritech/collectd/definitions/collectd_plugin.rb
index dd826e9..de8c0f6 100644
--- a/ataritech/collectd/definitions/collectd_plugin.rb
+++ b/ataritech/collectd/definitions/collectd_plugin.rb
@@ -37,7 +37,7 @@ end
define :collectd_python_plugin, :options => {}, :module => nil, :path => nil do
begin
t = resources(:template => "/etc/collectd/plugins/python.conf")
- rescue ArgumentError
+ rescue ArgumentError, Chef::Exceptions::ResourceNotFound
@rbm
rbm / invalidate-cf-path.rb
Created August 29, 2011 09:27
Invalidate CloudFront path using fog
#!/usr/bin/env ruby -w
require 'rubygems'
require 'fog'
require 'pp'
AWS_ACCESS_KEY = ENV['AWS_ACCESS_KEY_ID']
AWS_SECRET_KEY = ENV['AWS_SECRET_ACCESS_KEY']
def get_cf_connection()
@rbm
rbm / hbase_schemadump.rb
Created November 25, 2014 22:30
Dump HBase schema creation statements
include Java
import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.client.HTable
conf = HBaseConfiguration.new
jrb_tables = list()
hbase_tables = jrb_tables.map { |jt| HTable.new(conf, jt) }
hbase_tables.each do |tbl|