Skip to content

Instantly share code, notes, and snippets.

View joshado's full-sized avatar

Thomas Haggett joshado

View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhsRNe0kO336QiaRfh9/qfHeHeHnmt/9EjSP9mCdZDAtTPvC0hjZ8NwWXtwRvLNZs6Il6hgw+b7QjCsgyN0KosKbZYyXZUDygX81oaAnjumXh9uNEQ6bkq2lRwe/N3kHd/lVgdg5/3wR3z7mrqzwlUp8vUe1EU90vc/+7fkyJ4MTpkQvL8daX/4SDXDPOecngaTyHiKR8RNU5rL6hLLk3NoCFLyvUDQx7lsiyBm6rRYKSPG5zfT/sEaH2eW0dALO88xTwtdOpchqPEA5mSphaw5dDXR7TBVn8xf/mnuyBR2O/xHOP6XfsJyYjbuu9oNNGTJ4sTp6w3/gA6dOOBJ3ev thomas
#!/usr/bin/bash
#
# A lsof replacement for SmartMachine's and a simple
# alternative to pfiles, fuser. For detailed
# information of a process use 'pfiles <pid>'.
# Copyright (c) 2013 Joyent Inc., All rights reserved.
usage() {
cat << EOF
@joshado
joshado / hooks.d
Last active December 26, 2015 04:09
DTrace / ruby method call visualisation. Forgive the hackiness, it was done over coffee :)
#pragma D option quiet
::rb_call0:function-entry {
/* copyinstr(arg0) = Object class
// copyinstr(arg1) = method
// copyinstr(arg2) = file
// arg3 = line
// arg4 ?*/
@joshado
joshado / gist:6926408
Created October 10, 2013 22:07
A 10 minute ruby bit-torrent tracker :)
require 'sinatra'
require "sinatra/reloader"
PEER_DICT = Hash.new { |h,k| h[k] = {} }
class Hash
def bencode
[
"d",
#
# From: Manuel Wolfshant <wolfy@nobugconsulting.ro>
#
install
text
poweroff
url --url http://mirror.centos.org/centos/5/os/x86_64/
lang en_US.UTF-8
keyboard us
skipx
@joshado
joshado / quagga.init.sh
Created July 17, 2012 11:07
Quagga SMF Files
#!/sbin/sh
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# This file is part of Quagga.
#
# Quagga is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
@joshado
joshado / fa-logs
Created March 3, 2012 08:40
Simple log CLI tool
#!/usr/bin/env ruby
require 'rubygems'
require 'tire'
require 'yajl/json_gem'
require 'optparse'
require 'optparse/time'
require 'time'
@joshado
joshado / centos5.ks
Created March 1, 2012 16:50
CentOS 5 kickstart
install
text
reboot
url --url http://mirror.centos.org/centos/5/os/x86_64/
lang en_US.UTF-8
keyboard us
skipx
network --device eth0 --bootproto dhcp
rootpw password
firewall --disabled
@joshado
joshado / client.rb
Created January 9, 2012 01:03
AMQP latency test.
require "amqp"
AMQP_CONFIG = {
host: '<...>',
port: 5671,
username: '<...>',
password: '<...>',
ssl: true
}
/var/log/nginx/access.log {
missingok
notifempty
delaycompress
sharedscripts
postrotate
test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid`
endscript
}