Created
October 9, 2019 16:18
-
-
Save NotMoni/a9107993f8af02e47a10afc3ca229211 to your computer and use it in GitHub Desktop.
Check for untaken or 404 GitHub Usernames
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
#!/usr/bin/env bash | |
# Exit on error | |
set -e | |
# On MacOS, make sure shuf command is available | |
# All possible combinations of 4 letters, | |
# each on one line for streaming and in random order | |
combinations="$(echo {a..z}{a..z}{a..z}{a..z} | tr " " "\n" | shuf)" | |
echo "possibilities: $(echo "$combinations" | wc -l)" | |
# Filter to only names that 404 on github.com, | |
# 10 in parallel (might still take a while), | |
# and write them to a file | |
echo "$combinations" | xargs -P10 -I{} sh -c "curl -sfI https://github.com/{} > /dev/null || echo {}" > github.txt | |
echo "available on Github: $(wc -l github.txt)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment