Skip to content

Instantly share code, notes, and snippets.

@enkiusz
enkiusz / zketech-ebc-a20.py
Last active April 20, 2025 09:26
ZKETECH EBC-A20 Control code
#!/usr/bin/env python3
"""
A simple CLI tool to control and monitor the ZKETECH EBC-A20 battery
tester from https://www.zketech.com/en/
It can trigger charge or discharge as well as perform charge-discharge
cycles to measure battery capacity.
Currenly only the CC (Constant Current) load type is implemented, the
CP (Constant Power) load type is a simple fixme. Additionally, some
@enkiusz
enkiusz / gist:482fab68ef7a630c8cfaad6f13f63919
Created October 2, 2023 18:11
DNS-320L Buildroot 2023.08-650-gc913d310e5 boot log
** MARVELL BOARD: DB-88F6702A-BP LE
U-Boot 1.1.4 (Aug 22 2012 - 17:06:54) Marvell version: 3.6.0.DNS-320L.01
U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CFB00
Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz
DRAM (DDR2) CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
@enkiusz
enkiusz / tuyamcu-sniffer.py
Created December 19, 2022 15:16
A sniffer for the TuyaMCU protocol
#!/usr/bin/env python3
# Sniffer for the TuyaMCU serial port protocol. This protocol is used between an application MCU
# and the Tuya radio modules.
# Reference: https://tasmota.github.io/docs/TuyaMCU/#tuya-protocols
import serial
import argparse
import structlog
import sys
@enkiusz
enkiusz / gist:03690c7792e9135b62876ed3ea65f10d
Created December 7, 2022 20:11
Build log for boehm-gc on emulated armv6l-linux
$ nix-build '<nixpkgs>' -A boehmgc --argstr system armv6l-linux
this derivation will be built:
/nix/store/00pqhyghjmqspci2cc4j8h909xp8hj98-boehm-gc-8.0.6.drv
building '/nix/store/00pqhyghjmqspci2cc4j8h909xp8hj98-boehm-gc-8.0.6.drv'...
unpacking sources
unpacking source archive /nix/store/1x0ganp58lgr5zhrc5iigzqp0a0jf6mg-gc-8.0.6.tar.gz
source root is gc-8.0.6
setting SOURCE_DATE_EPOCH to timestamp 1632862100 of file gc-8.0.6/test-driver
patching sources
updateAutotoolsGnuConfigScriptsPhase
@enkiusz
enkiusz / gist:3ec49a48fe8ed64500106452ef8221cf
Created July 25, 2022 20:34
DES25-32GD09BC1DC-B042 console output when booting
PKG is 0x02
SPI Init
D4B 00000000
SLP3
RA_Loader
L1FBH CH:
00
SysClk:300MHz
#!/usr/bin/env python3
import serial
import struct
import sys
with serial.Serial(sys.argv[1], 115200) as ser:
while True:
pkt = ser.read(10)
#print("PKT: ", pkt)
@enkiusz
enkiusz / GSD800S_config.bt
Created February 9, 2021 21:49
Planet GSD-800S switch binary configuration dump format.
//------------------------------------------------
//--- 010 Editor v8.0 Binary Template
//
// File: Planet GSD-800S switch binary configuration dump format.
// Authors: Maciej Grela <[email protected]>
// Version: 0.8
// Purpose:
// Category:
// File Mask:
// ID Bytes:
@enkiusz
enkiusz / vmware-esxi-dl.py
Created February 9, 2021 21:48
This scripts is almost as broken as VMWare's download site. Except that it works.
#!/usr/bin/env python3
import requests
import sys
import re
import urllib
import os
import logging
from os.path import basename
from bs4 import BeautifulSoup
@enkiusz
enkiusz / ledboard.py
Created February 9, 2021 21:47
A simple LED board driver example
#!/usr/bin/env python3
#
# This code is in the public domain.
# Maciej Grela <[email protected]>
#
import serial
ser = serial.Serial("/dev/ttyUSB0", 115200)
@enkiusz
enkiusz / remove-exif-metadata
Created June 22, 2020 13:16
Set this as a pre-commit hook to anonymize images in your repository
#!/bin/sh
echo "Removing EXIF metadata"
if ! which exiv2 > /dev/null; then
echo "Please install the exiv2 tool"
exit 0
fi
find . -iname '*.png' -or -iname '*.jpg' -print0 | xargs -0 exiv2 -d a