This file contains 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/sh | |
#change string in file | |
if [[ $# -ne 3 ]]; then | |
echo "Wrong number of arguments" | |
echo "Usage: $0 FILE FROMSTRING TOSTRING" | |
exit 1 | |
fi | |
SED_FILE=$1 |
This file contains 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
#Open firewall for port | |
FW_PORT=9877 | |
iptables -I INPUT 1 -p tcp -m tcp --dport $FW_PORT -j ACCEPT | |
iptables -I INPUT 1 -p tcp -m tcp --sport $FW_PORT -j ACCEPT | |
iptables -I OUTPUT 1 -p tcp -m tcp --sport $FW_PORT -j ACCEPT | |
iptables -I OUTPUT 1 -p tcp -m tcp --dport $FW_PORT -j ACCEPT | |
#save firewall rules | |
/sbin/service iptables save | |
/sbin/service iptables restart |
This file contains 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
import hashlib | |
h = hashlib.new('sha256') | |
h.update(str) | |
print h.hexdigest() |
NewerOlder