Skip to content

Instantly share code, notes, and snippets.

@evandhoffman
evandhoffman / evanhoffman.json
Created April 6, 2014 22:23
Evan's Resume in JSON
{
"name": "Evan D. Hoffman",
"email_addr": "evandhoffman@gmail.com",
"summary": "I like building awesome things, usually involving computers.",
"professional_experience": [
{
"start_date": "2014-01",
"end_date": null,
"organization": "Bonobos, Inc.",
"location": "New York, NY",
logLevel = "DEBUG"
traefiklogsfile = "traefik.log"
accesslogsfile = "access.log"
defaultEntryPoints = ["http"]
[web]
address = ":8088"
[entryPoints]
[entryPoints.http]
@evandhoffman
evandhoffman / imac.json
Created March 16, 2016 15:42
imac.json
{
"fio version" : "fio-2.2.10",
"timestamp" : 1458066508,
"time" : "Tue Mar 15 14:28:28 2016",
"jobs" : [
{
"jobname" : "imac",
"groupid" : 0,
"error" : 0,
"eta" : 0,
@evandhoffman
evandhoffman / 000_cache.conf
Last active March 11, 2016 17:10
nginx cache config
proxy_cache_path /var/lib/nginx/cache/staticfiles levels=1:2 keys_zone=staticfilecache:10m max_size=50m;
proxy_cache_path /var/lib/nginx/cache/php levels=2:2 keys_zone=php:10m inactive=20m max_size=50m;
proxy_temp_path /var/lib/nginx/proxy;
proxy_connect_timeout 30;
proxy_read_timeout 120;
proxy_send_timeout 120;
#IMPORTANT - this sets the basic cache key that's used in the static file cache.
proxy_cache_key "$scheme://$host$request_uri";
@evandhoffman
evandhoffman / clone-vms.ps1
Created November 15, 2013 18:40
Powershell script to clone VMs
$template = "qa3-template"
$datastore = "NAS1"
$vmNamePrefix = "qa3-filler"
$vmhost = Get-VMHost -Name "prod-vm202.prod.host.com"
$vmpool = "QA3 RP"
$location = "Junk Boxes"
$taskTab = @{}
# Create all the VMs specified in $newVmList
for ($i = 2; $i -lt 10; $i++) {
$vmname = $($vmNamePrefix + $i);
@evandhoffman
evandhoffman / gist:5223860
Created March 22, 2013 19:04
xlog min recovery request is past current point
2013-03-22 14:56:52 EDT 17889 0 1/1 WARNING: xlog min recovery request D6D/2A61C1B0 is past current point D63/2BF6C10
2013-03-22 14:56:52 EDT 17889 0 1/1 CONTEXT: writing block 6 of relation base/16898/5389031_vm
xlog redo vacuum: rel 1663/16898/7237776; blk 103357, lastBlockVacuumed 30068
2013-03-22 14:56:52 EDT 17889 0 1/1 WARNING: xlog min recovery request D68/248B82D8 is past current point D63/2BF6C10
2013-03-22 14:56:52 EDT 17889 0 1/1 CONTEXT: writing block 0 of relation base/16898/4876829_vm
xlog redo vacuum: rel 1663/16898/7237776; blk 103357, lastBlockVacuumed 30068
2013-03-22 14:56:53 EDT 17895 0 WARNING: xlog min recovery request D67/2AAE9D40 is past current point D63/2BF6C10
2013-03-22 14:56:53 EDT 17895 0 CONTEXT: writing block 0 of relation base/16898/5484157_vm
2013-03-22 14:56:55 EDT 17895 0 WARNING: xlog min recovery request D6D/33FC44E0 is past current point D63/2BF6C10
2013-03-22 14:56:55 EDT 17895 0 CONTEXT: writing block 5 of relation base/16898
@evandhoffman
evandhoffman / gist:4757843
Created February 11, 2013 21:37
Packages installed during ubuntu 12.10 Quetzal net install (from squid log).
http://changelogs.ubuntu.com/meta-release
httplib2_0.7.4-2_all.deb
https_0.9.7.5ubuntu5.2_amd64.deb
http://security.ubuntu.com/ubuntu/dists/quantal-security/InRelease
http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-amd64/Packages.bz2
http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-i386/Packages.bz2
http://security.ubuntu.com/ubuntu/dists/quantal-security/main/debian-installer/binary-amd64/Packages.gz
http://security.ubuntu.com/ubuntu/dists/quantal-security/main/i18n/Translation-en.bz2
http://security.ubuntu.com/ubuntu/dists/quantal-security/main/i18n/Translation-en_US
http://security.ubuntu.com/ubuntu/dists/quantal-security/main/i18n/Translation-en_US.bz2
@evandhoffman
evandhoffman / fizzbuzz.pl
Created January 10, 2013 16:22
This is a challenge?
#!/usr/bin/perl
for (my $i = 1; $i <= 100 ; $i++) {
my $out = '';
if (($i % 3) == 0) {
$out .= 'Fizz';
}
if (($i % 5) == 0) {
$out .= 'Buzz';
}
@evandhoffman
evandhoffman / zbx_devices.py
Last active October 16, 2015 17:39
Python script that emits disks and mdadm raid devices in a form usable by Zabbix low-level discovery
#!/usr/bin/python
import json
import subprocess
blockdev_fullpath_macro = "{#BLOCKDEV_FULLPATH}"
blockdev_type_macro = "{#BLOCKDEV_TYPE}"
blockdev_shortname_macro = "{#BLOCKDEV_SHORTNAME}"
@evandhoffman
evandhoffman / fail1.conf
Last active October 8, 2015 21:24
Nginx add_header
# Nginx will fail to start and will throw an error like this:
# Reloading nginx configuration: nginx: [emerg] "add_header" directive is not allowed here in /etc/nginx/sites-enabled/fail1.conf:39
server {
listen 8080 default;
server_name _;
root /var/www/html ;