Skip to content

Instantly share code, notes, and snippets.

View mikehale's full-sized avatar

Michael Hale mikehale

  • Heroku
  • Holly Springs, NC
View GitHub Profile
echo '{
"handlers": ["debug"],
"name": "push_woot_test",
"output": "woot!",
"status": 1
}' | nc -w1 127.0.0.1 3030
@mikehale
mikehale / a-screenshot.md
Created July 1, 2011 20:57 — forked from akahn/a-screenshot.md
Embed gravatars in Propane chat

@mikehale
mikehale / cert.rb
Created May 10, 2011 18:51 — forked from ricardochimal/cert.rb
generating ssl certs with subjectAltName domains
domain = "*.example.com"
subjectAltDomains = [ domain, "example.com" ]
require 'openssl'
puts "Generating public and private keys..."
key = OpenSSL::PKey::RSA.new(2048)
subject = "/C=US/ST=California/L=Los Angeles/O=Example Inc./CN=#{domain}"
cert = OpenSSL::X509::Certificate.new
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
# Compare the run list of two chef nodes.
% diff <(knife node show bourbon -r) <(knife node show barkeep.int.housepub.org -r)
3,4c3,8
< "recipe[workstation]",
< "recipe[users]"
---
> "role[base]",
> "role[production]",
> "role[dnsserver]",
@mikehale
mikehale / config.ru
Created September 13, 2010 20:20 — forked from jtimberman/config.ru
require 'rubygems'
require 'merb-core'
require 'chef'
Chef::Config.from_file(File.join("/etc", "chef", "server.rb"))
Merb::Config.setup(:merb_root => File.expand_path(File.dirname(__FILE__)),
:environment => ENV['RACK_ENV'],
:fork_for_class_load => false,
:init_file => File.dirname(__FILE__) / "config/init.rb")
class Chef
module Mixin
module Language
# esearch(:node, 'role\[admin\]')
# recursively search for this role/recipe in all roles
def esearch(context, search)
if context == :role
ret = []
# First solve all roles:
roles = search(:role, search)
#!/bin/sh
# Demo how your can merge opscode chef-repo & cookbooks
# and perm. keep up to date with opscode cookbooks (the last "git" cmd)
% git clone git://github.com/opscode/chef-repo.git
Initialized empty Git repository in /home/tim/src/chef-repo/.git/
remote: Counting objects: 107, done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 107 (delta 45), reused 0 (delta 0)
Receiving objects: 100% (107/107), 16.14 KiB, done.
Resolving deltas: 100% (45/45), done.
@mikehale
mikehale / default.rb
Created April 8, 2010 19:06 — forked from ezmobius/default.rb
delayed_job recipe
#
# Cookbook Name:: delayed_job
# Recipe:: default
#
if ['solo', 'app', 'app_master'].include?(node[:instance_role])
# be sure to replace "app_name" with the name of your application.
run_for_app("maloca") do |app_name, data|
This is a short collection of resources I have used in packaging Chef for Debian.
Good starting point, links to some of the other pages here:
* http://www.xs4all.nl/~carlo17/howto/debian.html
Debian New Maintainers guide:
* http://www.debian.org/doc/maint-guide/