Skip to content

Instantly share code, notes, and snippets.

@Menci
Menci / wg_keep_alive.sh
Last active June 24, 2026 09:49
wg_keep_alive, A bash script to workaround NAT bugs
# When there's a upstream NAT bug, WireGuard will never succeed senting packets
# and will never receive any packets then. Detect sent increase while receive not change
# Change a random port for it.
function wg_keep_alive() {
# Wait init
sleep 10
# Configuration
CHECK_INTERVAL=3
MAX_FAILED_CHECKS=3
@nakamuraos
nakamuraos / reset-trial-navicat.sh
Last active July 6, 2026 17:40
Reset trial Navicat 15, Navicat 16, Navicat 17 on Linux
#!/bin/bash
set -euo pipefail
# Author: NakamuraOS <https://github.com/nakamuraos>
# Latest update: 03/19/2025
# Tested with Navicat 15.x, 16.x, and 17.x on Debian and Ubuntu.
BGRED="\e[1;97;41m"
ENDCOLOR="\e[0m"
@lilydjwg
lilydjwg / btrfs-autosnapshot
Last active December 21, 2025 17:04
btrfs-autosnapshot
#!/usr/bin/python3
import os
import datetime
import subprocess
import logging
import tempfile
import contextlib
from pathlib import Path