Skip to content

Instantly share code, notes, and snippets.

Paul Handy paulhandy

Block or report user

Report or block paulhandy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
paulhandy / cleanup-zfs-snapshots
Created Sep 18, 2017
Clean up old zfs snapshots
View cleanup-zfs-snapshots
You may find something like this a little simpler
zfs list -t snapshot -o name | grep ^tank@Auto | tac | tail -n +16 | xargs -n 1 zfs destroy -r
output the list of snapshot (names only) with zfs list -t snaphot -o name
filter to keep only the ones that match tank@Auto with grep ^tank@Auto
reverse the list (previously sorted from oldest to newest) with tac
limit output to the 16th oldest result and following with tail -n +16
paulhandy /
Last active Sep 23, 2017
IOTA Snapshot @ Milestone 216223

Snapshot generated from milestone 216223.

Snapshot signature verification

I signed the snapshot both in the IRI client, checked at runtime, and with my pgp key (found at As before, to verify the signature, you may download the snapshot from:



paulhandy / docker-cleanup
Last active Sep 18, 2017
Clean up old docker instances
View docker-cleanup
docker ps -a | grep Exit | awk '{print $1}' | xargs docker rm
There is a new feature in Docker 1.13.x called Docker container prune: docker container prune This will do what you want and should work on all platforms the same way.
There is also a Docker system prune, which will clean up containers, images, volumes, and networks all in one command.

Snapshot generated from milestone 150354.

You may be downloaded by ipfs hash: QmRwdX9mwYof1qkMbQgphnsh9kr32itmTtohusWYH1menV

Download snapshot as:

wget -O snapshot.json

Download signature as:

paulhandy / nvim-tunnel
Created Mar 19, 2017
neovim tunnel for shared vim sessions
View nvim-tunnel
ssh -o ExitOnForwardFailure=yes -fNL $2:$1 ${@:3}
nvim-qt --server$2
#$ ./nvim-tunnel 6668 6669 user@remote.url
paulhandy / main.c
Created Jan 2, 2017
Prints a random tryte string
View main.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define MYCHAR 'A'
#define TRYTELEN 2673
char *get_random_trytes (int length) {
int i = 0, j;
char *out = malloc(sizeof(char)*length);
View gist:b638d07197bf2bcbd15d8c2fac384dfb
var isValidUri = function(node) {
var getInside = /^udp:\/\/([\[][^\]\.]*[\]]|[^\[\]:]*)[:]{0,1}([0-9]{1,}$|$)/i;
var stripBrackets = /[\[]{0,1}([^\[\]]*)[\]]{0,1}/;
var uriTest = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[

Keybase proof

I hereby claim:

  • I am paulhandy on github.
  • I am paulhandy ( on keybase.
  • I have a public key ASA1CQSJ2PjhyH1QYoStSaaJX6Z5D3ueRh9Bnj3DKRtZ3wo

To claim this, I am signing this object:

View firefox2dwb.js
// purpose: get your firefox bookmarks in a format that dwb will accept. prints to stdout
// usage: node firefox2dwb.js [./bookmarks.json] [ >> $HOME/.config/dwb/default/bookmarks ]
var fs = require('fs');
fs.readFile(process.argv[2], function(err, data){
var bm, ch;
bm = JSON.parse(data);
ch = bm.children[0];
You can’t perform that action at this time.