Skip to content

Instantly share code, notes, and snippets.

import argparse
import asyncio
from bleak import BleakScanner, BleakClient, BleakGATTCharacteristic
import traceback
import time
import subprocess
CMD = "/Users/mwheeler/src/Karabiner-DriverKit-VirtualHIDDevice/examples/virtual-hid-device-service-client/build/Release/virtual-hid-device-service-client"
p = subprocess.Popen(["/Users/mwheeler/src/Karabiner-DriverKit-VirtualHIDDevice/examples/virtual-hid-device-service-client/build/Release/virtual-hid-device-service-client"], stdin=subprocess.PIPE)
$fn=50;
offset=6;
tube_diameter=10.6;
overall_height=65.2;
easing=0.5;
extrude_height=16;
hole_diameter=5.3;
bolt_d=8;
bolt_h=4;
@xssfox
xssfox / pylivetrack.py
Created October 21, 2026 00:04
pylivetrack.py
import requests
import argparse
from html.parser import HTMLParser
import logging
import time
import traceback
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from PIL import Image
from decimal import Decimal, getcontext
from math import floor
import bitarray
import pytesseract
getcontext().prec = 10000
def isOdd(i):
image = b''
@xssfox
xssfox / docker-compose.yml
Created September 25, 2024 08:52
acme renew for docker-compose.yml kanidm
volumes:
certs:
services:
create-cert:
image: smallstep/step-cli
volumes:
- certs:/certs/:rw
- ./ca:/root
command:
- step
import pulsectl
import time
import paramiko
import traceback
while 1:
try:
pulse = pulsectl.Pulse('my-client-name')
ssh = paramiko.SSHClient()
# Audio device
ADEVICE pulse pulse
ACHANNELS 1
CHANNEL 0
#Callsign
MYCALL VK4XSS
# Modem speed
MODEM 1200
@xssfox
xssfox / README.md
Last active June 4, 2026 03:06
basic ax25 setup

Software

sudo apt-get install direwolf ax25-apps ax25-tools

Setting up direwolf

Direwolf is our software TNC

import kissfix # TODO do we need to worry about the python3 issue / kissfix
import serial
import os, pty, serial, tty, termios
import threading
import logging
import sys, traceback
import fcntl
import time
logger = logging.getLogger()

First up you need to run this python3 script and leave it running - it's a web server that lets you control the printer from HTTP commands

https://gist.github.com/xssfox/b911e0781a763d258d21262c5fdd2dec

You probably need to have lucon.ttf in your systems font dir or in scripts directory

And you'll need bleak, Pillow and flask installed by pip

Some people have reported issues getting TypeError: a bytes-like object is required, not 'list' in this case :