Skip to content

Instantly share code, notes, and snippets.

View zoonderkins's full-sized avatar
🏠
Working 👍

Quack~ zoonderkins

🏠
Working 👍
View GitHub Profile
@zoonderkins
zoonderkins / change-mac.sh
Created July 9, 2025 02:12 — forked from nixpulvis/change-mac.sh
Change your MAC address on OS X.
#!/bin/bash
ssid=$(networksetup -getairportnetwork en0 | cut -d ":" -f 2 | sed "s/^[ \t]*//")
sudo airport -z
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.\$//")
networksetup -setairportnetwork en0 "$ssid"
@zoonderkins
zoonderkins / script.md
Created July 9, 2025 00:28
random-reset-mac-address

Linux

INTERFACE=""
NEW_MAC=$(printf '02:%02x:%02x:%02x:%02x:%02x\n' $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)))
sudo ip link set $INTERFACE down
sudo ip link set $INTERFACE address "$NEW_MAC"
sudo ip link set $INTERFACE up
@zoonderkins
zoonderkins / memory.md
Created July 8, 2025 03:12
Linux find memory use
ps -eo pid,comm,%mem --sort=-%mem | head -n 11
@zoonderkins
zoonderkins / cilium-grafana-dashboard.json
Created May 19, 2025 12:58
cilium grafana dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@zoonderkins
zoonderkins / .bashrc
Created May 11, 2025 08:18
.bashrc for Linux bash color prompt
# Last update 2025-05-11
# Author zoonderkins
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
@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