Skip to content

Instantly share code, notes, and snippets.

View casebeer's full-sized avatar

Christopher Casebeer casebeer

View GitHub Profile
@casebeer
casebeer / ethernetCrcTestVector.py
Created March 3, 2026 22:29
Ethernet CRC computation with Python zlib.crc32
import struct
import zlib
testVector = (
# input is ascii string
bytearray(ord(c) for c in "123456789"),
bytearray([ 0xCB, 0xF4, 0x39, 0x26]),
)
crc = zlib.crc32(testVector[0])
@casebeer
casebeer / reportVideoEvents.js
Created February 19, 2026 23:57
console.log HTML5 <video> element lifecycle events.
const reportableEvents = [
'abort',
//'canplay',
//'canplaythrough',
//'durationchange',
'emptied',
'encrypted',
'ended',
'error',
'loadeddata',
@casebeer
casebeer / unloadVideoElt.js
Created February 19, 2026 23:56
Reset an HTML5 <video> element so it can be reused. Avoids race condition with setMediaKeys.
/*
* Unload any previous media and keys from <video> element
**/
const resetVideoElt = async (videoElt) => {
const videoEltEmptied= new Promise((resolve) => { videoElt.addEventListener('emptied', (e) => {
//console.log(e);
resolve();
}, { once: true }) });
videoElt.pause();
@casebeer
casebeer / zb-gw03-esphome.yaml
Last active October 8, 2025 20:05
Working esphome config and install notes for ewelink ZB-GW03 esp32-based 10/100 Ethernet to Zigbee device.
# eWeLink ZB GW03 Modified ESPHome Config
#
# - Add debug text sensors
# - Add bluetooth_proxy
# - Add web_server for offline reflash
#
# Important documentation from upstream
#
# - https://github.com/syssi/esphome-zb-gw03
# - [Flash ESPHome and use the ZB-GW03 as Zigbee Coordinator](https://github.com/syssi/esphome-zb-gw03/blob/main/docs/flashing.md)
@casebeer
casebeer / config.yml
Last active August 26, 2025 01:09
Working Frigate NVR configuration files and setup steps for rootless Docker on Ubuntu 24.04.
#
# Basic working Frigate NVR config with internal test pattern generation
# - For intel graphics
# - With PCI Coral TPU
# - Recording disabled by default (enable per camera) but default retention configured
# - With ffmpeg-generated test pattern as initial camera for debugging
# WARNING Disable test pattern camera and go2rtc config to minimize CPU usage once initial setup is complete
#
mqtt:
@casebeer
casebeer / setup-docker-rootless.sh
Created August 25, 2025 20:55
Docker rootless initial configuration
#!/bin/bash
if [ -f /etc/docker/daemon.json ] ; then
echo "/etc/docker/daemon.json already exists, refusing to overwrite it." >&2
exit 1
fi
cat <<EOF | sudo tee /etc/docker/daemon.json
{ "userns-remap": "default" }
EOF
{
"MaxStaticBitrate": 7789442,
"MaxStreamingBitrate": 7789442,
"MusicStreamingTranscodingBitrate": 192000,
"DirectPlayProfiles": [
{
"AudioCodec": "vorbis,opus",
"Container": "webm",
"Type": "Video",
"VideoCodec": "vp8"
@casebeer
casebeer / etc_logrotate.d_rsyslog-remote
Last active March 2, 2025 00:54
Receive remote syslog messages with rsyslog and logrotate on Ubuntu
# Logfiles under /var/log/hosts per rsyslog.d config
/var/log/hosts/*/*.log
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
@casebeer
casebeer / etc_logrotate.d_snmptrapd
Last active March 2, 2025 00:55
snmptrapd logging to rsyslogd and snmptrapd.log with logrotate rotation on Ubuntu
# snmptrapd.log files as per `systemctl edit snmptrapd.service`
# (in addition to logging traps to syslog)
/var/log/snmptrapd.log
{
rotate 7
daily
missingok
notifempty
delaycompress
compress

GICISKY ePaper Display BLE Protocol

Documentation based on the ATC1441 BLE E-Paper Uploader (source on Github) and testing with a 2.9" Black/White/Red epaper display.

BLE characteristics

  • Primary Service
    • Short UUID 0xfef0
  • Long UUID 0000fef0-0000-1000-8000-00805f9b34fb