Skip to content

Instantly share code, notes, and snippets.

@a-a
a-a / gas-sensor-1.yaml
Created December 6, 2025 00:35
Pimoroni MiCS-6814 ESPHome
# usage: replace - in filenames with /
# ie:
# sensor.yaml
# local_components/mics_6814/*
#
esphome:
name: gas-sensor-1
friendly_name: gas-sensor-1
esp32:
@a-a
a-a / fe5680.py
Created November 18, 2025 18:53
FE-5680A DDS helper: convert between frequency and tuning word.
#! /usr/bin/env python3
import argparse
def freq_to_word(f_out, f_ref):
N = round((f_out / f_ref) * (2**32))
return N, f"{N:08X}"
def word_to_freq(word_hex, f_ref):
N = int(word_hex, 16)
f_out = (N / (2**32)) * f_ref
return f_out
def main():
@a-a
a-a / readme.md
Last active October 21, 2025 01:00
lassen

Assisted cold starting a Trimble Lassen SK-8 II

like how humans can form emotional bonds to roombas, i just think its cool that we made silicon stargaze too ✨

Lassen will search using up to 8 channels, for any satellite at all.

When Lassen finds a satellite it will try to download almanac. You need stable lock for at least 15 minutes because the download is slow....

Help Lassen along by saying where you are, so it can figure out just how pretty the sky will be. But the sky moves, so if you have even a partial almanac download, tell lassen what week it is from the GPS epoch. Almanac time wraps too, so don't sweat the rollover. When Lassen knows where to look, and what time they will be there, the search is more effective.

@a-a
a-a / pods.csv
Created December 5, 2024 23:53
rancid_juulpod.py
batchnumber series strength flavour region copyright podrev code podmodel
KK11SAS1D Juul 2 1.8 Polar Menthol GB 2021 A 455-01929 PSP001
KL18SAS1D Juul 2 1.8 Polar Menthol GB 2021 A 455-01929 PSP001
LJ09SAS2D Juul 2 1.8 Polar Menthol GB 2022 B 455-01929 PSP001
MG14SAS2D Juul 2 1.8 Polar Menthol GB 2023 C 455-01929 PSP001
MH08SAS2D Juul 2 1.8 Polar Menthol GB 2023 C 455-01929 PSP001
MJ11SAS2D Juul 2 1.8 Polar Menthol GB 2023 C 455-01929 PSP001
ML27SAS2D Juul 2 1.8 Polar Menthol GB 2023 C 455-01929 PSP001
MM29SBS2D Juul 2 1.8 Polar Menthol GB 2023 C 455-01929 PSP001
NB23SAS2D Juul 2 1.8 Polar Menthol GB 2023 C 455-01929 PSP001
@a-a
a-a / token.py
Created May 12, 2024 14:20
freeotp+ freeotp plus json token reader with QR output
#! /usr/bin/env python3
# usage: ensure freeotp-backup.json exists in working dir, run this
# if all goes well, it will spit out qr codes. you can enrol these to another authentictor app.
# good luck and try not to break your phone again ;)
#
# known limitations: HOTP is UNTESTED. the counter handling might be wrong. i didn't have any working HOTP to test against
import sys, json, qrcode, base64, platform
def qr_term_str(str):
@a-a
a-a / alpine-incus.md
Last active February 6, 2024 22:06 — forked from seia-soto/howto.md
How to compile lxc/incus on AlpineLinux

How to build lxc/incus on AlpineLinux (musl)

The document was written to build Incus v0.5.1. You may need a different how-to if you want to build higher versions of Incus.

  • Incus v0.5.1 (via Git)
  • AlpineLinux 3.18 x86_64
  • Canonical LXD-UI (Via Git)

This how-to document will help you to build Incus for AlpineLinux. Original references are:

@a-a
a-a / 10-wayland.conf
Last active November 29, 2023 16:56
pure wayland sddm on debian bookworm (raspberry pi 5, but probably similar for x86 and friends)
[General]
DisplayServer=wayland
[Wayland]
# Path of the directory containing session files
SessionDir=/usr/share/wayland-sessions
# Path of script to execute when starting the desktop session
SessionCommand=/usr/share/sddm/scripts/wayland-session
@a-a
a-a / lib_systemd_system_pocsag-udp-relay.service
Created July 25, 2023 21:14
rpitx pocsag - simple and dirty udp forwarder
[Unit]
Description=POCSAG UDP Relay
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/local/bin/pocsag-udp-relay.py
StandardInput=tty-force
Restart=on-failure
@a-a
a-a / fuckedifimraisingajtaccaseforthis.txt
Last active June 24, 2024 04:49
Force Juniper SRX110 to accept VDSL PIC firmware from later (published) jfirmware releases
# Force Juniper SRX110H2 to accept VDSL PIC firmware from Juniper jfirmware 17 release (For SRX300 series?)
# it might work, it might not. do this at your own risk etc. i think it rolls back. haven't tried lol.
# Testing using latest 17.4 release specifically from https://support.juniper.net/support/downloads/?p=junos-srx#sw.
# At time of writing, "latest" was jfirmware-srxsme-17.4R3.16-signed.tgz - copy your shit to a fat32 usb
# Make usb mountpoint (if you haven't already)
root@% mkdir /var/tmp/usb
# Mount the USB
root@% mount_msdosfs /dev/da0s1 /var/tmp/usb
@a-a
a-a / lilygo-t5-weather.ino
Created November 21, 2020 00:21
lilygo-t5-weather.ino
#include <gfxfont.h>
#include <Adafruit_SPITFT_Macros.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_GFX.h>
#include <Adafruit_GrayOLED.h>
/* ESP Weather Display using an EPD 2.7" Display, obtains data from Open Weather Map, decodes it and then displays it.
####################################################################################################################################