Page MenuHomePhabricator
Paste P8874

Masterwork From Distant Lands
ActivePublic

Authored by Eevans on Aug 6 2019, 5:23 PM.
#!/bin/sh
random_string()
{
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $1 | head -n 1
}
echo "["
for i in {1..1000}; do
key=`random_string 8`
value=`random_string 16`
cat <<EOF
{
"path": "/v1/$key",
"method": "POST",
"body": "$value"
},
EOF
for j in {1..100}; do
cat <<EOF
{
"path": "/v1/$key",
"method": "GET"
EOF
if test $i -eq 1000 && test $j -eq 100; then
cat <<EOF
}
EOF
else
cat <<EOF
},
EOF
fi
done
done
echo "]"

Event Timeline

Eevans edited the content of this paste. (Show Details)Aug 6 2019, 5:23 PM
Eevans changed the title of this paste from untitled to Masterwork From Distant Lands.