Skip to content

Instantly share code, notes, and snippets.

@rpigott
Created December 17, 2019 22:06
Show Gist options
  • Save rpigott/524188fe1ea5ad5314ff1d511827abea to your computer and use it in GitHub Desktop.
Save rpigott/524188fe1ea5ad5314ff1d511827abea to your computer and use it in GitHub Desktop.
hackertyper.sh
#!/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