Skip to content

Instantly share code, notes, and snippets.

@staaldraad
Last active October 2, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staaldraad/5ac684b1681de7d5ae1e to your computer and use it in GitHub Desktop.
Save staaldraad/5ac684b1681de7d5ae1e to your computer and use it in GitHub Desktop.
Create a sha256 hash (in uppercase) for each line in a file:
awk '{printf "%s - ",$1 }{"echo -n "$1"|sha256sum"|getline d;split(d,a,"-"); print toupper(a[1])}' notes.txt
For each line in the 'reps.txt' - create a random string of correct length and do a replace.
for i in `cat reps.txt`; do [16:28]
x=`cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w ${#i} | head -n 1`; echo $x;
sed -i "s/$i/$x/g" x6 ;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment