Skip to content

Instantly share code, notes, and snippets.

View dbgrandi's full-sized avatar

David Grandinetti dbgrandi

View GitHub Profile
@dbgrandi
dbgrandi / netservices_macruby.rb
Created November 9, 2009 11:15 — forked from voodootikigod/netservices_macruby.rb
Using the NSNetServiceBrowser with macruby
delegate = Object.new
def delegate.netServiceBrowserWillSearch(browser)
puts "search commencing!"
end
def delegate.netServiceBrowser(browser, didFindService:service, moreComing:more)
# this never calls regardless of the services on the network.
puts "Found service #{service.name}."
end
#!/usr/bin/env ruby
#
# grab a full copy of all my github code.
#
# assumptions: github.user and github.token are set in git
#
require 'yaml'
user = `git config --get github.username`.strip
#!/usr/bin/env ruby
#
# Throw this into a cron job to notify us when our chef clients
# have gone AWOL.
#
# dave@wegoto12.com
#
require 'rubygems'
require 'chef'
require 'ruby-units'
@dbgrandi
dbgrandi / httpdump
Created April 4, 2009 01:27 — forked from peterc/httpdump
#
# Forked from http://gist.github.com/90062
#
# Drop this into ~/.bash_profile:
# Usage: httpdump <interface>
# Example: httpdump en0
#
function httpdump() { sudo tcpdump -i $1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*|POST \/.*";}
# All the above tested only on OS X.