Skip to content

Instantly share code, notes, and snippets.

View jbz's full-sized avatar

J.B. Zimmerman jbz

View GitHub Profile
@jbz
jbz / Contract Killer 3.md
Created July 19, 2018 15:20 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

line = '127.0.0.1 gateway.internal gateway'
file = Chef::Util::FileEdit.new('/etc/hosts')
file.insert_line_if_no_match(/#{line}/, line)
file.write_file
@jbz
jbz / chef.rb
Created February 1, 2012 19:25 — forked from coderanger/chef.rb
include_recipe "collectd"
class ChefCollectdPluginReportHandler < Chef::Handler
def report
Chef::Log.info('Running collectd hander')
node[:last_success_time] = Time.now.to_f
node[:error_count_since_success] = 0
node.save
end
end
@jbz
jbz / ebs_raid.rb
Created September 27, 2011 21:31 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
@jbz
jbz / ebs_raid6_provider.rb
Created September 27, 2011 21:31 — forked from fujin/ebs_raid6_provider.rb
aws_ebs_raid6 lwrp
include Chef::Mixin::Command
action :create do
size = new_resource.size
volumes = new_resource.volumes.times.map{|i| (i == 0 ? "/dev/sdf" : "/dev/sdf#{i}") }
setra = new_resource.blockdev_setra
volume_group = new_resource.volume_group
logical_volume = new_resource.name
mdadm_device = new_resource.mdadm_device
mount_point = new_resource.mount_point
domU-12-31-39-13-D8-C1% rsyslogd -v
rsyslogd 5.6.2, compiled with:
FEATURE_REGEXP: Yes
FEATURE_LARGEFILE: No
FEATURE_NETZIP (message compression): Yes
GSSAPI Kerberos 5 support: No
FEATURE_DEBUG (debug build, slow code): No
Atomic operations supported: Yes
Runtime Instrumentation (slow code): No
#!/usr/bin/env ruby
require "rubygems"
require "erb"
require "fileutils"
require "json"
require "net/ssh"
require "net/scp"
require "optparse"
@jbz
jbz / gist:628717
Created October 15, 2010 18:47 — forked from ktheory/gist:628713
gem package hashing
# In attribute file:
my_gem_packages = [
"nokigiri", # Only a gem name, without a version requirement or other options"
["bundler", "=1.0.0"], # A gem with a version requirement
["rails", "~>2.3.9", "--no-ri --no-rdoc --source http://rubygems.org"], # A gem with a version requirement and options"
["json", nil, "--source http://rubygems.org"] # Gem with options but no version requirement
]
# In recipe:
#! /bin/sh
### BEGIN INIT INFO
# Provides: cruisecontrol.rb
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: CruiseControl.rb
# Description: Continuous build integration system. This runs the web interface (via mongrel and the builders).
### END INIT INFO
@jbz
jbz / bootstrap_os_x.sh
Created April 13, 2010 19:01 — forked from petitbon/bootstrap_os_x.sh
Ruby tech stack install script for OS X
cp ~/.profile ~/.profile.bak
echo 'export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"' > ~/.profile
. ~/.profile
echo 'Creating src directory'
mkdir ~/src
cd ~/src
echo 'Installing MySQL'