Skip to content

Instantly share code, notes, and snippets.


Steven Merrill smerrill

View GitHub Profile
View auto-cornify.js
// add event helper
function addEvent( obj, type, fn ) {
if ( obj.addEventListener ) {
obj.addEventListener( type, fn, false );
} else if ( obj.attachEvent ) {
obj.attachEvent( "on" + type, fn );
function cornifyThisGuy() {

This uses two containers - one running apt-cacher-ng, and one running rawdns. In fact, this gist is mostly based on the apt-cacher-ng hack documented the rawdns repo.

This includes a few quirks for OS X, which I'll make note of.

  1. Edit ('create') /etc/rawdns.json to look like the rawdns.json in this gist.
  2. Run a rawdns container: docker run -d --name rawdns -p 53:53/udp -v /var/run/docker.sock:/var/run/docker.sock -v /private/etc/rawdns.json:/etc/rawdns.json:ro tianon/rawdns rawdns /etc/rawdns.json. Note that this references /private/etc/rawdns.json; this is because on OS X, /etc is symlinked to /private/etc, and you can't mount a symlink.
  3. Update your DNS resolver to use! Assuming OS X, this is in the Network preference pane, behind Advanced -> DNS.
  4. dig dns.docker should now include SERVER:
  5. Ru
smerrill / template.json
Created Oct 26, 2016
Build a Dirty COW-proof Amazon Linux AMI for use with Elastic Beanstalk
View template.json
"builders": [{
"type": "amazon-ebs",
"region": "us-east-1",
"source_ami": "ami-c481fad3",
"instance_type": "t2.micro",
"ssh_username": "ec2-user",
"ssh_timeout": "5m",
"vpc_id": "vpc-99999999",
"subnet_id": "subnet-99999999",
View mix.exs
defmodule Stocks.Mixfile do
use Mix.Project
def project do
[app: :stocks,
version: "0.0.1",
elixir: "~> 1.1",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps]
smerrill / Vagrantfile
Last active Aug 29, 2015
Run Ansible on the Vagrant guest if you're on Windows.
View Vagrantfile
Vagrant.configure(2) do |config| = "centos/7"
# These lines are for testing gatling-rsync-auto on Windows; you can probably comment
# them out and just have ansible-playbook look for /vagrant/playbook.yml.
config.vm.synced_folder "files", "/opt/vagrant/rsynced_folder", type: "rsync"
config.gatling.rsync_on_startup = true
# On Windows, run ansible in the VM.
if RUBY_PLATFORM =~ /mswin|mingw|cygwin/ then
View README.txt
This is GhostScript 9.14.7, rebuilt for EL6.
View logstash.conf
# A sample Logstash configuration to parse logs shipped with rsyslog.
# See also information about
input {
file {
path => "/var/log/rsyslog/*/*.log"
exclude => "*.bz2"
type => syslog
sincedb_path => "/var/run/logstash/sincedb"
sincedb_write_interval => 10

The Test

This test times how long it takes to run puppet apply to install a large amount of monitoring software on a Docker container using the Vagrant 1.6 Docker provisioner. It is a mixed test that measures network speed (downloading large packages and plugins,) disk performance, and CPU performance.


  • 2 GB Instance
  • Fedora 20
  • Fremont datacenter
View -
'use strict';
var OpenShift = require('node-openshift-client');
var util = require('util');
var qs = require('qs');
// Connect to our OpenShift Origin!
smerrill / gist:10544237
Last active Jan 21, 2022
Socket Activation Notes
View gist:10544237
Socket activation:
ListenStream=10646 (IPv6)
ListenStream= (IPv4)
server {