Skip to content

Instantly share code, notes, and snippets.

@za3k
Last active June 6, 2021 23:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save za3k/64faa4aa0a9ecb338a8af8b0569fccb6 to your computer and use it in GitHub Desktop.
onerng.sh
#!/bin/bash
ONERNG=/dev/ttyACM0
t=onerng.out
stty -F $ONERNG raw -echo clocal -crtscts
echo "cmd0" >$ONERNG # standard noise
echo "cmdO" >$ONERNG # turn it on
stty -F $ONERNG raw -echo clocal -crtscts
gone() {
echo "cmdo" >$ONERNG # turn it off
echo "cmd4" >$ONERNG # turn off noise gathering
echo "cmdw" >$ONERNG # flush entropy pool
}
trap gone EXIT SIGINT SIGTERM SIGHUP
dd if=$ONERNG iflag=fullblock bs=1k "$@"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment