Skip to content

Instantly share code, notes, and snippets.

View aheadley's full-sized avatar

Alex Headley aheadley

View GitHub Profile
@aheadley
aheadley / start-telegraf.sh
Created September 21, 2017 17:46
Telegraf on FreeNAS
#!/bin/bash
# full path to the telegraf executable in the jail it was installed in
TELEGRAF_BIN='/mnt/tank0/jails/telegraf-test/usr/local/bin/telegraf'
# dir for storing the pid, config, and log files
BASE_DIR='/mnt/tank0/home/aheadley'
if [ -f $BASE_DIR/telegraf.pid ] && kill -0 $(cat $BASE_DIR/telegraf.pid) &>/dev/null; then
# don't start it again if it's already running
echo "Telegraf running ($(cat $BASE_DIR/telegraf.pid))..."
@aheadley
aheadley / frostweavers-lair.md
Last active September 21, 2017 19:10
DnD Oneshot #1

The Frostweaver's Lair

Synopsis

The adventure starts in port town of Oran, Tiemcenen. The adventurers have a shared dream taking place in The Gift Horse where Valanna Jahliid makes an appearance and the adventurers fight another party of adventurers with the aid of Zarkon but lose while Valanna Jahliid watches. They wake from the dream in jail from their drunken brawl at The Gift Horse the previous night, remembering only bits and pieces of the job they took on from Valanna Jahliid before the brawl started. Adventure start!/What do you want to do?

Major Locations

  • [Country] Empire of Tiemcen: Coloquially known as Tiemcenen. Country the adventure takes place in. Founded approx 1k years ago by Emperor Berber Tiemcen after his army defeated the demon/devil/fiend Orcus (or whatever). Now mostly ruled by a Triumvirate with the current Emperor acting mostly as a figurehead. Most folks have an ambivilent opinion of the government, it could do more but it's not terrible. Tiemcenen is an island roughl
@aheadley
aheadley / telegraf.conf
Created May 2, 2017 18:38
Example Telegraf config for FreeNAS 9.10
[global_tags]
role = "freenas"
#
# OUTPUTS:
#
[[outputs.influxdb]]
# insert influxdb config here
#
@aheadley
aheadley / fuck-you.c
Last active February 9, 2018 20:38
A snippet of code from cava found while making my keyboard light up for https://www.youtube.com/watch?v=Z12w1AvWehE
if(f[i] > flastd[i]){//higher then last one
if (tty) for (n = flastd[i] / 8; n < f[i] / 8; n++) for (q = 0; q < bw; q++) mvprintw((h - n), i*bw + q + i*bs + rest, "%d",8);
else for (n = flastd[i] / 8; n < f[i] / 8; n++) for (q = 0; q < bw; q++) mvaddwstr((h - n), i*bw + q + i*bs + rest, bh[7]);
if (f[i] % 8 != 0) {
if (tty) for (q = 0; q < bw; q++) mvprintw( (h - n), i*bw + q + i*bs + rest, "%d",(f[i] % 8) );
else for (q = 0; q < bw; q++) mvaddwstr( (h - n), i*bw + q + i*bs + rest, bh[(f[i] % 8) - 1]);
}
}else if(f[i] < flastd[i]){//lower then last one
for (n = f[i] / 8; n < flastd[i]/8 + 1; n++) for (q = 0; q < bw; q++) mvaddstr( (h - n), i*bw + q + i*bs + rest, " ");
if (f[i] % 8 != 0) {
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
Subject,Start Date,Start Time,End Date,End Time,All Day Event,Description
"Pre-Show","01/08/2017","11:30 AM","01/08/2017","12:00 PM","False","Any% - SpikeVegeta, feasel, Golden, Blechy, Darkman78"
"Ape Escape 2","01/08/2017","12:00 PM","01/08/2017","01:10 PM","False","Any% - iongravirei"
"The Legend of Zelda: Ocarina of Time 3D","01/08/2017","01:10 PM","01/08/2017","03:20 PM","False","All Dungeons - benstephens56"
"Borderlands 2","01/08/2017","03:20 PM","01/08/2017","05:30 PM","False","2 Player Co-op - Shockwve, Amyrlinn"
"Psychonauts","01/08/2017","05:30 PM","01/08/2017","06:37 PM","False","Any% - demoli"
"Shovel Knight","01/08/2017","06:37 PM","01/08/2017","07:39 PM","False","Any% - Smaugy, MunchaKoopas"
"Mega Man","01/08/2017","07:39 PM","01/08/2017","08:14 PM","False","All Stages - WhiteHat94, Endy, dxtr, coolkid"
"Super Mario Kart","01/08/2017","08:14 PM","01/08/2017","08:56 PM","False","Time Trial Race - KVD, Sami Cetin"
"Quake","01/08/2017","08:56 PM","01/08/2017","09:26 PM","False","Any% Easy - coolki
@aheadley
aheadley / influx-internal-dashboard.json
Created December 16, 2016 18:02
Grafana dashboard for influx internal performance metrics
{
"id": 3,
"title": "influx",
"originalTitle": "influx",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": true,
"sharedCrosshair": false,
@aheadley
aheadley / ideas.md
Last active December 13, 2016 23:51
#overviewer VR gam jam ideas

King of the Mountain

For 2-4 players

One player is the "king" and gets a god-like view floating above the map with a mountain (or castle?) in the center and the other players play in first person view and try to scale the mountain to get the treasure or save the princess or whatever. The king can set traps or spawn monsters, maybe has vision of the world or maybe just players obscured by fog of war. Players have multiple characters to select that each have special powers? Somewhat similar to Panoptic, but with less direct interference from the king. The King should have a separate goal from just stopping the other players, maybe needs to retrieve some things from the map and bring

@aheadley
aheadley / duplicate-header-nocheck.patch
Created December 6, 2016 20:51
Patch for mod_fastcgi 2.4.6 to not barf on duplicate response headers.
--- mod_fastcgi.c.orig 2012-05-18 17:37:08.831652311 -0400
+++ mod_fastcgi.c 2012-05-18 17:42:49.333693792 -0400
@@ -718,9 +718,6 @@
if (strcasecmp(name, "Status") == 0) {
int statusValue = strtol(value, NULL, 10);
- if (hasStatus) {
- goto DuplicateNotAllowed;
- }
if (statusValue < 0) {
_pc ()
{
local LOAD=$(cut -f1 -d' ' < /proc/loadavg);
local iLOAD=${LOAD%%.*};
if [ $iLOAD -lt $(($PROCS * 2)) ]; then
local TWIDTH=$(tput cols);
local PADDING='=';
local TIMESTAMP="$(date '+%Y-%m-%dT%H:%M:%S%z')";
local MEAT="[${TIMESTAMP}|${USER}@${HOSTNAME}(${PROCS}@${LOAD})";
if [ $TWIDTH -ge 80 ]; then