Skip to content

Instantly share code, notes, and snippets.

@Lu5ck
Lu5ck / pbr.user.aws
Last active April 19, 2025 13:40
OpenWRT pbr for aws by regions
#!/bin/sh
# shellcheck disable=SC2015,SC3003,SC3060
TARGET_URL='https://ip-ranges.amazonaws.com/ip-ranges.json'
TARGET_DL_FILE='/var/pbr_tmp_aws_ip_ranges.gz'
TARGET_TABLE='inet fw4'
TARGET_INTERFACE='wan'
TARGET_REGIONS='ap-southeast-3 ap-southeast-5 ap-southeast-1 GLOBAL'
trap 'rm -f "$TARGET_DL_FILE"' EXIT
_ret=1
@Lu5ck
Lu5ck / check_mem_leak.sh
Last active January 24, 2024 20:07
Palworld - Dedicated Linux Server Scripts
#Script to check for available memory
#If available memory is below certain amount, it will initiate shutdown
#The shutdown is done via rcon https://github.com/gorcon/rcon-cli
#You can get this script to be execute in crontab
#!/bin/bash
lock_file="/home/Palworld/Palworld/check_mem_leak.lock"
rcon_yaml="/home/Palworld/Palworld/rcon.yaml"
rcon="/home/Palworld/Palworld/rcon"