Skip to content

Instantly share code, notes, and snippets.

@ianw
ianw / openpgp.md
Created November 10, 2022 06:00
openpgp.md

openpgp4fpr:fe3366210a6d0989c247fd6eb6a6fb8b9615aec8

### Keybase proof
I hereby claim:
* I am ianw on github.
* I am ianw (https://keybase.io/ianw) on keybase.
* I have a public key whose fingerprint is FE33 6621 0A6D 0989 C247 FD6E B6A6 FB8B 9615 AEC8
To claim this, I am signing this object:
@ianw
ianw / test.py
Created November 26, 2015 01:44
show resolver and result for google-analytics
#!/bin/env python
import socket
import time
import subprocess
import re
while True:
# loop around resolving gethostbyname for ga
@ianw
ianw / test.sh
Created January 12, 2015 03:05
bash comma list removal
list=foo,foobar,foobash,foomoo,bar
remove=foo,bar
expect="foobar,foobash,foomoo"
function bad_remove {
local the_list=$1
local remove=$2
for i in ${remove//,/ }; do
the_list=${the_list/$i","}
@ianw
ianw / dash-x.sh
Created December 4, 2014 23:28
revert -x behaviour in diskimage-builder
#!/bin/bash
mkdir /tmp/diff
git show > /tmp/diff/out.diff
pushd /tmp/diff
splitdiff -a -d out.diff
@ianw
ianw / fix-bt.py
Last active August 29, 2015 14:07
backticks for devstack
#
# save as fix-bt.py
#
# ran with
#
# find . \
# -not \( -type d -name .?\* -prune \) \
# -type f \
# -not -name \*~ \
# -not -name \*.md \
@ianw
ianw / gist:541d2b7ad8983acbf225
Created June 18, 2014 01:00
Nodepool allocation example
from nodepool import tests
from nodepool import allocation
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("hpcloud", type=int, help="Capacity of hpcloud")
parser.add_argument("rackspace", type=int, help="Capacity of rackspace")
parser.add_argument("fedora", type=int, help="Fedora nodes to request")
parser.add_argument("ubuntu", type=int, help="Ubuntu nodes to request")