Skip to content

Instantly share code, notes, and snippets.

View hjkp's full-sized avatar

HJK Solutions hjkp

View GitHub Profile
Successfully installed ruby-openid-2.1.2
Successfully installed json-1.1.3
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.2
Successfully installed extlib-0.9.9
Successfully installed stomp-1.0.6
Successfully installed ohai-0.1.1
Successfully installed chef-0.0.2
Successfully installed daemons-1.0.10
Successfully installed eventmachine-0.12.2
@hjkp
hjkp / a.rb
Created December 16, 2008 00:07
before do
"eat my shorts"
end
class Chef
class Hook
class BenIsNuts << Chef::Hook
before :benhook
def benhook
... eat it ...
end
end
end
#
# master configuration
#
global_defs {
notification_email {
[email protected]
}
notification_email_from [email protected]
#
# Chef Client Config File
#
# Will be overwritten
#
log_level :info
log_location STDOUT
file_store_path "/var/chef/file_store"
file_cache_path "/var/chef/cache"
service "apache2" do
name value_for_platform(
[ "CentOS", "RedHat", "Fedora", "SuSE" ] => { "default" => "httpd" },
[ "Debian", "Ubuntu" ] => { "default" => "apache2" }
)
supports :restart => true
action :enable
end
#
# Cookbook Name:: chef
# Attribute File:: client.rb
#
require 'open_uri'
log_level :info
log_location STDOUT
file_store_path "/var/chef/file_store"
def foo(*bar, &baz)
puts foo.inspect
baz.call
end
foo(:one, :two, :three) { puts 'monkey!' }
# >STDOUT> [ :one, :two, :three ]
# >STDOUT> monkey!
res = nil
tf = nil
http.request(req) do |response|
if raw
tf = Tempfile.new("chef-rest")
# Stolen from http://www.ruby-forum.com/topic/166423
# Kudos to _why!
size, total = 0, response.header['Content-Length'].to_i
response.read_body do |chunk|
tf.write(chunk)
racing(1):/Library/Ruby/Gems/1.8/gems/merb-core-0.9.9/lib/merb-core.rb:237 Merb.load_paths[type].first
Tracing(6):/Library/Ruby/Gems/1.8/gems/merb-core-0.9.9/lib/merb-core/logger.rb:139 return unless @buffer.size > 0
Tracing(1):/Library/Ruby/Gems/1.8/gems/extlib-0.9.7/lib/extlib/dictionary.rb:215 @hash[ k ]
Tracing(6):/Library/Ruby/Gems/1.8/gems/merb-core-0.9.9/lib/merb-core/logger.rb:140 @mutex.synchronize do
Tracing(1):/Library/Ruby/Gems/1.8/gems/extlib-0.9.7/lib/extlib/string.rb:75 File.join(self, o.to_s)
Tracing(6):/Library/Ruby/Gems/1.8/gems/merb-core-0.9.9/lib/merb-core/logger.rb:141 @log.write(@buffer.slice!(0..-1).to_s)
Tracing(1):/Library/Ruby/Gems/1.8/gems/merb-core-0.9.9/lib/merb-core/bootloader.rb:880 if Merb::Config[:rackup]
~ Worker Thread Crashed with Exception:
uninitialized constant Merb::Dispatcher - (NameError)
/Library/Ruby/Gems/1.8/gems/merb-core-0.9.9/lib/merb-core/dispatch/worker.rb:16:in `process_queue'