Skip to content

Instantly share code, notes, and snippets.

View lnxd's full-sized avatar
🙊
I may be slow to respond.

Alex lnxd

🙊
I may be slow to respond.
View GitHub Profile
@lnxd
lnxd / README.md
Created July 9, 2026 00:47
Decrypting UniFi Backups (both .unf and .unifi)

UniFi Backup Decryption

Overview

Ubiquiti backup files are encrypted, but the keys are currently static and public rather than per site or per device. I have tested both keys against my own backups.

File Structure

Legacy "UniFi Network" controller backup (.unf)

@lnxd
lnxd / chatgpt_citations_to_md.py
Last active March 23, 2026 02:33
Convert ChatGPT Deep Research citations to Markdown footnotes
#!/usr/bin/env python3
#
# chatgpt_citations_to_md.py – Convert ChatGPT Deep Research citations to Markdown footnotes.
# Author: lnxd
# Source: https://gist.github.com/lnxd/1e739b4d218909bc9d9d82681c9d8830
# License: MIT
#
# Deep Research wraps inline citations with private-use Unicode delimiters:
# U+E200 (open) · U+E202 (separator) · U+E201 (close)
# These are invisible in most editors but show as [?] boxes in some renderers.
@lnxd
lnxd / README.md
Last active March 23, 2026 02:34
UniFi Gateway IDS/IPS Memory Profiling results

UniFi Gateway IDS/IPS Memory Profiling

Overview

Comparative analysis of Suricata IDS/IPS memory consumption across two UniFi gateway models tested approximately two weeks apart. Focuses on per‑category memory impact, cgroup limits, fail‑closed behaviour on OOM, and the observed link between scheduled speed tests and memory spikes.

  • Per‑category memory impact for Emerging Threats rulesets
  • UDM‑SE (4 GB) vs UCG‑Ultra (3 GB) comparison
  • Production outages linked to auto speed‑test spikes
  • Cgroup resource limits and OOM behaviour
  • Methodology: 60–90 s stabilisation after each restart
#Requires -Version 5.1
#
# Note that this has not been tested since Aug 2025 and is likely outdated.
#
# Claude Code on Windows (native, no WSL)
# - Installs Git for Windows (Bash), ripgrep
# - Sets CLAUDE_CODE_GIT_BASH_PATH
# - Installs Claude Code native binary
# - Adds safe "ask" permission rules for running PowerShell scripts

Character-Set Limitation

Critical: Except when foreign letters are expressly required (e.g., Greek symbols in maths or when translating), limit all output according to the rules below.

Allowed exceptions to the rule

  • Accented Latin letters (á, é, ñ, ü, etc.) when writing in languages that use them
  • Mathematical and technical symbols (±, ×, √, ∑, etc.) and the Greek alphabet ONLY when required to document mathematical formulas
  • Non-Latin scripts (Cyrillic, Chinese, Arabic, etc.) if translating

Virtual Cameras in Frigate

Create extra views (sky-only, cropped, perspective-corrected, etc.) from one physical camera. Handy, but very resource intensive.


Contents

@lnxd
lnxd / update-pve.sh
Last active August 7, 2025 07:10
update-pve.sh
#!/usr/bin/env bash
#
# update-pve.sh – Fully update a Proxmox VE node.
# Author: lnxd
# Source: https://gist.github.com/lnxd/6bd46f1913b151e73d1836d4924c15bf
#
# USAGE
# sudo ./update-pve.sh # update, NO reboot
# sudo ./update-pve.sh --reboot # update, reboot only if required
# sudo ./update-pve.sh --reboot-now # update, always reboot
@lnxd
lnxd / macos_privacy.sh
Last active March 29, 2025 13:26
This is far from perfect, but *mostly* working. For example, it does not correctly clear certain recents.
#!/bin/zsh
# ====================
# Privacy Protection Script
# Author: lnxd
# https://gist.github.com/lnxd/7f0b1978752e99dedeff4a920410ea6d
# ====================
echo "- Starting Privacy Protection Script"
@lnxd
lnxd / instructions.md
Last active September 13, 2024 08:03
Zerotier Exit Node using Debian 12 LXC on Proxmox 8
lnxd@zt:~# /usr/sbin/zerotier-cli join {network}
200 join OK
lnxd@zt:~# zerotier-cli listnetworks
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>

Check logs with:

journalctl -u zerotier-one
@lnxd
lnxd / generate_changelog.sh
Created August 3, 2024 01:40
Pulls the latest 100 commits from the TA-Lib GitHub repo, formats the commit details (date, message, author, and link), and saves them as a changelog in changelog.txt. If GITHUB_TOKEN is set, the script uses it to avoid hitting API rate limits.
#!/bin/bash
REPO_URL="https://api.github.com/repos/TA-Lib/ta-lib/commits"
OUTPUT_FILE="changelog.txt"
AUTH_HEADER=""
[ -n "$GITHUB_TOKEN" ] && AUTH_HEADER="-H 'Authorization: token $GITHUB_TOKEN'"
eval curl -s $AUTH_HEADER "$REPO_URL?per_page=100&page=1" | jq -r '
.[] |