Skip to content

Instantly share code, notes, and snippets.

@barn
barn / gist:6706060
Last active December 23, 2015 22:49
SPEAKER: Peter Norton / Knewton, Inc.
TITLE: Cloudy with a 3-Headed Dog
ABSTRACT:
Most startups begin their cloud adventures by using shared ssh keys, shared accounts, and
avoid thinking about infrastructure until pretty late in the game. At Knewton, we've gone
the other way and implemented Kerberos and LDAP as our authentication and naming services...
in the public AWS cloud. This case study will discuss the factors we considered as we
@barn
barn / ec.sh
Created August 7, 2013 04:06
Simple to ExpenseCloud CSV hacking.
#!/bin/sh
CSVFILE=$1
NAME='Carlos Danger'
if [ -z "$CSVFILE" -o ! -e "${CSVFILE}" ]
then
echo 'Need a real file'
exit 10
fi
@barn
barn / gist:5682307
Last active December 17, 2015 22:29
This is the OSX sysadmin secret sauce.
Secret sauce:
curl https://gist.github.com/barn/5682279/raw/728c2c752e78bc2ed724fd0e66c5c451212e7f9c/gistfile1.txt | sh
@barn
barn / gist:5682279
Last active December 17, 2015 22:29
set +x;L='-';A="\[a${L}z\]";B="\[n${L}za${L}m\]";P='czfrg';S='fyrrcabj';r='t';t='r';$(echo "${P} ${S}"|"${r}${t}" ${A} ${B})
[kali:chef]% ack --bar
?IIIIIII7II?????+
~III777II777I?+==++==+:
???I7I???I7II++=====++===
??+??????????+===~~=+++??==+
??+??II??????+==~=~~=+++++==++
I+?????????+?+====~=~==+==++?==?
?????II?????+++++=======?===~~~~==
,?????II????????++++====~===::~~~~:~
I?I??II?+++??+?+++==~~~~:~:~:,:,,:::~
@barn
barn / foo.rb
Created April 22, 2013 23:10
Why this happen?
#!/usr/bin/env ruby
require 'ap'
class Updates
attr_reader :parsed, :raw
def initialize( )
unless Updates.has_output?
@barn
barn / quicky.rb
Created April 17, 2013 05:55
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.
#!/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
barn / load_me_in_gmail.sh
Created April 9, 2013 13:31
Use this in mutt a like so: macro index <esc>g "<enter-command>unset wait_key<enter>|load_me_in_gmail.sh\n" macro pager <esc>g "<enter-command>unset wait_key<enter>|load_me_in_gmail.sh\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?)
#!/bin/sh
#
# I think this will take STDIN and do magic with it.
open "https://mail.google.com/mail/u/0/#search/rfc822msgid:$( awk 'tolower($0) ~ /^message-id: / {print $2}' | tr -d '[><]')%20in:anywhere" & >/dev/null 2>&1
@barn
barn / modem.applescript
Created February 6, 2013 16:45
Add to Viscocity/Tunnelblick before connect script. MP3 stolen from https://soundcloud.com/kpcc/dial-up-modem
do shell script "/usr/local/bin/mpg123 /Users/ben/Music/modem.mp3"
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);
^