Skip to content

Instantly share code, notes, and snippets.

View node.json
{ "run_list": [ "recipe[redis]"] }
View gist:4735248
Generated at 2013-02-07 15:34:41 -0800
NoMethodError: undefined method `run_list_for' for {"run_list"=>["recipe[graphite]"]}:Hash
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/run_list/run_list_expansion.rb:151:in `expand_run_list_items'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/run_list/run_list_expansion.rb:84:in `expand'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/run_list.rb:139:in `expand'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/node.rb:326:in `expand!'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:331:in `expand_run_list'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:289:in `build_node'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:459:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:200:in `run'
@ChrisLundquist
ChrisLundquist / gist:4358358
Created Dec 22, 2012
chef-rbenv 0.7.0 bug
View gist:4358358
[2012-12-22T09:13:29+00:00] INFO: Processing git[/usr/local/rbenv] action checkout (rbenv::system_install line 61)
[2012-12-22T09:13:34+00:00] INFO: git[/usr/local/rbenv] cloning repo git://github.com/sstephenson/rbenv.git to /usr/local/rbenv
[2012-12-22T09:13:40+00:00] INFO: git[/usr/local/rbenv] checked out branch: master reference: c3fe192243bff9a00866d81af38d9012bfba419a
[2012-12-22T09:13:40+00:00] INFO: Processing bash[Initialize rbenv (system)] action run (rbenv::system_install line 80)
================================================================================
Error executing action `run` on resource 'bash[Initialize rbenv (system)]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
View gist:4349606
$ jamie test
-----> Cleaning up any prior instances of default-centos6
-----> Destroying instance default-centos6
[vagrant command] 'vagrant destroy default-centos6 -f'
[default-centos6] VM not created. Moving on...
[vagrant command] ran in 1.2300000000000009 seconds.
Destruction of instance default-centos6 complete.
-----> Testing instance default-centos6
-----> Creating instance default-centos6
[vagrant command] 'vagrant up default-centos6 --no-provision'
@ChrisLundquist
ChrisLundquist / splitter.rb
Created Dec 19, 2012
split apart a monolithic repo into several smaller ones while preserving commit history.
View splitter.rb
#!/usr/bin/env ruby
BASE_REMOTE_URL = "git@github.blueboxgrid.com:chef"
folders = ARGV
pwd = Dir.pwd
folders.each do |folder|
name = folder.split("/").last
name = name.gsub("-","_")
clone_command = "git clone chef/ #{name}"
system clone_command
Dir.chdir name
@ChrisLundquist
ChrisLundquist / elasticsearch.coffee
Created Nov 10, 2012
elasticsearch plugin for Hubot
View elasticsearch.coffee
# Description:
# Log all the things to ElasticSearch then lets you ask hubot what you missed
#
# Dependencies:
# None
#
# Configuration:
# ELASTICSEARCH_HOSTNAME - E.G. elasticsearch.example.com:9200, where to send the put requests
# ELASTICSEARCH_USERNAME - OPTIONAL basic auth username
# ELASTICSEARCH_PASSWORD - OPTIONAL basic auth password
@ChrisLundquist
ChrisLundquist / gist:4004763
Created Nov 2, 2012
logstash regexp error
View gist:4004763
D, [2012-11-02T18:24:04.320000 #29703] DEBUG -- : TRYING stanzacbs...
D, [2012-11-02T18:24:04.320000 #29703] DEBUG -- : TRYING message/iq/presence/cbs...
W, [2012-11-02T18:24:04.332000 #29703] WARN -- : EXCEPTION:
REXML::ParseException
#<Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)>
org/jruby/RubyRegexp.java:1505:in `match'
file:/opt/logstash/server/lib/logstash-1.1.4.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/source.rb:212:in `match'
file:/opt/logstash/server/lib/logstash-1.1.4.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/parsers/baseparser.rb:369:in `pull'
file:/opt/logstash/server/lib/logstash-1.1.4.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/parsers/sax2parser.rb:92:in `parse'
file:/opt/logstash/server/lib/logstash-1.1.4.jar!/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:79:in `parse'
View foo_spec.rb
class Foo
end
describe Foo do
it "should call the right equals method" do
Foo.new.should be_equal Foo.new
end
end
View kibana
NameVirtualHost *:8081
<VirtualHost *:8081>
ServerName 10.0.2.15
DocumentRoot "/opt/logstash/kibana/current"
<Directory "/opt/logstash/kibana/current">
DirectoryIndex index.php
</Directory>
View gist:3898403
def get_rrd_backend
Visage::Collectd::RRD.new( :rrddir => Visage::Config.rrddir,
:collectdsock => Visage::Config.collectdsock,
:rrdcachedsock => Visage::Config.rrdcachedsock)
end
def get_foo_backend
# something else
end