Skip to content

Instantly share code, notes, and snippets.

Brian Bennett bahamat

Block or report user

Report or block bahamat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Setting up with an EdgeRouter

This document covers how to setup, a service that provides iPXE-based installation and live boot of a bunch of operating systems, on a Ubiquiti EdgeRouter.


I've made a few assumptions throughout this document that will probably be different for your setup:

rezan / self_route.vcl
Last active Sep 21, 2019
Self routing Varnish Cache cluster example
View self_route.vcl
# Self routing cluster example
vcl 4.0;
import directors;
backend node1 {
.host = "";
.port = "80";
jperkin /
Last active May 26, 2018
SmartOS PPPoE Router (AAISP, v6, DNS/DHCP)


This documents my setup of a SmartOS server as my PPPoE router, providing DNS/DHCP services to the local network.

Basic setup:

  • DSL modem (VMG1312) in bridge mode handling the DSL connection
  • local network
  • will be the IP address of the router zone
  • e1000g0 is the configured internal 'admin' interface
View bunyan.lua
local logfile = require("logfile")
local P = require("posix")
local cjson = require("cjson")
local cookies = require("http_cookies")
local _M = {
fatal = 60,
error = 50,
warn = 40,
View truss-name.txt
| From: "Roger A. Faulkner" <Roger.Faulkner@Eng>
| Subject: Re: curiosity: truss?
| Date: Wed, 27 Jan 1999 23:34:47 -0800 (PST)
| For your edification, this is the geneaology of the name "truss"
| (taken from some mail dated Sep 26, 1988)
| This was when Ron Gomes and I were jointly developing the first
| /proc for SVR4 at USL.
| -----------------------------------------------------------------
bmhatfield / .profile
Last active Dec 18, 2019
Automatic Git commit signing with GPG on OSX
View .profile
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
bahamat / nginx_log_format_bunyan.conf
Last active Sep 14, 2016
nginx log_format bunyan
View nginx_log_format_bunyan.conf
log_format bunyan '{'
'"name": "nginx/$nginx_version",'
'"hostname": "$hostname",'
'"pid": "$pid",'
'"level": 30,'
'"time": "$time_iso8601",'
'"v": 0,'
'"msg": "access",'
'"remoteAddress": "$remote_addr",'
View gist:284f25bdce07787d2c4a
#!/usr/bin/env perl
use File::Basename;
my $PKGDIR=$WORKDIR . "/chef";
chdir $PKGDIR;
my $file = "pkgmap";
open my $fh, '<', $file or die "Could not open '$file' $!";
bahamas10 /
Last active Jan 4, 2019
Joyent Manta Functions
View ciphers.d
#!/usr/sbin/dtrace -C -s
#pragma D option quiet
#pragma D option strsize=4096
#define PTR__SIZE sizeof(uint64_t)
struct SSL {
uint32_t version;
uint8_t pad[0x12c];
You can’t perform that action at this time.