Created
December 17, 2019 22:06
-
-
Save rpigott/524188fe1ea5ad5314ff1d511827abea to your computer and use it in GitHub Desktop.
hackertyper.sh
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/bash | |
if [[ ! -f "$1" ]]; then | |
cat <<-EOF | |
Usage: ${0##*/} [hacking_file] | |
EOF | |
exit 1 | |
fi | |
hack() { | |
stty -echo | |
echo -ne '\x1b[32m' # real hackers hack in green | |
exec 3< "$1" | |
} | |
unhack() { | |
stty echo | |
exec 3<&- | |
echo -e '\x1b[00m' | |
exit | |
} | |
trap unhack INT | |
hack "$1" | |
while read -n1 c | |
do head -c5 <&3 | |
done; unhack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment