Skip to content

Instantly share code, notes, and snippets.

David Wooldridge z0mbix

Block or report user

Report or block z0mbix

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
  • Run vim without loading ~/.vimrc: vim -u NONE
  • Add quotes around a select word (Requires vim-surround): S"
  • Select entire word no matter where the cursor is: viw
  • Select entire word including trailing space no matter where the cursor is: vaw
  • Enclose entire line in quotes (Needs vim-surround plugin): yss”
  • Comment out paragraph (Requires vim-commentary): gcap
  • Delete quotes around a string: ds"
  • Convert buffers to tabs: :tab ball
  • Close buffer: :bd
  • Uppercase selection: gU
z0mbix /
Created Jul 7, 2015
Get an Ec2 instance's role from a tag
#!/usr/bin/env bash
instance_id=$(curl -sf ${meta_url}/instance-id)
role=$(aws ec2 describe-tags --filters \
"Name=resource-type,Values=instance" \
"Name=resource-id,Values=${instance_id}" \
"Name=key,Values=role" \
| jq -r .Tags[].Value)
z0mbix / ec2-get-instance-tags
Created Jul 3, 2015
Bootstrap an EC2 instance with it's role, environment and name
View ec2-get-instance-tags
#!/usr/bin/env bash
instance_id=$(curl -sf ${meta_url}/instance-id)
# Get role
aws ec2 describe-tags --filters \
"Name=resource-type,Values=instance" \
"Name=resource-id,Values=${instance_id}" \
"Name=key,Values=role" \
z0mbix / ssh-ec2
Created Jul 3, 2015
SSH to an EC2 instance by name
View ssh-ec2
#!/usr/bin/env bash
# SSH to an EC2 instance by name
# You need the AWS cli (pip install awscli)
if [[ -z $1 ]]; then
echo 'You must specify an instance name!'
exit 1
z0mbix / tcpdump-es-capture
Created Dec 19, 2014
Capture Elasticsearch Queries
View tcpdump-es-capture
# tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
14:32:33.525122 IP > Flags [P.], seq 313752908:313753888, ack 2465010394, win 257, options [nop,nop,TS val 2684167067 ecr 2684167066], length 980
..#...#.GET /index/_search HTTP/1.1
Accept: */*
Content-Length: 845
Content-Type: application/x-www-form-urlencoded
View post-deploy-gif
# You need jq and rl
if which rl >/dev/null; then
tags=(pleased approval excited party clapping dance happy)
random_tag=${tags[$RANDOM % ${#tags[@]} ]}
gif=$(curl -s${replygif_api_key}\&tag=${random_tag} | jq .[].file -r | rl -c1)
hipchat_message="(success) -> ${gif}"
z0mbix / os x syncthing plist howto
Created May 29, 2014
Example launchd plist for syncthing
View os x syncthing plist howto
Create the XML plist file ~/Library/LaunchAgents/net.syncthing.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
View gist:10504385
### Keybase proof
I hereby claim:
* I am z0mbix on github.
* I am z0mbix ( on keybase.
* I have a public key whose fingerprint is 310E C49B 374C EE0B 5A53 DB8E FFCE 5C10 5D81 AB88
To claim this, I am signing this object:
z0mbix / gist:8407613
Last active Jan 3, 2016 Rackspace UK cloud configuration failure
View gist:8407613
I have exported SDK_USERNAME, SDK_PASSWORD and SDK_PROVIDER=rackspace-uk
I already use these credentials with other rackspace API tools like pyrax.
$ packer validate staging-web-rackspace.json
Template validated successfully.
$ cat staging-web-rackspace.json
z0mbix / install-etcd-centos-6.5
Created Jan 10, 2014
Problems installing etcd on centos 6.5
View install-etcd-centos-6.5
# cat /etc/redhat-release
CentOS release 6.5 (Final)
golang from EPEL:
# rpm -qi golang
Name : golang Relocations: (not relocatable)
Version : 1.1.2 Vendor: Fedora Project
Release : 4.el6 Build Date: Fri 20 Sep 2013 16:21:49 BST
Install Date: Thu 09 Jan 2014 15:14:13 GMT Build Host:
You can’t perform that action at this time.