Skip to content

Instantly share code, notes, and snippets.

View danielsdeleo's full-sized avatar

Dan DeLeo danielsdeleo

View GitHub Profile
index 95b48a0..7dd897c 100644
--- a/chef/lib/chef/provider/subversion.rb
+++ b/chef/lib/chef/provider/subversion.rb
@@ -122,7 +122,7 @@ class Chef
# YAML doesn't appreciate input like "svn: '/tmp/deploydir' is not a working copy\n"
return nil
end
- raise "tried to run `#{command}' and got unexpected result #{result.inspect}" unless repo_attrs.kind_of?(Hash)
+ raise "Attempted to parse SVN info but could not. SVN info was:\n#{svn_info}" unless repo_attrs.kind_of?(Hash)
rev = (repo_attrs['Last Changed Rev'] || repo_attrs['Revision']).to_s
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
@danielsdeleo
danielsdeleo / add_env
Created November 12, 2009 21:49 — forked from albertsj1/add_env
this is the error I get.
/srv/chef/cookbooks/system/libraries/add_env_var.rb:1:in `system': wrong number of arguments (ArgumentError)
Module system
def add_env_var(variable, path)
envfile = "/etc/profile.d/99generic.sh"
foundvar = false
arr = IO.readlines( envfile ) if File::exists?( envfile )
# This is how Queue#subscribe will work in the next version of Bunny (v0.5.4).
# It's in the 'experimental' branch now.
#
# In order for subscription to work smoothly you need to use a combination of
# Queue#subscribe, Queue#unsubscribe, Queue#ack and Client#qos prefetch. The
# prefetch will allow a controlled number of messages to be released to a
# consumer, which means that Queue#unsubscribe and other methods can be run
# without errors due to out of sequence messages.
#
# geoip-c-0.5.5.gem is in cookbooks/geoip/files/default
remote_file "/tmp/geoip-c-0.5.5.gem" do
source 'geoip-c-0.5.5.gem'
end
gem_package "/tmp/geoip-c-0.5.5.gem" do
action :install
end
# ec2-run-instances -k <key_name> ami-1515f67c
# Needed to be able to get Java packages later
sudo sed -i 's/universe/multiverse universe/' /etc/apt/sources.list
sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
# Accept the Sun Java license
echo 'sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true' | sudo debconf-set-selections
sudo apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential zlib1g-dev libxml2-dev wget ssl-cert git-core couchdb rabbitmq-server sun-java6-jdk sun-java6-jre
# ec2 ami-1515f67c
sudo sed -i 's/universe/multiverse universe/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert rubygems git-core rake librspec-ruby libxml-ruby thin couchdb zlib1g-dev libxml2-dev
sudo gem sources -a http://gems.opscode.com
sudo gem install cucumber merb-core jeweler uuidtools json libxml-ruby --no-ri --no-rdoc
mkdir ~/src
cd ~/src
git clone git://github.com/opscode/chef.git
git clone git://github.com/opscode/ohai.git
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#
-module(test_helper).
-export([riak_test/1]).
riak_test(Fun) ->
start_riak(),
{ok, Riak} = riak:local_client(),
Ret = (catch Fun(Riak)),
stop_riak(),
case Ret of
class Chef
class Provider
class Package
class Rubygems
Chef::Log.info "Patch rubygems provider"
@@GEM_CACHE = {}
@@GEM_CACHE_TIMESTAMP = nil