Last active
February 11, 2023 15:41
-
-
Save chrdek/5212b64dec4901e5f8290d91323f0328 to your computer and use it in GitHub Desktop.
Methods of generating random data for mysql imports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "UserName,Email,FirstName,LastName,Password" > users.csv; | |
for i in $(seq 1 100); | |
do | |
userid=$(uuidgen | sed 's/-//g'); | |
uniqueid=$(echo $userid | head -c 10); | |
echo "$uniqueid,[email protected],FirstName,LastName,$( head -100 /dev/urandom | tr -dc a-zA-Z0-9 | fold -w ${1:-15} | head -1 )" >> users.csv | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "UserName,Email,FirstName,LastName,Password" > users.csv; | |
for i in $(seq 1 100); | |
do | |
echo "$(uuidgen | sed 's/-//g'),$(uuidgen | sed 's/-//g')@temporary.net,FirstName,LastName,$( head -100 /dev/urandom | tr -dc a-zA-Z0-9 | fold -w ${1:-15} | head -1 )" >> users.csv | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "UserName,Email,FirstName,LastName,Password" > users2.csv; | |
for i in $(seq 1 100); | |
do | |
echo "$(uuidgen | sed 's/-//g'),$(uuidgen | sed 's/-//g')@temporary.net,FirstName,LastName,$(head -c 10 /dev/random | base64 | head -c 10)" >> users2.csv | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment