Skip to content

Instantly share code, notes, and snippets.

@rigomate
rigomate / delete_non_ufw_443.sh
Last active December 13, 2024 08:12
Makes a NAT Forward rule from TCP port 443 to DEST_IP:443
#!/bin/bash
# Create a random temporary file
TEMP_FILE=$(mktemp /tmp/forward_rules.XXXXXX)
# List all rules in the FORWARD chain with line numbers
iptables -L FORWARD -n --line-numbers | grep "dpt:443" | grep -v "ufw" > "$TEMP_FILE"
# Check if any rules were found
if [[ ! -s "$TEMP_FILE" ]]; then
# Depends on
# * Python
# * Pillow (https://pypi.python.org/pypi/Pillow/3.4.2#downloads)
#
# Execute with
# http://superuser.com/questions/276154/automating-the-scanning-of-graphics-files-for-corruption
#
# Source
# http://superuser.com/questions/276154/automating-the-scanning-of-graphics-files-for-corruption
# --------------------
diskspd.exe -c10M -d360 -r -w40 -t8 -o32 -b4k -Sh -L testfile.dat