Skip to content

Instantly share code, notes, and snippets.

View fnichol's full-sized avatar

Fletcher Nichol fnichol

View GitHub Profile
johnie /
Last active January 25, 2024 16:23
Filter Phish – This Google Apps Scripts filter will automatically move all future emails with the header `X-PHISHTEST` to trash.

Filter Phish

This Google Apps Scripts filter will automatically move all future emails with the header X-PHISHTEST to trash.

Getting started

  1. Go to Google Apps Script
  2. Add a new script and copy paste the content from the sibling file
  3. Test run the script, go to View in the menu bar and click Logs
  • If there's no errors it should be blank, OR a verbose message that it removed a phishing email.
fnichol /
Created April 8, 2017 16:50
Minimal Development Setup
# shellcheck disable=SC2039
set -eu
if [ -n "${DEBUG:-}" ]; then set -x; fi
main() {
info "Starting setup"
jriguera /
Last active May 26, 2022 05:27
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

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 July 31, 2014 19:37
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.

#!/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 September 1, 2016 08:16
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 December 23, 2015 15:19
tmux configuration
# 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".
class { 'sensu':
rabbitmq_password => 'secret',
server => true,
plugins => [