Skip to content

Instantly share code, notes, and snippets.

View andig's full-sized avatar
🎯
Working on evcc energy manager

andig andig

🎯
Working on evcc energy manager
View GitHub Profile
package main
import (
"context"
"fmt"
"log"
"net"
"net/http"
"net/url"
"time"
@andig
andig / hexdump.go
Created January 5, 2021 16:48
HexDump in Go
// hexDump
func hexDump(file io.Reader) {
dumpLimit := &io.LimitedReader{
R: file,
N: 512,
}
b, _ := ioutil.ReadAll(dumpLimit)
@andig
andig / architecture-discussion.md
Last active January 26, 2021 14:31
Volkszähler Architektur

Volkszähler Architecture

Current architecture

The as-is architecture looks like this:

aquire -> persist -> visualize

Each compontent is implemented separately with persist and visualize sharing a github repository.

@andig
andig / ip.php
Created October 16, 2018 18:01
What's my IP, Fritz!Box?
<?php
/*
* PHP-only solution for obtaining external IP from Fritz!Box
*
* Based on https://stackoverflow.com/questions/5647461/how-do-i-send-a-post-request-with-php#6609181
* brought to you by cpuidle@gmx.de
*/
// curl -s "http://fritz.box:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress" -d "@external_ip.xml" | grep -Eo "\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>"

Installing elastic beats on Raspberry Pi

At time of writing elastic.co does not provide ARM builds for raspberry. This tutorial describes how to compile e.g. filebeat and run in on Raspberry Pi3.

Prerequisites

You'll need Go (>1.8) and Pyhton with virtualenv.

Go 1.8