Skip to content

Instantly share code, notes, and snippets.

View andrebrait's full-sized avatar

Andre Brait andrebrait

View GitHub Profile
@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
@andrebrait
andrebrait / powertop.service
Created March 17, 2025 12:48 — forked from kikislater/powertop.service
powertop.service
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
ExecStart=/usr/bin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
@andrebrait
andrebrait / powertop.service
Created March 17, 2025 12:47 — forked from tazjin/powertop.service
Systemd service for powertop auto tune
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/powertop --auto-tune
#"powertop --auto-tune" still needs a terminal for some reason.
#Possibly a bug?
Environment="TERM=xterm"

1G1R Commands for 1G1R ROM Set Generator

Create 1G1R ROM Sets from No-Intro P/C XML DAT files.

Additional ROMs are excluded if they meet any of the following criteria:

  • Non-Game (Program, Tester, Greeting Card, Music Album, etc...)
  • Bundle (2+ games in one ROM where a single version already exists)

Note: This list is currently a work-in-progress.

Index

@andrebrait
andrebrait / kodi.service
Created May 10, 2021 07:41
Start KODI on graphical interface startup/desktop login, useful for Raspberry Pi users
# This is useful for those who want to have KODI running on startup, but still want to use a full desktop (e.g. Raspbian).
# This will make KODI run as soon as the graphical interface (be it X or Wayland) starts up and the user logs in
# It will only start KODI after the network and remote shares have been started up
[Unit]
Description = Kodi Media Center
After = remote-fs.target network-online.target graphical.target
Wants = graphical.target
[Service]
User = pi