Skip to content

Instantly share code, notes, and snippets.


Justin Clayton justinclayton

View GitHub Profile
zanedeg / aync.js
Created Jun 1, 2018
NodeJS async comparisons
View aync.js
'use strict';
const promisify = require('util').promisify;
const delay = (interval, cb) => {
console.log(`Waiting ${interval}s`);
setTimeout(() => cb(null, interval), interval);
const delayAsync = promisify(delay);
jokeru /
Created Mar 31, 2018
Script to delete all AWS default VPCs from all regions using AWS CLI
#!/usr/bin/env bash
if [ "$AWS_PROFILE" = "" ]; then
  echo "No AWS_PROFILE set"
  exit 1
for region in $(aws ec2 describe-regions --region eu-west-1 | jq -r .Regions[].RegionName); do
sjparkinson / RDS-Aurora-CloudFormation-Example.yaml
Last active Jun 4, 2021
A basic CloudFormation template for an RDS Aurora cluster.
View RDS-Aurora-CloudFormation-Example.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: >
A basic CloudFormation template for an RDS Aurora cluster.
AllowedPattern: "[a-zA-Z0-9]+"
ConstraintDescription: must be between 1 to 16 alphanumeric characters.
matt-deboer / Bakefile
Last active Sep 2, 2016
Bakefile to create a docker 1.12 swarm on OSX with docker-machine-driver-xhyve support
View Bakefile
set -u
#. creates a new swarm. params name, [driver], [workers], [managers]
create-swarm() {
bake_params name
local driver=${driver:=virtualbox}
local workers=${workers:=2}
local managers=${managers:=1}
stevschmid /
Created Sep 5, 2015
How the Track-o-Bot API works


Access any profile page by providing the username and API key (generated in the settings -> API) , e.g.


Any profile page can be requested as JSON. Simply add .json at the end of the url (but before the query string which starts with ?), see example above.

Use the browser to see the JSON structure. JSONView is an excellent browser extension which shows JSON in a nice way.

View custom.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Alpha Component</key>
<key>Blue Component</key>
View vm-list
#!/usr/bin/env ruby
require 'fileutils'
class VmList
@@cache_file = ENV['vm_list_cache_file'] || '/tmp/vm_list_cache'
@@cache_ttl = ENV['vm_list_cache_ttl'] || 60
def self.get_vm_list
vmware = %x{"/Applications/VMware\" list | grep -v Total}.split("\n")
curator / YAML.tmLanguage
Created Jun 26, 2014
Updated YAML that deals with hiera data a bit better (double colons)
View YAML.tmLanguage
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
lutter /
Created Jun 25, 2014
Hook design document


Hooks provide a way to be notified of certain events during the operation of the Razor server; the behavior of a hook is defined by a hook type.

File layout for a hook type

Similar to brokers and tasks, hook types are defined through a .hook directory and files within that directory:

rothgar / main.yml
Last active May 20, 2021
Generate /etc/hosts with Ansible
View main.yml
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']