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
## based on the blogpost here: http://blog.sjas.de/posts/colored-iptables-output.html | |
iptables --line-numbers -vnL |\ | |
sed -E 's/^Chain.*$/\x1b[4m&\x1b[0m/' |\ | |
sed -E 's/^num.*/\x1b[33m&\x1b[0m/' |\ | |
sed -E '/([^y] )((REJECT|DROP))/s//\1\x1b[31m\3\x1b[0m/' |\ | |
sed -E '/([^y] )(ACCEPT)/s//\1\x1b[32m\2\x1b[0m/' |\ | |
sed -E '/([ds]pt[s]?:)([[:digit:]]+(:[[:digit:]]+)?)/s//\1\x1b[33;1m\2\x1b[0m/' |\ | |
sed -E '/([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}(\/([[:digit:]]){1,3}){0,1}/s//\x1b[36;1m&\x1b[0m/g' |\ | |
sed -E '/([^n] )(LOGDROP)/s//\1\x1b[33;1m\2\x1b[0m/'|\ |
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
// Updated to swift 4.2 | |
func calculateAge(dob : String) -> (Int, Int, Int){ | |
let df = DateFormatter() | |
df.dateFormat = "yyyy-MM-dd" | |
let date = df.date(from: dob) | |
guard let val = date else { | |
return (0, 0, 0) | |
} | |
var years = 0 |
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
# Add these lines | |
batch | |
passphrase-file <Full path to the key.txt file (without tilda)> |