Skip to content

Instantly share code, notes, and snippets.

Bea Hughes barn

View GitHub Profile
View gist:5537228
[kali:chef]% ack --bar
barn / foo.rb
Created Apr 22, 2013
Why this happen?
View foo.rb
#!/usr/bin/env ruby
require 'ap'
class Updates
attr_reader :parsed, :raw
def initialize( )
unless Updates.has_output?
barn / quicky.rb
Created Apr 17, 2013
Add this to your muttrc to enable OSX quicklook of files in the attach menu in mutt. That's right, view shit with the spacebar! Requires, I imagine, ruby 1.9.x as your ruby. Not tested on 1.8.7, but presumed not to work.
View quicky.rb
#!/usr/bin/env ruby
# Put something god awful in your muttrc like:
# macro attach <space> "<enter-command>unset wait_key<enter><shell-escape>rm -f $HOME/.quicky<enter><save-entry><kill-line>$HOME/.quicky<enter><shell-escape>quicky.rb $HOME/.quicky<enter><enter-command>set wait_key<enter>" "Open with quicklook"
require 'tmpdir'
if ARGV.empty?
puts "need a filename"
barn /
Created Apr 9, 2013
Use this in mutt a like so: macro index <esc>g "<enter-command>unset wait_key<enter>|\n" macro pager <esc>g "<enter-command>unset wait_key<enter>|\n" and now ESC-g will load a search in your "web browser" pointing at the message you had highlighted. (Can you jump straight to it?)
# I think this will take STDIN and do magic with it.
open "$( awk 'tolower($0) ~ /^message-id: / {print $2}' | tr -d '[><]')%20in:anywhere" & >/dev/null 2>&1
barn / modem.applescript
Created Feb 6, 2013
Add to Viscocity/Tunnelblick before connect script. MP3 stolen from
View modem.applescript
do shell script "/usr/local/bin/mpg123 /Users/ben/Music/modem.mp3"
View gist:b7e0ce4c3354b65aac0a
installing default objspace libraries
compiling ossl_asn1.c
In file included from ossl_asn1.c:11:
In file included from ./ossl.h:213:
./openssl_missing.h:71:6: error: conflicting types for 'HMAC_CTX_copy'
void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
/usr/local/include/openssl/hmac.h:101:5: note: previous declaration is here
int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
View gist:3824295
DNS configuration
resolver #1
search domain[0] : openvpn
nameserver[0] :
reach : Reachable
resolver #2
domain : local
options : mdns
barn / gist:3431489
Created Aug 23, 2012
My pre commit hook now spots some of my common mistakes.
View gist:3431489
[enlil:puppetlabs-modules]% git commit site.pp
Some dumbass tried to use 'requires' in site.pp
site.pp:8: requires => Exec['apt_update']
[enlil:puppetlabs-modules]% echo $?
View gist:3396904
# site/webserverA.pp
node 'webserverA' inherits webserver {
# roles/webserver.pp
node webserver {
View gist:3382576
#!/usr/bin/env ruby
OURCHANNEL = '#plops'
def main( argv )
# Args are: whom channel channel command *args
You can’t perform that action at this time.