Skip to content

Instantly share code, notes, and snippets.

@TKaluza
TKaluza / nitrokey_pin_sheet.py
Created September 21, 2026 16:39
Create printable Nitrokey 3 PIN sheets
#!/usr/bin/env python3
"""Create printable Nitrokey 3 PIN sheets (one A4 page per UUID).
Setup: python3 -m pip install reportlab
Usage: python3 nitrokey_pin_sheet.py UUID [UUID ...] [-o output.pdf]
python3 nitrokey_pin_sheet.py --help
Output: nitrokey-pin-recovery-sheet.pdf in the current directory (overwritten).
The first five hexadecimal characters become the device label.
Names, dates, PINs and secrets stay blank for handwriting.
@TKaluza
TKaluza / bench.py
Created June 7, 2025 22:32 — forked from jcrist/bench.py
A quick benchmark comparing msgspec (https://github.com/jcrist/msgspec), pydantic v1, and pydantic v2
"""A quick benchmark comparing the performance of:
- msgspec: https://github.com/jcrist/msgspec
- pydantic V1: https://docs.pydantic.dev/1.10/
- pydantic V2: https://docs.pydantic.dev/dev-v2/
The benchmark is modified from the one in the msgspec repo here:
https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_validation.py
I make no claims that it's illustrative of all use cases. I wrote this up