Skip to content

Instantly share code, notes, and snippets.

View nfisher's full-sized avatar
🏠
Working from home

Nathan Fisher nfisher

🏠
Working from home
View GitHub Profile
@nfisher
nfisher / Makefile
Last active July 1, 2016 05:24
Go Project basic Makefile
SHELL := /bin/sh
EXE := pkg
SRC := $(wildcard *.go)
COVER := cover.out
.DEFAULT_GOAL := all
.PHONY: all
all: $(EXE)
@nfisher
nfisher / main.go
Last active August 29, 2015 14:20
Go(ing) to the clouds complete example.
package main
// This command will allow you to provision, delete, describe, or estimate the cost of the specified CloudFormation template.
//
// Once compiled use the -help flag for details.
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
@nfisher
nfisher / reflect_test.go
Last active January 18, 2024 15:53
Golang - Benchmark of new vs reflect.New.
package main_test
import (
"reflect"
"testing"
)
type fluff struct {
Name string
}
@nfisher
nfisher / Performance Analysis.ipynb.json
Created May 8, 2014 00:05
Jmeter Performance Analysis
{
"metadata": {
"name": "Performance Analysis"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@nfisher
nfisher / lookup.py
Created September 13, 2013 18:52
Look-up request IP's and categorise into a distribution by country using MaxMind DB.
#!/usr/bin/env python
# Usage:
#
# ip_locations.py LOCATIONS BLOCKS RESERVOIR
#
# Dependencies:
#
# - reservoir sample set with 'ips' column.
# - MaxMind IP and Location CSV.
@nfisher
nfisher / network.json
Last active December 20, 2015 20:49
Early draft of network structure interchange format.
{
"version": "1.0",
"networks": {
"ldn-dmz-prod": {"ip": "172.168.3.0", "mask": "/24"},
"ldn-dmz-priv": {"ip": "192.168.3.0", "mask": "/24"},
},
"services": {
"http": {"tcp_ports": 80},
"https": {"tcp_ports": 443},
import java.net.NetworkInterface;
import java.util.Enumeration;
public class NetIf {
public static void main(String [] args) {
try {
Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
while (en.hasMoreElements()) {
NetworkInterface nif = en.nextElement();
Enumeration<NetworkInterface> suben = nif.getSubInterfaces();
@nfisher
nfisher / response-graph.R
Created June 26, 2013 13:45
Simple data loading in R
data = read.csv("~/workspace/responses.csv")
timestamps = data$timestamp
responses = data$response
plot(timestamps,responses, xlab="Time", ylab="Response Time")
@nfisher
nfisher / d3-heatmap.html
Created June 24, 2013 23:13
Simple D3.js SVG heatmap
<!doctype HTML>
<title>D3 Test</title>
<script src="d3.v3.min.js" charset="utf-8"></script>
<style type="text/css">
body {
margin:0 auto;
position:relative;
width:958px;
}
.chart rect {
@nfisher
nfisher / core.clj
Last active December 18, 2015 01:49
pipejine shutdown
(ns pipedream.core
(:gen-class)
(:require [clojure.tools.logging :as log]
[pipejine.core :as pipe]))
(defn pipeline []
(let [q1 (pipe/new-queue {:name "q1"
:queue-size 5
:number-of-consumer-threads 5
:number-of-producers 1})