Skip to content

Instantly share code, notes, and snippets.

View thehaniak's full-sized avatar

Haniak thehaniak

View GitHub Profile

I've been working on a solution to ban web crawlers from the constant port sniffing to my self hosted web services. So I started using Fail2ban, which is a great tool for these specific scenarios.

At first, I set up an instant email notification, but after a day I got way too much emails to handle - kept receiving about 5 to 10 emails per hour!! (Damn you hackers!! 😄 ).

So I thought it would be interesting to have a summary report of the bans/unbans during the last hour instead. Basically, Fail2ban writes the new ban/unban action to a file, which is later on read by a script which emails the results and deletes the file.

These are the lines I used for the ban/unban actions.

@thehaniak
thehaniak / extroot.sh
Created February 4, 2025 20:30 — forked from nikescar/extroot.sh
openwrt extroot
#!/bin/sh
# openwrt extroot /dev/sda1 ext4 /dev/sda2 swap
# latest version https://downloads.openwrt.org/releases/19.07-SNAPSHOT/targets/ar71xx/generic/
opkg update
opkg install kmod-usb-storage kmod-scsi-core block-mount kmod-fs-ext4 kmod-usb-uhci e2fsprogs fdisk
echo "
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
@thehaniak
thehaniak / Ubuntu_Fedora_Wavlink_WL-UG6902H.md
Last active December 25, 2025 19:38
Multiple screens on Ubuntu and Fedora using Wavlink WL-UG6902H