Skip to content

Instantly share code, notes, and snippets.

View RustyDust's full-sized avatar

stefan RustyDust

  • Cyberspace
View GitHub Profile
@RustyDust
RustyDust / analyze_binlog.sh
Created February 28, 2023 08:27
Analyze MySQL/MariaDB binlog
#!/bin/sh
CMDS="insert update delete"
for CMD in ${CMDS}; do
mysqlbinlog ${1} | grep "^${CMD}" > $1.${CMD}
if [ "${CMD}" = "insert" ]; then
cat ${1}.${CMD} | gawk 'split($3, a, /\(/){print a[1]}' | sort -u > ${1}.${CMD}.tables
fi
if [ "${CMD}" = "delete" ]; then
cat ${1}.${CMD} | gawk 'split($3, a, /\(/){print a[1]}' | sort -u > ${1}.${CMD}.tables
@RustyDust
RustyDust / sb10_data.py
Created January 7, 2023 16:17
SonnenBatterie output for reference
# Power:
[{'a_l1': 0,
'a_l2': 0,
'a_l3': 0.06300000101327896,
'channel': 1,
'deviceid': 4,
'direction': 'production',
'error': 0,
@RustyDust
RustyDust / sonos_info_message.yaml
Created January 7, 2023 13:43
Send message on Sonos speakers when washing machine is done
alias: Washing machine done
description: ''
trigger:
# power consuption below 3W for 5 minutes
- platform: numeric_state
entity_id: sensor.washing_machine_power
below: '3'
for: '00:05:00'
condition: []
action:
@RustyDust
RustyDust / sonnenbatterie_test.py
Last active February 26, 2024 15:09
Test output from a SonnenBatterie
#!/usr/bin/env python3
import requests
import hashlib
from pprint import pprint
USERNAME = ''
PASSWORD = ''
HOSTADDR = ''
@RustyDust
RustyDust / xerox_phaser_7100N_sru.ppd
Created April 2, 2022 17:48
Xerox Phaser 7100N fixed PPD with disabled banner page (MacOS)
*PPD-Adobe: "4.3"
*%%%% PPD file for Xerox Phaser 7100N with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v2.3b7.
*FormatVersion: "4.3"
*FileVersion: "5.3.0"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "XRP7100N.PPD"
*Product: "(Phaser 7100N)"
*Manufacturer: "Xerox"