Skip to content

Instantly share code, notes, and snippets.

View aheadley's full-sized avatar

Alex Headley aheadley

View GitHub Profile
@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,
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 / 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) {
@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 / 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 / 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 / Dockerfile.game
Last active November 20, 2017 21:54
Docker container of a headless Linux Starcraft2 instance for bot development
FROM frolvlad/alpine-glibc
ARG GAME_VERSION=3.17
ENV GAME_VERSION ${GAME_VERSION:-3.17}
ARG GAME_PORT=12000
ENV GAME_PORT ${GAME_PORT:-12000}
ARG GAME_DATA_VERSION=56787
ENV GAME_DATA_VERSION ${GAME_DATA_VERSION:-56787}
@aheadley
aheadley / run.py
Last active November 22, 2017 21:24
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
from sc2.ids.unit_typeid import UnitTypeId
from sc2.tmpfix import creation_ability_from_unit_id
from sc2.ids.ability_id import AbilityId
$ gcc-ar -h
Usage: /usr/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
/usr/bin/ar -M [<mri-script]
commands:
d - delete file(s) from the archive
m[ab] - move file(s) in the archive
p - print file(s) found in the archive
q[f] - quick append file(s) to the archive
r[ab][f][u] - replace existing or insert new file(s) into the archive
s - act as ranlib