Skip to content

Instantly share code, notes, and snippets.

View jssjr's full-sized avatar

Scott Sanders jssjr

View GitHub Profile
@jssjr
jssjr / vsnap.zsh
Created April 3, 2013 01:53
Vbox Snapshot looper
#autoload
vsnap() {
trap "exit 1" INT
if [[ $#@ -ne 2 ]] ; then
echo 'usage: vsnap VM_NAME SNAPSHOT_DIR'
return 1
fi
lastsnap="0"
search(:node).map { |n| {fqdn: n['fqdn'], ip: n['ipaddress']} }.each do |i|
Chef::Log.info "Creating: host #{i[:fqdn]}"
djbdns_rr "host #{i[:fqdn]}" do
fqdn i[:fqdn]
cwd "#{node[:djbdns][:tinydns_dir]}/root"
ip i[:ip]
type "host"
action :add
@jssjr
jssjr / flush_dns.sh
Last active February 3, 2016 22:51
case "$(sw_vers -productVersion)" in
10.5.*|10.6.*)
alias flush_dns="sudo dscacheutil -flushcache"
;;
10.8.*|10.7.*)
alias flush_dns="sudo killall -HUP mDNSResponder"
;;
10.9.*)
alias flush_dns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
;;
@jssjr
jssjr / _top_commenters.txt
Last active February 13, 2016 21:14
Hacker News Comment Analysis for GitHub and GitLab of the most popular submissions with at least 20 comments
TOP COMMENTERS (github)
--------------------------------------------------------------------------------
sytse 70 of 16773 ( 0%) ######################################################################
homakov 61 of 16773 ( 0%) #############################################################
DanBC 50 of 16773 ( 0%) ##################################################
facepalm 46 of 16773 ( 0%) ##############################################
malandrew 46 of 16773 ( 0%) ##############################################
nailer 42 of 16773 ( 0%) ##########################################
masklinn 39 of 16773 ( 0%) #######################################
rmc 38 of 16773 ( 0%) ######################################
@jssjr
jssjr / README.md
Created October 25, 2013 18:27
Graphite is great, but unfortunately the web UI itself isn't instrumented. (Yo dawg, I heard you like graphite.) Enable the directives to log render and cache performance, then monitor this with collect's tail plugin so you can visualize graphite performance.

render-performance