Skip to content

Instantly share code, notes, and snippets.

View smartctl.txt
root@lunix:~# smartctl -a /dev/sdc
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-62-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke,
Model Family: HGST Deskstar NAS
Device Model: HGST HDN724040ALE640
Serial Number: PK1334PEKxxxxx
LU WWN Device Id: 5 000cca 250f01657
Firmware Version: MJAOA5E0
evandhoffman / smb.conf
Created Feb 9, 2017
smb.conf with ZFS volumes mapped to Previous Versions
View smb.conf
# other stuff here...
shadow: snapdir = .zfs/snapshot
shadow: sort = desc
shadow: format = snap_%Y-%m-%d-%H%M
comment = Files for all
browseable = yes
evandhoffman /
Last active Mar 10, 2018
Ubuntu Nginx Zoneminder php-fpm config

Zoneminder provides instructions for setting up Zoneminder on Ubuntu, but they assume you're using Apache:

I've moved away from Apache for webserving and wanted to see if there was a way to configure Zoneminder to work using Nginx and php-fpm. After a lot of trial and error I got it working. Include the snippet above in your nginx config to get it working at http:///zoneminder/ .

evandhoffman /
Last active Jun 6, 2017
Collectd collection3 nginx config for Ubuntu 14.04


apt-get install libconfig-general-perl libregexp-common-perl collectd collectd-utils lm-sensors \
libcgi-fast-perl librrds-perl libhtml-parser-perl libjson-perl fcgiwrap nginx

Changing collection3 chart size:

evandhoffman /
Created Nov 10, 2016
Echoservice - service that registers itself with consul and starts a webserver. Useful for playing with Traefik.
import SimpleHTTPServer
import SocketServer
import requests
import json
import getopt, sys
CONSUL_URL = 'http://localhost:8500'
def register_service(name, address, port):
View traefik.toml
logLevel = "DEBUG"
traefiklogsfile = "traefik.log"
accesslogsfile = "access.log"
defaultEntryPoints = ["http"]
address = ":8088"
View 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 /
Last active Oct 16, 2015
Python script that emits disks and mdadm raid devices in a form usable by Zabbix low-level discovery
import json
import subprocess
blockdev_fullpath_macro = "{#BLOCKDEV_FULLPATH}"
blockdev_type_macro = "{#BLOCKDEV_TYPE}"
blockdev_shortname_macro = "{#BLOCKDEV_SHORTNAME}"
evandhoffman / move_movies.rb
Created Apr 30, 2015
Script to consolidate all the .MOV files on my computer into a single directory, organized by YYYY/YYYY-MM/ dir structure.
View move_movies.rb
require 'fileutils'
base_dir = ARGV[0]
target_dir = ARGV[1]
movies = Dir.glob([base_dir, '**','*.mov'].join('/'))
evandhoffman / 000_cache.conf
Last active Mar 11, 2016
nginx cache config
View 000_cache.conf
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";