Skip to content

Instantly share code, notes, and snippets.


Mat Schaffer matschaffer

View GitHub Profile
View gist:8927373
> curl -v
* Adding handle: conn: 0x7fcf6b80aa00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fcf6b80aa00) send_pipe: 1, recv_pipe: 0
* About to connect() to port 80 (#0)
* Trying
* Connected to ( port 80 (#0)
> GET / HTTP/1.1
View gist:79c8f59b352e4b382f23
root@vagrant:~# hhvm hello.hh
Fatal error: /root/hello.hh appears to be a Hack file, but you do not appear to be running the Hack typechecker. See the documentation at for information on getting it running. You can also set Hack.Lang.LookForTypechecker=0 to disable this check (not recommended).
root@vagrant:~# mv hello.hh hello.^C
root@vagrant:~# vi ..hhconfig^C
root@vagrant:~# vi .hhconfig
root@vagrant:~# touch .hhconfig
root@vagrant:~# hh_client
Server launched for /root
Spawned hh_server (child pid=22984)
matschaffer /
Created Jan 10, 2015
bluegreen experiment
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "us-east-1"
resource "aws_elb" "experiments-main" {
name = "experiments-main"
availability_zones = ["us-east-1c", "us-east-1d"]
View gist:5f8fd1680646a41045af
### Keybase proof
I hereby claim:
* I am matschaffer on github.
* I am matschaffer ( on keybase.
* I have a public key whose fingerprint is 0F41 2290 38C3 B9C3 9C6E 0F1E 71EA CD00 4C06 389F
To claim this, I am signing this object:
matschaffer / metrics.json
Created Mar 3, 2015
JSON body that causes trouble for heka's httpinput
View metrics.json
#!/usr/bin/env bash
# Usage: sub tunnels [start|stop|restart|status|edit]
# Summary: Manage shared and user-specified SSH tunnels into your infrastructure
# Help: Manage shared and user-specified SSH tunnels into your infrastructure.
# Expects ssh to be configured for proxying. Run `sub check` to check your
# environment.
# This will attempt to use autossh if it's available.
View core.toml
base_dir = "/tmp"
type = "HttpInput"
url = "http://localhost:8000/metrics"
ticker_interval = 1
type = "SandboxFilter"
matschaffer / recover.rb
Created Apr 22, 2015
a recovery script for grabbing remaining previews for lost iPhoto/Photos Masters
View recover.rb
require 'pathname'
require 'uri'
require 'fileutils'
# Expects a dir arg of exported photos and a .log which contains /var/log/system.log Photo messages generated during the export
dir =[0])
log = + '.log')
recovered_dir = dir + 'recovered'
View gist:71fb91e6390d3928d8e2
maxprocs = 2
type = "StatsdInput"
stat_accum_name = "stat_accumulator"
address = ":8125"
type = "StatAccumInput"
set -e
NAME="$(echo "${IMAGE}" | awk -F: '{print $1}' | awk -F/ '{print $NF}')"