Skip to content

Instantly share code, notes, and snippets.

Heinrich Hartmann HeinrichHartmann

Block or report user

Report or block HeinrichHartmann

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

Keybase proof

I hereby claim:

  • I am heinrichhartmann on github.
  • I am hartmann ( on keybase.
  • I have a public key ASADQm4Cys6zXNQQjsHsuEk7xwjRTWF7VSrdUI2kRjrcuQo

To claim this, I am signing this object:

HeinrichHartmann /
Created Jul 26, 2018
Python IRONdb/Snowth Bindings
# This is a Python wrapper for the Snowth/IRONdb API I wrote
# for personal use in 2014. Use at your own risk.
import logging
log = logging.getLogger()
if __name__ == "__main__": log.setLevel(logging.DEBUG)
else: log.setLevel(logging.WARN)
import requests
View Circonus for Data Science.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
HeinrichHartmann / ignite.el
Last active May 2, 2018
emacs functions to simulate ignite talks
View ignite.el
(defun ignite-start ()
"Auto advaince slides"
(set 'ignite-interval 15)
(set 'ignite-t ignite-interval)
(message (format "Go! (%d sec)" ignite-interval))
(run-at-time 0 1 (lambda ()
(if (<= ignite-t 0)
View lua_examples.c
#include <stdio.h>
#include <string.h>
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
// Helper function to print the stack contents
// Values other than numbers and strings are printed as "(null)"
void print_stack(lua_State *L, char* title){
int nargs = lua_gettop(L);
HeinrichHartmann /
Last active Jan 18, 2019
Publish dropbox "files remaining" as statsd metrics
# Example output of ` status`
# ```
# Syncing (51,938 files remaining, 2 mins left)
# Downloading 51,938 files (3,069 KB/sec, 2 mins left)
HeinrichHartmann /
Created Sep 23, 2016
Read data from std in and show in a browser
# Read data from std in and show in a browser.
# E.g. curl | bcat
TMPFILE=`mktemp '/tmp/bcat.XXXXXXXX'`"$EXT" || exit 1
cat > $TMPFILE
View Monitoring

Glossary of Monitoring

  • A system is a set of connected components

The definition of connected and components is missing. I think we can go with definitions like:

  • A components is a set of processes (in the OS sense)
  • Two components are connected if they can talk to each other (over a network or IPC).

Example: A LAMP system, consists of components:

HeinrichHartmann / pinbuffer.el
Created Jun 15, 2016
Pin an buffer to a window in #emacs
View pinbuffer.el
;; Similar to:
(defun pin-buffer ()
"Pin buffer to current window."
(if (let (window (get-buffer-window (current-buffer)))
(set-window-dedicated-p window (not (window-dedicated-p window))))
"pinned buffer" "un-pinned buffer")
HeinrichHartmann /
Created Jan 15, 2016
Simple (inefficient) example of how to create a histogram with python
from matplotlib import pyplot as plt
import numpy as np
X = np.genfromtxt("DataSets/RequestRates.csv", delimiter=",")[:,1]
bins = [500, 700, 800, 900, 1000, 1500, 1800, 2000, 2200]
bin_count = len(bins) - 1
sample_counts = [0] * bin_count
for x in X:
for i in range(bin_count):
if (bins[i] <= x) and (x < bins[i + 1]):
sample_counts[i] += 1
You can’t perform that action at this time.