Skip to content

Instantly share code, notes, and snippets.

View adlerweb's full-sized avatar

Florian Knodt adlerweb

View GitHub Profile
adlerweb /
Last active March 14, 2024 13:06
FRITZ!Box Graylog Gateway
#!/usr/bin/env python3
# Free Open Source Software released under GPLv2
# see
# Author: Florian Knodt <>
# Original Author: Tilman Schmidt <>
# Contributor: Peter Pawn @ IP Phone Forum
# inspired by
# Requirements (for example via pip): graypy, requests
adlerweb /
Last active December 30, 2023 17:25
Grafana MySQL query to visualize Volkszähler-Data

Using Channel-IDs (that's not UUID)

  timestamp/1000 as time_sec, 
  data.value as value, 
  properties.value as metric
FROM data
  LEFT JOIN properties ON (properties.entity_id = data.channel_id)
  LEFT JOIN entities ON ( = data.channel_id)
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <PubSubClient.h>
const char* cfg_wifi_ssid = "";
const char* cfg_wifi_pwd = "";
const char* mqtt_server = "deinserver.local";
const unsigned int mqtt_port = 1883;
adlerweb /
Created September 30, 2023 11:18
Extract target URL from a mandrill tracking link. Based on
import sys
import json
import base64
import argparse
from binascii import Error as BinasciiError
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse, parse_qsl
version = "0.1"
def urlsafe_base64_decode(s):
adlerweb / PKGBUILD
Last active August 28, 2023 23:53
s25rttr 0.9.5 GCC13 aur
#Maintainer: Matthias Mailänder <matthias at mailaender dot name>
#Contributor NiNjA <heinep at gmail dot com>
#Contributor float < at gmx dot de>
#Contributor adlerweb <aur at adlerweb dot info>
pkgdesc="Return to the Roots is a reimplementation of Settlers II (Die Siedler II) by BlueByte Software GmbH. Put the files from the original game in the folder (/usr/share/s25rttr/S2/)"
arch=('i686' 'x86_64')
adlerweb /
Created August 20, 2023 18:16
pip upgrade helper

When updating a venv to a newer python version you need to reinstall all locally install pip packages. This script can be pointed at the previous versions site-packages directory and output a string containing all previously installed packages, suitable to pass to pip install.

(Search-foo: Might help if you are running HomeAssistant inside a venv and, after upgrading python, integrations are not loaded)

adlerweb /
Created August 20, 2023 18:11
HomeAssistant: Convert command_line sensors to new (2023) format
#!/usr/bin/env python3
# pip install pyyaml pyyaml-include
import yaml
from yamlinclude import YamlIncludeConstructor
import os
import sys
base_dir = os.path.expanduser('~') + '/.homeassistant/'
adlerweb / .SRCINFO
Created August 3, 2023 10:40
pkgbase = zfs-linux-rc
pkgver = 2.2.0_rc3_6.4.7.arch1.2
pkgrel = 1
url =
arch = x86_64
license = CDDL
makedepends = linux-headers=6.4.7.arch1-2
depends = kmod
depends = zfs-utils-rc=2.2.0_rc3
depends = linux=6.4.7.arch1-2
adlerweb / .SRCINFO
Created August 3, 2023 09:57
pkgbase = zfs-utils-rc
pkgdesc = Kernel module support files for the Zettabyte File System.
pkgver = 2.2.0_rc3
pkgrel = 1
url =
install = zfs-utils.install
arch = x86_64
groups = archzfs-linux-rc
license = CDDL
makedepends = python
adlerweb /
Created June 18, 2023 19:25
Send SMS to device using API/CURL.
curl -u apikey:<API KEY FROM DASHBOARD API TAB> --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "{
\"body\": \"Hello world\"
}" \