Skip to content

Instantly share code, notes, and snippets.

@samgranieri
samgranieri / Gemfile
Created February 8, 2010 20:37
How to get Rails 2.3.5 working with bundler 0.9.3
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
jQuery("#pendingbeer_beerstyle #beer_beerstyle").autocomplete('/beers/ac_beerstyle.json?callback=?',{
dataType: "jsonp",
width: 300,
minChars: 1,
max: 40,
parse: function(data) {
return jQuery.map(data, function(doc) {
return {
data: doc,
value: doc,
% sudo knife configure -i
Password:
Overwrite /Users/sam/.chef/knife.rb? (Y/N) y
Your chef server URL? http://chef.beerbin.intranet
Your client user name? acceptance.beerbin.intranet
Your validation client user name?
Path to a chef repository (or leave blank)? /Users/sam/Documents/Development/ruby/gems/chef/chef-repo
WARN: Creating initial API user...
ERROR: Failed to read the private key /etc/chef/webui.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/webui.pem>, /usr/local/Cellar/ruby-enterprise-edition/2010.01/lib/ruby/gems/1.8/gems/chef-0.8.0/lib/chef/rest.rb:60:in `read'/usr/local/Cellar/ruby-enterprise-edition/2010.01/lib/ruby/gems/1.8/gems/chef-0.8.0/lib/chef/rest.rb:60:in `load_signing_key'/usr/local/Cellar/ruby-enterprise-edition/2010.01/lib/ruby/gems/1.8/gems/chef-0.8.0/lib/chef/rest.rb:49:in `initialize'/usr/local/Cellar/ruby-enterprise-edition/2010.01/lib/ruby/gems/1.8/gems/chef-0.8.0/lib/chef/api_client.rb:231:in `new'/usr/local/Cellar/ruby-enterprise-edition/2010.01/lib/
# My hack of the pubsub with event machine gem
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
require "bundler/capistrano"
set :stages , %w(qa production)
set :default_stage , "qa"
require "capistrano/ext/multistage"
set :application , "APP_NAME"
set :repository , "git@github.com:ORG_NAME/APP_NAME.git"
set :user , "deploy"
set :runner , user
set :scm , :git
[samgranieri]% cap deploy
triggering start callbacks for `deploy'
* executing `multistage:ensure'
*** Defaulting to `qa'
* executing `qa'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:ORG_NAME/APP_NAME.git HEAD"
$ cap deploy
   triggering start callbacks for `deploy'
 * executing `multistage:ensure'
*** Defaulting to `qa'
 * executing `qa'
 * executing `deploy'
 * executing `deploy:update'
** transaction: start
 * executing `deploy:update_code'
   executing locally: "git ls-remote git@github.com:ORG_NAME/APP_NAME.git HEAD"
bash "update to newer vim" do
cwd "/tmp"
code <<-EOH
apt-add-repository ppa:passy/vim
apt-get update
apt-get upgrade
EOH
end
[samgranieri]% knife ssh "role:webserver" "sudo chef-client" -x sam
ubuntu.local [Sun, 16 Jan 2011 22:29:13 -0600] INFO: Starting Chef Run (Version 0.9.12)
ubuntu.local [Sun, 16 Jan 2011 22:29:15 -0600] INFO: Storing updated cookbooks/essential_packages/recipes/default.rb in the cache.
ubuntu.local [Sun, 16 Jan 2011 22:29:17 -0600] ERROR: bash[update to newer vim] (/var/chef/cache/cookbooks/essential_packages/recipes/default.rb:13:in `from_file') had an error:
ubuntu.local "bash" "/tmp/chef-script20110116-3977-tf1ga-0" returned 1, expected 0
ubuntu.local /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:184:in `handle_command_failures'
ubuntu.local /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:131:in `run_command'
ubuntu.local /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/execute.rb:49:in `action_run'
ubuntu.local /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/script.rb:33:in `action_run'
ubuntu.local /usr/lib/ruby/gems/1.
sam@ubuntu:~$ sudo cat /etc/sudoers
#
# /etc/sudoers
#
# Generated by Chef for ubuntu.local
#
Defaults !lecture,tty_tickets,!fqdn
# User privilege specification