Skip to content

Instantly share code, notes, and snippets.

View BenHerbst's full-sized avatar
🎯
Focusing

Ben Herbst BenHerbst

🎯
Focusing
View GitHub Profile
@BenHerbst
BenHerbst / ac_lost_power_off.sh
Created December 21, 2024 18:55
This Shell Script turns off a laptop 10 seconds after the AC Power is lost
while true
do
if ! on_ac_power; then
notify-send "Lost Power. System shutdowns in 10 Seconds!"
echo "Lost AC-Power. Shutting down in 10 Seconds ..."
sleep 10
echo "You are on AC-Power"
echo "password" | sudo -kS shutdown -h now
fi
sleep 10
@BenHerbst
BenHerbst / WireGuard-site-to-site.md
Created October 17, 2024 11:36 — forked from Schm1tz1/WireGuard-site-to-site.md
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@BenHerbst
BenHerbst / WireGuard-site-to-site.md
Created May 3, 2024 19:53
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@BenHerbst
BenHerbst / Dockerfile
Created May 6, 2023 00:21
Flask Hot Reload Dockerfile + Compose
FROM python:3.10
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
CMD ["flask", "run", "--host=0.0.0.0", "--debug"]