Skip to content

Instantly share code, notes, and snippets.

View fnichol's full-sized avatar

Fletcher Nichol fnichol

View GitHub Profile
@johnie
johnie / README.md
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
fnichol / dev-setup-minimal.sh
Created April 8, 2017 16:50
Minimal Development Setup
#!/bin/sh
# shellcheck disable=SC2039
set -eu
if [ -n "${DEBUG:-}" ]; then set -x; fi
main() {
init
ensure_root
info "Starting setup"
@jriguera
jriguera / delete-dockerhub-images.sh
Last active May 26, 2022 05:27
Delete Docker images on DockerHub
#!/bin/bash
# Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""

Prerequisites

You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, https://app.habitat.sh 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 https://github.com so that it can authenticate.

Your system also needs to have an FQDN that can be resolved, for example depot.example.com. This will be used in your OAuth application's "Authorization Callback URL." For this example, use http://depot.example.com/#/sign-in. 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
danielsdeleo / apps.md
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: https://github.com/opscode/appbundler/ 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 'http://community.opscode.com/api/v1'
cookbooks = Dir.glob(File.join('site-cookbooks/*/metadata.*')).map{ |file| File.dirname(file) }
cookbooks.each do |cb|
cookbook File.basename(cb), :path => cb
end
@solarce
solarce / debian_stable_docker.sh
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 http://cdimage.debian.org/debian-cd/7.4.0/amd64/bt-cd/
# add wheezy-backports repo, http://backports.debian.org/Instructions/
sudo sh -c "echo deb http://ftp.us.debian.org/debian 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
indirect / tmux-named
Last active December 23, 2015 15:19
tmux configuration
#!/bin/bash
# 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 => [
'puppet:///data/sensu/plugins/ntp.rb',
'puppet:///data/sensu/plugins/postfix.rb'
]
}