Skip to content

Instantly share code, notes, and snippets.

View hsmade's full-sized avatar

Wim Fournier hsmade

View GitHub Profile
@hsmade
hsmade / convert-sheet-to-sensors.py
Created August 12, 2025 21:07
Converts the Victron excel sheet with modbus information to Home assistant sensors
# This is a 'dumb' script to convert the Victron modbus excel sheet to home assistant sensors.
# https://www.victronenergy.com/upload/documents/CCGX-Modbus-TCP-register-list-3.60.xlsx
# It just 'walks' over all IDs in the sheet, and probes your GX device on `IP`, to see if it generates data or an error
# If there's data, it will add it to the sensors.
# This does create some duplicate names as some descriptions are duplicated in the sheet, so check it afterwards.
import openpyxl
from pymodbus.client import ModbusTcpClient as ModbusClient
import time
import sys
@hsmade
hsmade / gist:82d14b70299d878322e420c605733760
Created April 9, 2025 14:18
actions/actions-runner-controller issue token refresh not working - listener logs
2025-04-09T14:14:45Z INFO listener-app app initialized │
2025-04-09T14:14:45Z INFO listener-app Starting listener │
2025-04-09T14:14:45Z INFO listener-app refreshing token {"githubConfigUrl": "https://github.mpi-internal.com/bnl"} │
2025-04-09T14:14:45Z INFO listener-app getting runner registration token {"registrationTokenURL": "https://github.mpi-internal.com/api/v3/orgs/bnl/actio │
ns/runners/registration-token"} 2025/04/09 14:14:45 Application returned an error: createSession failed: failed to create session: failed to get runner registration token on refresh: github api error: StatusCode 401, Reques
@hsmade
hsmade / gist:9f21b38f9680b7c3a42f690ecb6ddf65
Created April 9, 2025 14:14
actions/actions-runner-controller issue token refresh not working - controller logs
2025-04-09T14:02:06Z INFO AutoscalingListener Creating a listener pod {"version": "0.11.0", "autoscalinglistener": {"name":"test-github-runners-55655b45-listener","namespace":"github-runners"}}
2025-04-09T14:02:06Z INFO AutoscalingListener Creating listener pod {"version": "0.11.0", "autoscalinglistener": {"name":"test-github-runners-55655b45-listener","namespace":"github-runners"}, "namespace": "github-runners", "name": "test-github-runners-55655b45-listener"}
2025-04-09T14:02:06Z INFO AutoscalingListener Created listener pod {"version": "0.11.0", "autoscalinglistener": {"name":"test-github-runners-55655b45-listener","namespace":"github-runners"}, "namespace": "github-runners", "name": "test-github-runners-55655b45-listener"}
2025-04-09T14:02:06Z INFO AutoscalingListener Listener pod is not ready {"version": "0.11.0", "autoscalinglistener": {"name":"test-github-runners-55655b45-listener","namespace":"github-runners"}, "namespace": "github-runners", "name": "test-github-runners-55655b45-listener"}
2025-04-09T
@hsmade
hsmade / proxmox+maas+juju+k8s.md
Last active December 23, 2023 15:51
proxmox/maas/juju/k8s
@hsmade
hsmade / em6330.md
Last active March 22, 2022 07:38
getting deep into the eminent em6330

EM6330

I have an EM6330 camera. I want to run my own software on it. It's based on the hi3518 Chip, and uses a ARM5 EABI arch. It runs a faily old kernel:

# uname -a
Linux IPCamera 3.4.35 #58 Mon Nov 27 12:35:06 CST 2017 armv5tejl GNU/Linux

There's a NAND that gets mounted on /mnt/mtd and a memory filesystem of 10MB that gets mounted on /mnt/mtd/ipc/tpmfs. There's also a SD card slot, which gets automatically formatted with a FAT32 partition with the type set to Linux (yes, not DOS). The auto-mounting is done by a shell script that runs in the background, so if you want to handle it yourself, just kill that.

@hsmade
hsmade / get_sid.py
Last active May 16, 2020 20:38
Get SID for fritzbox
from hashlib import md5
import requests
fritz = 'fritz.box'
username = 'changeme'
password = 'changeme'
# Get the challenge, do very ugly xml parsing
challenge = requests.get('http://{host}/login_sid.lua'.format(host=fritz)).content.split('Challenge>')[1].split('<')[0]
@hsmade
hsmade / docker-compose.yml
Last active February 24, 2017 15:01
Quick fabio demo
version: "2.0"
services:
consul:
image: consul
ports:
- 8500:8500 # so we can see consul on the outside
- 53:8600/udp # so we can query consul dns on the outside
environment:
- CONSUL_CLIENT_INTERFACE=eth0 # so it binds on eth0 and is reachable for other containers
@hsmade
hsmade / gist:07125beb81b714aba30a
Created November 15, 2015 20:08
docker swarm + multi-host network + tls
## docker 1.9, kernel >= 3.16
## node1 1.2.3.4 swarm.domain1.com, docker.domain1.com - swarm master + agent + consul
## node2 2.3.4.5 docker.domain2.com - swarm agent
## node1
# cat << EOF extconfig-node1.cnf
extendedKeyUsage = clientAuth,serverAuth
subjectAltName = IP:1.2.3.4,IP:127.0.0.1
EOF
# cat << EOF extconfig-node2.cnf