Skip to content

Instantly share code, notes, and snippets.

###
# Fragile, embedded, deeply tied
###
<% search("foo").each do |n| -%>
stuff with <%= n %>
<% end %>
###
# Less fragile, not embedded
We couldn’t find that file to show.
~ can't convert Fixnum into String - (TypeError)
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef.rb:40:in `glob_'
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef.rb:40:in `glob'
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.9/lib/merb-core/controller/mixins/render.rb:129:in `inject'
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef.rb:40:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef.rb:40:in `inject'
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef.rb:40:in `glob'
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef/cookbook_loader.rb:138:in `load_cascading_files'
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef/cookbook_loader.rb:76:in `load_cookbooks'
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef/cookbook_loader.rb:38:in `each'
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: Converging node samizdat_is_betfair
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: Processing execute[c]
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: execute[c] using Chef::Provider::Execute
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: Doing nothing for execute[c]
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: Processing execute[b]
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: execute[b] using Chef::Provider::Execute
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: Doing nothing for execute[b]
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: Processing execute[a]
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: execute[a] using Chef::Provider::Execute
[Thu, 20 Aug 2009 13:49:42 +0100] DEBUG: Executing echo hello!
Infrastructures (I hate this name):
* Production
* Cluster 1
- a
x whiskey
x tango
x foxtrot
* Cluster 2
- b
* Staging
actions :create, :delete
attribute :name, :kind_of => String, :name_attribute => true
attribute :config_dir, :kind_of => String
attribute :provider, :default => "tomcat6_application"
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
@thommay
thommay / carbon.md
Created November 7, 2009 08:16 — forked from defunkt/carbon.md

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

current_apt_keys = Dir[
File.expand_path(File.join(File.dirname(__FILE__), "..", "files", "default", "apt-keys", "*"))
]
ruby_block "cleanup apt-keys" do
block do
Dir[
File.expand_path(File.join(Chef::Config[:file_cache_path], "cache", "apt_keys", "*"))
].each do |rf|
unless current_apt_keys.include?(rf)
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#