Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
NET=10.255.255.248
MASK=255.255.255.248
RULE="POSTROUTING -t nat -s $NET/$MASK -o eth0 -j MASQUERADE"
set -x
echo 1 > /proc/sys/net/ipv4/ip_forward
while true; do
eval iptables -D $RULE
@eshch
eshch / pathdel.sh
Last active February 22, 2018 19:55
Remove path from PATH environment variable
# Don't consider this snippet as helpful. Just some excersize with shell.
# Usually you do not need to remove a path from PATH because you are able not to add
# the the path to it.
# But once you want to move a path from the middle of PATH to head, so you should
# delete it first if you are kind of a perfectionist. :(
# HATE BASH!
# Remove element in joined array like PATH standard environment variable.
del-element()
{