Skip to content

Instantly share code, notes, and snippets.

@lazywithclass
Created November 6, 2017 11:20
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 lazywithclass/14f82efc765a5cfc9034029553e45daa to your computer and use it in GitHub Desktop.
Save lazywithclass/14f82efc765a5cfc9034029553e45daa to your computer and use it in GitHub Desktop.
Simulate work in a directory adding and updating files
#!/bin/bash
while true; do
filename=$(((RANDOM %10) + 1))
if [ -f $filename ]; then
mkfile 30m data/$filename
else
randomstring=$(LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | fold -w ${1:-$(((RANDOM %1000000) +1))} | head -n 1)
echo $randomstring >>data/$filename
fi
git add data/$filename
git commit -m "updated $filename"
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment