Skip to content

Instantly share code, notes, and snippets.

View andrebrait's full-sized avatar

Andre Brait andrebrait

View GitHub Profile
@andrebrait
andrebrait / install-qemu-agent.sh
Last active June 4, 2026 07:24
Install and enable QEMU Guest Agent on pfSense on boot
#!/bin/sh
# Install qemu-guest-agent
pkg update
pkg install -y qemu-guest-agent
# Enable it in rc.conf.local
cat > /etc/rc.conf.local << EOF
qemu_guest_agent_enable="YES"
qemu_guest_agent_flags="-d -v -l /var/log/qemu-ga.log"
@andrebrait
andrebrait / compose.yaml
Last active June 2, 2026 08:16
rclone - reconciliation process for a DVR with Docker compose
# Periodic reconciliation sweep: copies any source footage MISSING on the backup,
# over SFTP, on an interval. Backstop for the per-upload push when the backup was
# unavailable for a while. COPY ONLY (never sync) — it never deletes from the
# backup, so the backup's own (longer) retention stays in sole control of trimming.
#
# Add this service to your existing docker-compose.yml on the PRIMARY host.
#
# Uses the official rclone image with an SFTP remote configured via environment
# variables (RCLONE_CONFIG_<REMOTE>_*), so there's no config file to manage.
# The remote here is named "backup".
@andrebrait
andrebrait / Dockerfile
Last active June 2, 2026 00:14
SFTPGo - Data Retention Policy send email for data retention policy and manual trigger
FROM python:3.14.5-slim
WORKDIR /app
RUN pip install --no-cache-dir fastapi uvicorn
COPY relay.py .
CMD ["uvicorn", "relay:app", "--host", "127.0.0.1", "--port", "8099"]
@andrebrait
andrebrait / arcane-migrate.sh
Last active June 1, 2026 15:52
Arcane bidirectional migrator
#!/usr/bin/env bash
set -euo pipefail
# ╔══════════════════════════════════════════════════════════════════════════╗
# ║ Arcane bidirectional migrator ║
# ║ ║
# ║ ── DISCLAIMER ── ║
# ║ This script was generated by Claude (an AI assistant by Anthropic) in ║
# ║ collaboration with the user. It is NOT an official Arcane tool and is ║
# ║ not affiliated with or endorsed by the Arcane project (getarcaneapp). ║
@andrebrait
andrebrait / sync_pfblocker_haproxy.sh
Last active May 22, 2026 10:41
Synchronize IP aliases from pfBlockerNG with HAProxy
#!/bin/sh
# SIMPLE PID GUARD: Exit if this script is already running elsewhere
if [ $(pgrep -f "$(basename "$0")" | wc -l) -gt 1 ]; then
echo "Already running"
exit 0
fi
PFB_DIR="/var/db/pfblockerng"
@andrebrait
andrebrait / 0-create-macvlan-ipv6.sh
Last active May 16, 2026 09:27
Set fixed IPv4 and optional fixed IPv6 using netplan with systemd-networkd that actually works
#/bin/sh
docker network create -d macvlan \
--subnet=10.255.0.0/16 --gateway=10.255.0.1 \
--ipv6 \
--subnet=fd00:abba::/32 --gateway=fd00:abba::1 \
-o parent=ens18 \
-o macvlan_mode=bridge firewall-macvlan
@andrebrait
andrebrait / uosserver-healthcheck.service
Last active May 22, 2026 10:41
UOS Server Health Check - Restart upon failed startup
# Copy this file to /etc/systemd/system/ and run `systemctl enable uosserver-healthcheck`
[Unit]
Description=Unifi UOS Server Healthcheck
After=uosserver.service
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 30s
ExecStart=/bin/uosserver-healthcheck
@andrebrait
andrebrait / power.service
Last active October 23, 2025 02:42
Enable Power-saving features for Intel-based servers running Linux
# This enabled the power settings present in the script
# >> Skip this file for unRAID, since it does not use systemd <<
# Put this file in /etc/systemd/system/power.service
# Then manually run it, 'systemctl start power'
# Check the output with 'systemctl status power'
# Then enable it with 'systemctl enable power'
[Unit]
@andrebrait
andrebrait / disable-nic-offload-e1000e.service
Last active May 13, 2025 17:08
Disable e1000e offloading for Proxmox VE and unRAID
# This prevents the freeze with the message 'e1000e eno1: Detected Hardware Unit Hang'
# >> Skip this file for unRAID, since it does not use systemd <<
# Put this file in /etc/systemd/system/disable-nic-offload-e1000e.service
# Then manually run it, 'systemctl start disable-nic-offload-e1000e'
# Check the output with 'systemctl status disable-nic-offload-e1000e'
# Then enable it with 'systemctl enable disable-nic-offload-e1000e'
@andrebrait
andrebrait / powertop_systemd_service.md
Last active July 17, 2025 04:54 — forked from abelardojarab/powertop_systemd_service.md
Create powertop systemd service
cat << EOF | sudo tee /etc/systemd/system/powertop.service
[Unit]
Description=PowerTOP auto tune

[Service]
Type=idle
Environment="TERM=dumb"
ExecStart=/usr/sbin/powertop --auto-tune