Skip to content

Instantly share code, notes, and snippets.

View thraxil's full-sized avatar

Anders Pearson thraxil

View GitHub Profile
@thraxil
thraxil / gist:6067558
Last active December 20, 2015 03:59
hekad config to echo input file to output file
[LogfileInput]
logfile = "/tmp/input"
seekjournal = "/tmp/hekaseekjournal"
[FileOutput]
message_matcher = "Type =~ /.*/"
path = "/tmp/output"
@thraxil
thraxil / gist:7282027
Last active December 27, 2015 06:29
erlang-A
erlangA(Lambda, H) ->
Lambda * H.
@thraxil
thraxil / gist:7282047
Last active December 27, 2015 06:29
Erlang-B
erlangB(_, 0) ->
1;
erlangB(E, M) ->
N = E * erlangB(E, M - 1),
N / (N + M).
@thraxil
thraxil / gist:7282064
Last active December 27, 2015 06:29
Erlang-C
erlangC(_, 0) ->
1;
erlangC(E, M) ->
B = erlangB(E, M),
(M * B) / (M - (E * (1 - B))).
@thraxil
thraxil / agner.erl
Last active December 27, 2015 06:29
-module(agner).
-export([erlangA/2, erlangB/2, erlangC/2]).
erlangA(Lambda, H) ->
Lambda * H.
erlangB(_, 0) ->
1;
erlangB(E, M) ->
N = E * erlangB(E, M - 1),

The CTL Surveillance State

(for servers and applications)

Metrics and Monitoring at CTL

Once upon a time, we had a couple Dell servers living in the Mezzanine. All of our applications just ran on them.

We had a wiki page to keep track of which applications were running on which server, etc. the "Master Server Grid":

{
browser -> mediathread [label = "GET /explore/redirect?..."];
browser <-- mediathread [label = "302 Location: http://wardenclyffe/mediathread/?..."];
browser -> wardenclyffe [label = "GET /mediathread/?nonce=..uni=.."];
wardenclyffe => wardenclyffe [label = "check credentials"];
wardenclyffe -> postgresql [label = "get/create user/session"];
wardenclyffe <-- postgresql [label = "user/session"];
browser <-- wardenclyffe [label = "upload form"];
browser -> wardenclyffe [label = "POST /mediathread w/ video file"] {
void ofApp::draw(){
ofSetColor(ofColor::white);
ofNoFill();
const int size = 20;
const int qs[7] = {0, 1, -1, 0, 1, -1, 0};
const int rs[7] = {-1, -1, 0, 0, 0, 1, 1};
for (int i = 0; i < 7; i++) {
int q = qs[i];
@thraxil
thraxil / yearly.go
Created January 2, 2018 16:37
yearly music link script
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"github.com/thraxil/bcscrape"

Keybase proof

I hereby claim:

  • I am thraxil on github.
  • I am thraxil (https://keybase.io/thraxil) on keybase.
  • I have a public key ASDrIp2mKRBpb-cdXfc2ndFlG_wewh1wKr-f5yLI59aNuwo

To claim this, I am signing this object: