Skip to content

Instantly share code, notes, and snippets.

View bmizerany's full-sized avatar
💭
Working on something new

Blake Mizerany bmizerany

💭
Working on something new
View GitHub Profile
get '/:id' do
@vent = Vent.get(params[:id])
erb :show
end
# show post
get '/:id.xml' do
@vent = Vent.get(params[:id])
builder :show
end
blake:chef$ ./bin/chef-client
[Fri, 12 Dec 2008 13:18:36 -0800] INFO: Starting Chef Run
/Users/blake/.gems/gems/chef-0.0.1/lib/chef/file_store.rb:59:in `load': Cannot find /var/chef/file_store/registration/8/d15/blake-mizeranys-macbook-air_local for registration blake-mizeranys-macbook-air_local! (RuntimeError)
from /Users/blake/.gems/gems/chef-0.0.1/lib/chef/client.rb:159:in `register'
from /Users/blake/.gems/gems/chef-0.0.1/lib/chef/client.rb:63:in `run'
from ./bin/chef-client:88
blake:chef$
#
# 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"
blake:chef$ ./bin/chef-client -l debug
[Fri, 12 Dec 2008 14:36:52 -0800] INFO: Starting Chef Run
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Building node object for blake-mizeranys-macbook-air_local
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Sending HTTP Request via GET to /nodes/blake-mizeranys-macbook-air_local
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Facter Attribute: sp_uptime - "up 0:13:20:20"
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Facter Attribute: sp_packages - "1"
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Facter Attribute: sp_kernel_version - "Darwin 9.5.2"
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Facter Attribute: sp_mmm_entry - "MMM_stateMMM_enabled"
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Facter Attribute: operatingsystemrelease - "9.5.2"
[Fri, 12 Dec 2008 14:36:53 -0800] DEBUG: Facter Attribute: sp_boot_volume - "Macintosh HD"
install("ruby",
"ruby1.8",
"libruby",
"libruby1.8",
"ruby1.8-dev",
"irb1.8",
"libreadline-ruby1.8",
"rdoc1.8",
"libzlib-ruby",
"libopenssl-ruby",
remote = Rush::Box.new('ec2-75-101-233-253.compute-1.amazonaws.com',
:user => "root")
remote.bash("ls")
class App1 < Sinatra::Base
set :views, "/path/to/views"
set :public, "/path/to/static/files"
def strong(text)
"<strong>#{text}</strong>"
end
get '/' do
strong "Hello World"
recipe "SSH" do
directory "~/.ssh" do
mode 0700
end
file "~/.ssh/authorized_keys" do
mode 0600
write txt(:ssh_keys)
end
require 'rubygems'
require 'sinatra'
class Bar < Sinatra::Base
get "/" do
"Hello world!"
end
end
map "/foo" do
host = lambda { FaceUtils.master_face_server }
def host.to_str; self.call.to_s; end
def host.to_s; self.call.to_s; end