Skip to content

Instantly share code, notes, and snippets.


Fletcher Nichol fnichol

View GitHub Profile
fnichol /
Created Apr 8, 2017
Minimal Development Setup
# shellcheck disable=SC2039
set -eu
if [ -n "${DEBUG:-}" ]; then set -x; fi
main() {
info "Starting setup"
jriguera /
Last active Aug 27, 2020
Delete Docker images on DockerHub
# Based on kizbitz/ at
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq':
# set username, password, and organization


You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, so it can download the required packages.

You'll need to register an OAuth application for GitHub. You need the client ID and client secret that are created for the application later in this guide. Your system needs to have access to so that it can authenticate.

Your system also needs to have an FQDN that can be resolved, for example This will be used in your OAuth application's "Authorization Callback URL." For this example, use The /#/sign-in is required.

Operating System

View how to screencapture and make animated gifs or

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

danielsdeleo /
Created Jul 31, 2014
How to Run Custom Apps in ChefDK

Firstly, the primary apps in ChefDK use executables generated by appbundler:

  • chef (chef-client/knife/etc.)
  • berks
  • chef-dk (the chef tool)
  • TK

The appbundler code is here: and the README explains what it does and why. You can see the executables that appbundler generates in /opt/chefdk/bin (there are other executables in there, but the executables for the primary apps are the appbundler ones).

The primary apps in ChefDK all live in the "apps" directory, in /opt/chefdk/embedded/apps.

View gist:9772987
#!/usr/bin/env ruby
#^syntax detection
site ''
cookbooks = Dir.glob(File.join('site-cookbooks/*/metadata.*')).map{ |file| File.dirname(file) }
cookbooks.each do |cb|
cookbook File.basename(cb), :path => cb
solarce /
Last active Sep 1, 2016
simple way to get docker 0.8 running on debian stable (with some helps from backports)
# assumes you've done a pretty basic 7.4 install, I used
# add wheezy-backports repo,
sudo sh -c "echo deb wheezy-backports main > /etc/apt/sources.list.d/wheezy-backports.list"
sudo apt-get update -y
sudo apt-get -t wheezy-backports install linux-image-amd64 -y
sudo reboot
indirect / tmux-named
Last active Dec 23, 2015
tmux configuration
View tmux-named
# I alias this script to `mux`:
# $ alias mux=tmux-named
# Then I tell terminal to automatically attach new windows to my session named "main",
# by setting the preference named "Shells open with" to this command:
# /path/to/tmux-named main
# When working on a particular project, I can jump a session for that project
# by running "mux project-name".
View gist:5557777
class { 'sensu':
rabbitmq_password => 'secret',
server => true,
plugins => [
juanje / gist:3797297
Created Sep 28, 2012
Mount apt cache of a Vagrant box in the host to spin up the packages installation
View gist:3797297

This is a little trick I use to spin up the packages instalation on Debian/Ubuntu boxes in Vagrant.

I add a simple function that checks if a directory named something similar to ~/.vagrant.d/cache/apt/opscode-ubuntu-12.04/partial (it may have another path in Windows or MacOS) and create the directory if it doesn't already exist.

def local_cache(basebox_name)
  cache_dir ='cache', 'apt', basebox_name)
  partial_dir = cache_dir.join('partial')
  partial_dir.mkdir unless partial_dir.exist?
You can’t perform that action at this time.