Skip to content

Instantly share code, notes, and snippets.

View waldheinz's full-sized avatar

Matthias Treydte waldheinz

View GitHub Profile
@waldheinz
waldheinz / prometheus.cgi
Created September 30, 2017 09:20
Prometheus Exporter for Homematic CCU
#!/bin/tclsh
load tclrega.so
source [file join $env(DOCUMENT_ROOT) once.tcl]
source [file join $env(DOCUMENT_ROOT) cgi.tcl]
cgi_eval {
cgi_input
cgi_content_type "text/plain; charset=iso-8859-1; version=0.0.4"
@waldheinz
waldheinz / ReadWriteLockStress.hs
Last active August 29, 2015 14:01
ReadWriteLock fail
module Main where
import Control.Concurrent ( forkIO, threadDelay )
import Control.Monad ( forever, replicateM_ )
import qualified Control.Concurrent.ReadWriteLock as RWL
import System.Random ( randomRIO )
main :: IO ()
main = do
lock <- RWL.new
@waldheinz
waldheinz / peers
Created May 2, 2014 12:12
Seed nodes for the ADS network
[
{ "id" : "1ABF229E06B1488314EBC2B12902F20765CAE44D8D09B76578DAC65D097ED303",
"addresses" : [{ "host" : "waldheinz.de", "port" : 1234 }]
}
]
@waldheinz
waldheinz / avg.cpp
Created January 12, 2014 11:41
Gleitender Mittelwert
/*
* compile with C++ 11 support, e.g.:
*
* g++ -std=c++0x -Wall -Wextra -pedantic avg.cpp
*/
#include <iomanip>
#include <iostream>
#include <random>