Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Bbb23 username generator PRO module – The simplest way to automatically generate Bbb-'ish usernames! And it's even open-source!
- # Portable script! Source code can be copy-pasted into terminal. Use “bbb23 -h” for help.
- version=1.4.2 # Coming soon: With combined parameters support using “getopts”.
- # Coming soon: Debug log.
- # Originally written by Handroid7.
- # You are encouraged to fork, distribute this code.
- # Feel free to modify for customization.
- alias Bbb=Bbb23
- alias bbb23=Bbb23
- alias BBB=Bbb23
- alias bbb=Bbb23
- d8() { date +%Y%m%d%H%M%S ;}
- complete -W '\-n \-b \-t \-h --help' bbb23 Bbb23 bbb Bbb BBB
- function runx() {
- for ((n=0;n<$1;n++))
- do ${*:2}
- done
- }
- function randomletter { head /dev/urandom | tr -dc A-Z | head -c 1 ;}
- function randomnumber { head /dev/urandom | od -d | head -n 1 | tail -c 2 | head -c 1 ;} # Different method for variety.
- function Bbb23 {
- letter1=$(randomletter)
- printf "$letter1" # # B
- printf "$letter1" |tr '[:upper:]' '[:lower:]' # # b
- printf "$letter1" |tr '[:upper:]' '[:lower:]' # # b
- printf "$(randomnumber)""$(randomnumber)" # # 23
- # Options
- if [[ "$@" == *"-b"* ]] ; then printf "\n" ; fi # # Line break if demanded.
- if [[ ! "$@" == *"-n"* ]] && [[ ! "$@" == *"-h"* ]]; then # Requires spaces instead of tabulator (indent) due to copy-paste mess-up.
- if [[ ! $(( $(date +%S) % 2 )) == 0 ]]
- then
- xdg-open "https://www.youtube.com/embed/Dg6HQ8RlPGQ?loop=1&autoplay=1&playlist=Dg6HQ8RlPGQ" # # Easter-egg. Plays the song that reminds me of Bbb23 for unknown reasons, depending on which second the command was run. Pass “-n” option to deactivate.
- xdg-open "https://en.wikipedia.org/wiki/User:Bbb23" # # Glance at Bourdeilles while listening to that music. Get that ultimate Bbb23 experience.
- if [ ! -f Bourdeilles_view.jpg ] ;then ( curl -s -O https://upload.wikimedia.org/wikipedia/commons/8/82/Bourdeilles_view.jpg )&
- fi # Probably the first picture you ever got to stare at after you discovered that your Wikipedia account has been plundered.
- fi
- fi
- BBBrhythm() { sleep "${1:-.298}" ;} # Usually exactly 0.3 seconds (200 beats per minute), but compensating for latency. Manually decrease to “.297” or similar, if your computer is slower.
- BBBdance() { while :; do
- printf B;BBBrhythm
- printf b;BBBrhythm
- printf b;BBBrhythm
- printf 2;BBBrhythm
- printf 3;BBBrhythm
- BBBrhythm
- printf "\b\b\b\b\b \b\b\b\b\b"
- BBBrhythm;BBBrhythm
- done ;}
- # Help
- if [[ "$@" == *"-h"* ]] || [[ "$@" == *"help"* ]]; then echo -e "
- \e[102m\e[30m\nBbb23 username generator – user manual.\e[0m"'
- -h Show help.
- -n Deactivate music easter egg that plays “Dum Dee Dum” depending on whether the current second is odd or even. Odd = play music.
- -b Break line at the end. Same as “echo $(bbb23)”.
- -t Bbb23 error code mode. Matched to “Dum Dee Dum” music.
- Possible usages:
- echo $(bbb23 -n -b) Generates plain output with line break, without playing music.
- runx 100 bbb23 -n -b >>username_suggestions.txt Generates a list of 100 suggested usernames. Choose your file name.
- runx 10 bbb23 -n -b |tee -a username_suggestions.txt Generates a list of 10 suggested usernames while printing them into the terminal.
- '
- fi
- if [[ "$@" == *"-t"* ]] || [[ "$@" == "" ]]; then
- printf "\n\n\e[101mError:\e[0m[CODE]\b\b\b\b\b\b";sleep .85;printf " ";BBBdance
- fi
- }
- read -p "Press to test Bbb23 name generator version $version.";echo -e "Test initiated. Version: $version \n";Bbb23 -n -b -h -t
- : #
Add Comment
Please, Sign In to add comment
Advertisement