Skip to content

Instantly share code, notes, and snippets.

@barn
barn / gist:11022a826e1e7cca291a
Created August 11, 2014 20:31
gogo and how bad this flight is.
--- 8.8.8.8 ping statistics ---
1601 packets transmitted, 809 packets received, 49.5% packet loss
round-trip min/avg/max/stddev = -17960.609/5519.345/56449.221/7589.958 ms
@barn
barn / nmap-rspec-fail.rb
Last active August 29, 2015 14:03 — forked from garethr/nmap-rspec.rb
Building on @garethr's work on nmap-rspec, this adds being able to do multiple hosts, rather than just a single IP/host. Just specify more of those blocks...
[ben@laptop:nmap-rspec2]% rspec -f d -c nmap-rspec.rb
the scan of the IP ranges
Starting Nmap 6.46 ( http://nmap.org ) at 2014-07-06 23:21 EDT
Nmap scan report for 141.101.117.49
Host is up (0.26s latency).
PORT STATE SERVICE
20/tcp filtered ftp-data
21/tcp filtered ftp
22/tcp filtered ssh
@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