This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/nft -f | |
flush ruleset | |
define cloudflare_ipv4 = { | |
103.21.244.0/22, | |
103.22.200.0/22, | |
103.31.4.0/22, | |
104.16.0.0/13, | |
104.24.0.0/14, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
SCRIPTDIR="$(dirname "$(readlink -f "$0")")" | |
if [[ ! -d "${SCRIPTDIR}/logs" ]]; then | |
mkdir -p "${SCRIPTDIR}/logs" || { echo "Error: Failed to create logs directory"; exit 1; } | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bip": "172.31.0.1/24", | |
"default-address-pools": [ | |
{ | |
"base": "172.31.4.0/22", | |
"size": 24 | |
} | |
], | |
"log-driver": "json-file", | |
"log-opts": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
BACKUPDIR="/var/mysqlbackup" | |
BACKUPSUBDIR="${BACKUPDIR}/$(date +'%Y-%m-%d-%H_%M')" | |
mkdir -p ${BACKUPSUBDIR}; ln -snf ${BACKUPSUBDIR} "${BACKUPDIR}/latest" | |
find ${BACKUPDIR} -mindepth 1 -maxdepth 1 -mtime +7 -type d -not -name 'lost+found' -exec rm -rf {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Global:StartPath = $(Get-Location).Path | |
function prompt | |
{ | |
$CurrentPath = $(Get-Location).Path | |
$CurrentPathPrompt = $(Split-Path -Path $CurrentPath -Leaf) | |
if ($Global:StartPath -eq $CurrentPath) |