Skip to content

Instantly share code, notes, and snippets.

View hjkp's full-sized avatar

HJK Solutions hjkp

View GitHub Profile
class Monkey < Application
provides :html, :json
def index
@monkey_list = Monkey.list
display @node_list
end
def show
http://www.credit.com/
GET / HTTP/1.1
Host: www.credit.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.2) Gecko/2008090512 Firefox/3.0.2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
class Foolio < Chef::Recipe
def self.hit_me
package "foo" do
action :remove
end
end
end
Foolio.hit_me
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'
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)
def foo(*bar, &baz)
puts foo.inspect
baz.call
end
foo(:one, :two, :three) { puts 'monkey!' }
# >STDOUT> [ :one, :two, :three ]
# >STDOUT> monkey!
#
# Cookbook Name:: chef
# Attribute File:: client.rb
#
require 'open_uri'
log_level :info
log_location STDOUT
file_store_path "/var/chef/file_store"
service "apache2" do
name value_for_platform(
[ "CentOS", "RedHat", "Fedora", "SuSE" ] => { "default" => "httpd" },
[ "Debian", "Ubuntu" ] => { "default" => "apache2" }
)
supports :restart => true
action :enable
end
#
# 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"
#
# master configuration
#
global_defs {
notification_email {
[email protected]
}
notification_email_from [email protected]