Skip to content

Instantly share code, notes, and snippets.

View bjeanes's full-sized avatar
🕊️

Bo Jeanes bjeanes

🕊️
View GitHub Profile
There once was a secretive atom
And no one had managed to crack 'im
Somebody figured it out
And what it could bring about
But then there was project Manhattan
### Keybase proof
I hereby claim:
* I am bjeanes on github.
* I am bjeanes (https://keybase.io/bjeanes) on keybase.
* I have a public key whose fingerprint is C726 E9B7 6E41 1A87 6AFE EF7B 98A8 21F7 8D73 53C4
To claim this, I am signing this object:
use std::default::Default;
#[deriving(Show)]
struct Person {
age: u8
}
impl Default for Person {
fn default() -> Person { Person { age: 0 } }
}
@bjeanes
bjeanes / gist:ac0b0a7c6a1b51ef97fe
Created July 24, 2014 03:23
Webpass traceroute
$ traceroute github.com
traceroute to github.com (192.30.252.128), 64 hops max, 52 byte packets
1 router (192.168.11.1) 1.299 ms 1.090 ms 0.960 ms
2 10.0.4.17 (10.0.4.17) 1.835 ms 1.791 ms 1.850 ms
3 10.0.3.177 (10.0.3.177) 1.927 ms 1.764 ms 1.787 ms
4 10.0.23.241 (10.0.23.241) 2.130 ms 2.037 ms 2.232 ms
5 10.0.23.164 (10.0.23.164) 2.572 ms 2.461 ms 3.836 ms
6 * * *
7 * * *
8 * * *
require "lifx" # http://rubydoc.info/github/lifx/lifx-gem/master/frames
def calculate_color(i) # 0 <= i <= 1
h = [40 * 2 * i, 40].min # will be 40 (yellow) at i=1/2 and stay there
s = 1.0 - [(i - 0.5) * 2, 0].max # will be 1 until i=1/2 and then go down to 0
b = i
LIFX::Color.hsbk(h, s, b, LIFX::Color::KELVIN_MIN)
end
duration = 30 * 60 # seconds
@bjeanes
bjeanes / nzbget-quota-checker.sh
Created March 19, 2015 08:33
A scheduler script for NZBGet which pauses the queue if using too much of my allocated monthly quota from Internode. E.g. if 30% through the month but used more than 30% of quota, pause, otherwise unpause.
#!/usr/bin/env sh
##############################################################################
### NZBGET SCHEDULER SCRIPT ###
# Pause queue when using too much of Internode monthly quota.
#
# It will also unpause the queue once we're behind expected usage.
#
# Note: this script requires the `xmllint` binary (e.g.: from xmllib2-utils)
@bjeanes
bjeanes / default.rb
Created August 14, 2008 04:54
wsdl2ruby.rb generated SOAP driver for ABN API
require 'xsd/qname'
# {http://abr.business.gov.au/ABRXMLSearchRPC/}Payload
# request - ExternalRequest
# response - Response
class Payload
attr_accessor :request
attr_accessor :response
def initialize(request = nil, response = nil)
alias profileme="history | awk '{print \$2}' | awk 'BEGIN{FS=\"|\"}{print \$1}' | sort | uniq -c | sort -n | tail -n 20 | sort -nr"
####
bne-developer:~ bjeanes$ profileme
612 git # I think I like git
230 cd
193 dscl
153 ssh
131 mate
@bjeanes
bjeanes / README.markdown
Created September 4, 2008 03:39
A completely up-to-date Cap2 deployment recipe for Media Temple Grid Server + Git

Media Temple Capistrano Deployment Recipe

With GitHub

See comments in the files for explanation. This works flawlessly for me on MediaTemple + Git(Hub).

To use:

On the Server

  1. SSH into your MediaTemple server.
  2. Put your public key into ~/.ssh/authorized_keys2 with mode 0600