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
grep --color -P '(?<=$SEARCHED_WORD\=)(\s+)?\K([^ ]*) |
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
# Bash utility aliases/functions to read huge CSV files | |
# The both functions read the first n lines from a file | |
# Normal version (open the columnized file in less) | |
readcsv() { | |
local lines=$1 \ | |
filename=$2 | |
head -n "$lines" "$filename" | column -tns ',' | less -S | |
} |
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
def rotate(byte_string, x_times): | |
return "".join( [ chr( (byte + x_times) % 256) for byte in memoryview(byte_string).tolist()]) | |
# exemple | |
rotate(b'\x74\x66\x75\x66\x64\x62\x74\x75\x73\x70\x6f\x70\x6e\x7a\x00', 0xff) |