Skip to content

Instantly share code, notes, and snippets.

@za3k

za3k/onerng.sh

Last active Jun 6, 2021
Embed
What would you like to do?
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