Skip to content

Instantly share code, notes, and snippets.

View kogent's full-sized avatar

Mark Carey kogent

View GitHub Profile
@kogent
kogent / httpdump
Created June 22, 2009 04:18 — forked from peterc/httpdump
# Monitor HTTP requests being made from your machine with a one-liner..
# Replace "en1" below with your network interface's name (usually en0 or en1)
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile:
# (again replace "en1" with correct network interface name)
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*""
# All the above tested only on OS X.
# Simple example of using ShadowFacter with RSpec to verify system configuration
# http://twitter.com/bradleyktaylor | http://railsmachine.com
#
# run with 'spec -c installed_test.rb'
require 'shadow_facter'
def installed_fact(n)
name = n
fact(name) { exec("#{name.to_s} --version") ? true : false }
@kogent
kogent / .autotest
Created December 3, 2008 18:58 — forked from nicksieger/.autotest
# -*- ruby -*-
module AutoGrowl
def self.pt(msg)
msg.gsub %r{\\e\[[0-9]+m?}, ''
end
def self.growl(title, msg, pri = 0)
system "/usr/local/bin/growlnotify -n autotest --image /Applications/Mail.app/Contents/Resources/Caution.tiff -p #{pri} -m #{pt msg.inspect} #{pt title.inspect}" unless RUBY_PLATFORM =~ /java/
end