Skip to content

Instantly share code, notes, and snippets.

View jeffmccune's full-sized avatar

Jeff McCune jeffmccune

View GitHub Profile
@jeffmccune
jeffmccune / irc_notify_loop.rb
Created November 20, 2010 20:25
IRC Boxcar + Jabber notification
#!/usr/bin/env ruby
#
# This script reads lines from STDIN and sends a notification for each line.
# It's intended to be used with the fnotify.pl IRSSI script to write notices
# and hilights to a plain text file. tail -f links the two systems together.
require 'rubygems'
# For Jabber Notification
gem 'xmpp4r-simple'
@jeffmccune
jeffmccune / puppet_master_seed_prod_8140.conf
Created January 21, 2011 17:17
Puppet Master Front End Load Balancer configuration
## Apache Load Balancer Front End ##
# Puppet Apache::Config[010_frontend_puppet_prod.conf]
# This file managed by Puppet from a template.
# source: puppet_frontend_XXXX.conf
# All CA requests should be directed to specific workers
<Proxy balancer://puppet_prod_ca>
# Only one member
BalancerMember http://puppetca.puppetlabs.vm:18140
@jeffmccune
jeffmccune / puppet.vim
Created February 23, 2011 02:47
In your Vim RC
" ~/.vim/ftplugin/puppet.vim
"
" Requires Align VIM plugin:
" http://mysite.verizon.net/astronaut/vim/align.html
" With a visual block selected, align =>'s
vmap . :Align =><CR>
" Function to save cursor position, select the block, and align =>'s
function! AlignFats()
@jeffmccune
jeffmccune / git_aliases
Created March 25, 2011 21:07
Git Aliases I have in ~/.gitconfig
alias.st=status
alias.ci=commit
alias.co=checkout
alias.lg=log --pretty=format:'%C(yellow)%h%C(reset) %s %C(cyan)%cr%C(reset) %C(blue)%an%C(reset) %C(green)%d%C(reset)' --graph --date-order
alias.fpull=pull --ff --ff-only
alias.fmerge=merge --ff --ff-only
alias.review=log --stat=160,180 -p -w --patience --reverse -M -C -C -c
@jeffmccune
jeffmccune / gist:918074
Created April 13, 2011 18:30
Getting my bearings in the node terminus
517 ~ % rdebug puppet -- --node_terminus=exec_with_fact -e 'notice("Hi")'
(rdb:1) catch NotImplementedError
Catch exception NotImplementedError.
(rdb:1) continue
Catchpoint at /Users/jeff/src/faces/external_nodes_with_fact/lib/puppet/indirector/node/exec_with_fact.rb:10: `We should translate certname to a fact value.' (NotImplementedError)
from /Users/jeff/src/puppet/lib/puppet/application.rb:304:in `run'
from /Users/jeff/src/puppet/lib/puppet/application.rb:410:in `exit_on_fail'
from /Users/jeff/src/puppet/lib/puppet/application.rb:304:in `run'
from /Users/jeff/src/puppet/lib/puppet/util/command_line.rb:59:in `execute'
from /Users/jeff/src/puppet/bin/puppet:4
@jeffmccune
jeffmccune / gist:918076
Created April 13, 2011 18:30
Getting my bearings in the node terminus
517 ~ % rdebug puppet -- --node_terminus=exec_with_fact -e 'notice("Hi")'
(rdb:1) catch NotImplementedError
Catch exception NotImplementedError.
(rdb:1) continue
Catchpoint at /Users/jeff/src/faces/external_nodes_with_fact/lib/puppet/indirector/node/exec_with_fact.rb:10: `We should translate certname to a fact value.' (NotImplementedError)
from /Users/jeff/src/puppet/lib/puppet/application.rb:304:in `run'
from /Users/jeff/src/puppet/lib/puppet/application.rb:410:in `exit_on_fail'
from /Users/jeff/src/puppet/lib/puppet/application.rb:304:in `run'
from /Users/jeff/src/puppet/lib/puppet/util/command_line.rb:59:in `execute'
from /Users/jeff/src/puppet/bin/puppet:4
% puppet catalog_yaml
Unable to find application 'catalog_yaml'.
% puppet faces
status:
Terminuses: local, rest
Actions: destroy, find, info, save, search
facts:
Terminuses: active_record, couch, facter, inventory_active_record, memory, rest, yaml
Actions: destroy, find, info, save, search, upload
require 'puppet/face'
Puppet::Face.define(:catalog, '0.0.1') do
action :compareyaml do
summary "This action takes a list of node identifier names as a flat text
file, then loads a catalog in directory A and directory B exactly matching the
name. It them compares the catalogs. This is intended to compare catalogs
generated on older versions of a Puppet Master with catalogs generated on a
newer version of Puppet Master."
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
# Example:
#
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {
@jeffmccune
jeffmccune / gist:942021
Created April 26, 2011 09:15 — forked from lak/gist:941981
Using VIM to create html renderings of code
# vim: syntax=ruby
require 'bluecloth'
require 'erb'
outputs = []
FileList['examples/*'].each do |input|
output = File.join("output", File.basename(input)).sub(/\.\w+/, ".html")
outputs << output