Skip to content

Instantly share code, notes, and snippets.

@leozc
Created January 2, 2018 23:29
Show Gist options
  • Save leozc/041491c0dcb0e38ab5f35d194385d7f1 to your computer and use it in GitHub Desktop.
Save leozc/041491c0dcb0e38ab5f35d194385d7f1 to your computer and use it in GitHub Desktop.
Generate random ASCII file and add to git
TIME=time
for (( i=1; i<=10000000; i++))
do
filename=`cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c 32`
folder=`cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c 2`
mkdir -p $folder
base64 /dev/urandom | head -c 102400 > $folder/$filename.txt
git add $folder/$filename.txt
$TIME -o stat.txt -a -f "%U|%S" git commit . -m"for $filename.txt"
echo $i
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment