Skip to content

Instantly share code, notes, and snippets.

View zoonderkins's full-sized avatar
🏠
Working 👍

Quack~ zoonderkins

🏠
Working 👍
View GitHub Profile
@zoonderkins
zoonderkins / fail2ban.sh
Last active January 12, 2025 07:27
debian 12 and ubuntu install fail2ban script
#!/bin/bash
CHECK_OS(){
if [[ -f /etc/redhat-release ]]; then
release="centos"
elif grep -q -E -i "debian" /etc/issue; then
release="debian"
elif grep -q -E -i "ubuntu" /etc/issue; then
release="ubuntu"
elif grep -q -E -i "centos|red hat|redhat" /etc/issue; then

openconnect vpn server

stek29 May 21 2018

Installing ocserv

Older version (0.10.11) is avaliable in ubuntu repos and it seems to work fine,
but I've built 0.12.1 from sources. This is not neccessary, but might be useful.
Describing building from source is out of scope of these instructions.

@zoonderkins
zoonderkins / block-scam-scanner-provider-fuck.md
Last active November 26, 2024 06:24
block-scam-scanner-provider-fuck.md

Block some abused IP and scanner from scammer services.

wonderful.census.internet-measurement.com
here.SoldCafe.com
security.criminalip.com
azpdcsb97.stretchoid.com
azpdcsb36.stretchoid.com
www.internet-albedo.net
scanner-02.ch1.censys-scanner.com

k0s storage class


    Stop the k0s service.

sudo k0s stop

    Reset previous installation that was done without your customized config file:
@zoonderkins
zoonderkins / iptables-block-port-scan.md
Created November 2, 2024 16:33
iptables-block-portscan

Iptables rules

sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

sudo iptables -A INPUT -m conntrack --ctstate NEW -m recent --set --name PORTSCAN --rsource

sudo iptables -A INPUT -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 5 --name PORTSCAN --rsource -j DROP
@zoonderkins
zoonderkins / k3s-install-without-traefik-servicelb.md
Created October 19, 2024 18:03
k3s install without traefik and servicelb
@zoonderkins
zoonderkins / reinstall-microk8s-on-debian-with-snap.md
Created October 15, 2024 03:55
Reinstall microk8s on Debian with snap

sudo systemctl stop snapd && sudo systemctl disable snapd

# Workaround for https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1998710
# This command is needed starting from Ubuntu 22.10
# Without it an error is returned when running the snapd purge command
# In that case you need to reinstall snapd to cleanly remove it in a second attempt
@zoonderkins
zoonderkins / rclone-mount-s3-bucket-dropbox-tweak.md
Last active September 10, 2024 07:32
rclone mount s3 bucket and dropbox tweak

Rclone copy with s3 and exclude file

rclone copy /root my-s3:/root -P --transfers 6 --multi-thread-cutoff 1P --s3-upload-cutoff=4000M --multi-thread-streams 0 --exclude "node_modules/**" --exclude ".git/**" --exclude ".cache/**" --exclude "postgres/**"

Rclone mount s3 bucket

rclone mount idrive-e2: ~/mount/idrive --vfs-cache-mode minimal --daemon --allow-non-empty --allow-other --vfs-fast-fingerprint --no-modtime
@zoonderkins
zoonderkins / vps-hdd-speedtest.md
Created August 19, 2024 03:57
VPS HDD benchmark

Here is the sample code HDD Speedtest benchmark for VPS

apt-get install hdparm

# Read
hdparm -t /dev/sda

# Write
hdparm -t --direct /dev/sda

First of all, I must say that I'am not a fan or user of Ubuntu. This is just a guide for newcomers, and colleagues that are struggling after the new release with the system changes.

Repositories configurations and system upgrade

Right after fresh install, you must do a system update. Don't delay it, but first, let's configure repositories. Delete the new config for repositories, this can cause problems or new users can get lost configuring it, have friends reporting me that:

sudo rm /etc/apt/sources.list.d/ubuntu.sources