Skip to content

Instantly share code, notes, and snippets.

View ben-ba's full-sized avatar
🏠
Working from home

ben-ba

🏠
Working from home
  • Germany
  • 17:49 (UTC +02:00)
View GitHub Profile
@ctsrc
ctsrc / 00_install_fbsd_14_1_hetzner.md
Last active July 2, 2025 14:45
Install FreeBSD 14.1 on Hetzner

Install FreeBSD 14.1 on Hetzner server

Hetzner no longer offers direct install of FreeBSD, but we can do it ourselves. Here is how :)

Boot the server into rescue mode

Boot the Hetzner server in Hetzner Debian based rescue mode. ssh into it.

The Hetzner rescue image will tell you hardware details about the server in the login banner. For example, with one of my servers I see:

@namxam
namxam / wg-watchdog
Last active February 23, 2023 06:57 — forked from mattkasun/wg-watchdog.sh
wireguard watchdog script
#!/bin/bash
# 1. Save file to system /usr/bin
# 2. Make it executable
# 3. Add crontab entry:
# sudo su
# crontab -e
# Add `* * * * * /usr/bin/wg-watchdog`
#
# You can track history via `journalctl -f -t wg-watchdog`
@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@qdm12
qdm12 / README.md
Last active May 11, 2025 10:51
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@x1le
x1le / wireguard-on-seedbox.md
Created April 13, 2020 00:41
VPN on Seedbox

Setup VPN back home

We want to be able to securely sync between the cloudbox and back on-prem (for a local plex server). As a result we'll configure a wireguard VPN link between the two and then setup a rsync daemon on the cloudbox.

See Wireguard vs OpenVPN on a local Gigabit Network for a performance comparison. I've gone with Wireguard over OpenVPN based on it being incorporated into the Linux Kernel and increased performance versus OpenVPN. In addition, there's a useful walkthrough on How to setup your own VPN server using WireGuard on Ubuntu that I leaned on during this process. It's not quite right though and had some errors in.

Install wireguard pre-reqs on both boxes

sudo apt-get -y install software-properties-common; \
sudo add-apt-repository -y ppa:wireguard/wireguard; \
sudo apt-get install -y wireguard; \
@l1pz
l1pz / torrentwatcher.py
Created April 3, 2020 13:00
qBittorrent - download next torrent after the recent one finished moving
#!/usr/bin/env python3
import requests
import json
import random
authUrl = 'http://yourwebuiurl/api/v2/auth/'
torrentsUrl = 'http://yourwebuiurl/api/v2/torrents/'
cookies = {'SID': 'nologin'}
@leopoldodonnell
leopoldodonnell / Readme.md
Last active October 10, 2024 09:40
Install and run Postgres with an extension using docker-compose

Local Postgres

This gist is an example of how you can simply install and run and extended Postgres using docker-compose. It assumes that you have docker and docker-compose installed and running on your workstation.

Install

  • Requires docker and docker-compose
  • Clone via http: git clone https://gist.github.com/b0b7e06943bd389560184d948bdc2d5b.git
  • Make load-extensions.sh executable
  • Build the image: docker-compose build
@hjbotha
hjbotha / free_ports.sh
Last active May 20, 2025 14:10
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
#!/bin/bash
set -e
set -x
mkdir ~/transmission
cd ~/transmission
PREFIX=/opt
@kriswebdev
kriswebdev / forcevpn.sh
Last active January 2, 2025 16:34
forcevpn: Force VPN for specific apps, in a better way than killswitch [Linux / OpenVPN]
#!/bin/bash
# === INFO ===
# ForceVPN
# Description: Force VPN tunnel for specific applications.
# If the VPN is down => blackhole the app network traffic.
# Better than a killswitch. IPv4.
VERSION="2.3.0"
# Author: KrisWebDev
# Requirements: Linux with kernel > 2.6.4 (released in 2008).