This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH="$PATH:/var/lib/gems/1.8/bin" | |
*/30 * * * * root puppet agent --no-daemonize --onetime --splay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ex | |
apt-get install ruby rubygems || | |
yum install ruby rubygems || | |
pkgin install ruby rubygems || | |
false | |
gem install facter ${FACTER_VERSION:+"-v$FACTER_VERSION"} | |
gem install puppet ${PUPPET_VERSION:+"-v$PUPPET_VERSION"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION="1.9.2" | |
PATCH="180" | |
DPKG_BUILD_ARCH="$(dpkg --print-architecture)" | |
set -e | |
DESTDIR="$(mktemp -d)" | |
debra create "$DESTDIR" | |
trap "debra destroy \"$DESTDIR\"" EXIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage { "pre": before => Stage["main"] } | |
class python { | |
package { | |
"build-essential": ensure => latest; | |
"python": ensure => "2.6.6-2ubuntu1"; | |
"python-dev": ensure => "2.6.6-2ubuntu1"; | |
"python-setuptools": ensure => "latest"; | |
} | |
exec { "easy_install pip": | |
path => "/usr/local/bin:/usr/bin:/bin", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage { "pre": before => Stage["main"] } | |
class pre { | |
package { | |
"build-essential": ensure => latest; | |
"python": ensure => ""; | |
"python-dev": ensure => ""; | |
"python-setuptools": ensure => ""; | |
} | |
exec { "easy_install pip": | |
path => "/usr/local/bin:/usr/bin:/bin", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage { "pre": before => Stage["main"] } | |
class pre { | |
package { | |
"build-essential": ensure => latest; | |
"ruby": ensure => "4.5"; # Ruby 1.8.7 | |
"ruby-dev": ensure => "4.5"; # Ruby 1.8.7 | |
"rubygems": ensure => "1.3.7-2"; | |
} | |
} | |
class { "pre": stage => "pre" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :remote, "/var/sandboxes/www/home/rcrowley/work/sfruby-2010-09-29" | |
role :www, "rcrowley.org" | |
task :static do | |
system "showoff static" | |
end | |
task :deploy do | |
static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$0 = "master" | |
ARGV << "--rack" | |
ARGV << "--certname=#{File.read("/etc/puppet/certname").chomp}" | |
require 'puppet/application/master' | |
require 'base64' | |
require 'json' | |
require 'rack/utils' | |
require 'yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Syslogger | |
def initialize | |
read, @write = IO.pipe | |
fork do | |
@write.close | |
$stdin.reopen read | |
exec *%w(logger -trails) | |
end | |
read.close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# acts_as_versioned in Rails 3 | |
# Not too hard, but now you don't have to read the code. | |
class Thing < ActiveRecord::Base | |
acts_as_versioned :table_name => :thing_versions | |
def changed?(name=nil) | |
name && changed_attributes[name.to_s] || !changed_attributes.empty? | |
end | |
def clear_changed_attributes |