Skip to content

Instantly share code, notes, and snippets.

View adlerweb's full-sized avatar

Florian Knodt adlerweb

View GitHub Profile
@adlerweb
adlerweb / fritzlog.py
Last active March 14, 2024 13:06
FRITZ!Box Graylog Gateway
#!/usr/bin/env python3
# Free Open Source Software released under GPLv2
# see http://www.gnu.org/licenses/gpl-2.0
# Author: Florian Knodt <git@adlerweb.info>
# Original Author: Tilman Schmidt <tilman@imap.cc>
# Contributor: Peter Pawn @ IP Phone Forum
# inspired by http://www.administrator.de/contentid/214598
# Requirements (for example via pip): graypy, requests
@adlerweb
adlerweb / vz.md
Last active December 30, 2023 17:25
Grafana MySQL query to visualize Volkszähler-Data

Using Channel-IDs (that's not UUID)

SELECT
  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 (entities.id = data.channel_id)
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <PubSubClient.h>
const char* cfg_wifi_ssid = "freifunk-myk.de";
const char* cfg_wifi_pwd = "";
const char* mqtt_server = "deinserver.local";
const unsigned int mqtt_port = 1883;
@adlerweb
adlerweb / mandrill_extract.py
Created September 30, 2023 11:18
Extract target URL from a mandrill tracking link. Based on https://gist.github.com/medmunds/1b696ee88ccb0480d71f
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
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 <flo.at at gmx dot de>
#Contributor adlerweb <aur at adlerweb dot info>
pkgname=s25rttr
pkgver=0.9.5
pkgrel=3
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
adlerweb / README.md
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
adlerweb / cli_convert.py
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
adlerweb / .SRCINFO
Created August 3, 2023 10:40
zfs-linux-rc-2.2.0_rc3-1
pkgbase = zfs-linux-rc
pkgver = 2.2.0_rc3_6.4.7.arch1.2
pkgrel = 1
url = https://zfsonlinux.org/
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
adlerweb / .SRCINFO
Created August 3, 2023 09:57
zfs-utils-rc-2.2.0_rc3-1
pkgbase = zfs-utils-rc
pkgdesc = Kernel module support files for the Zettabyte File System.
pkgver = 2.2.0_rc3
pkgrel = 1
url = http://zfsonlinux.org/
install = zfs-utils.install
arch = x86_64
groups = archzfs-linux-rc
license = CDDL
makedepends = python
@adlerweb
adlerweb / sms.sh
Created June 18, 2023 19:25
Send SMS to hologram.io device using API/CURL.
curl -u apikey:<API KEY FROM DASHBOARD API TAB> --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "{
\"deviceid\": <DEVICE ID LISTED ON DEVICE PAGE>,
\"body\": \"Hello world\"
}" \
'https://dashboard.hologram.io/api/1/sms/incoming'