From d1c364b876c50674f9a4c291f470e494cb280ee9 Mon Sep 17 00:00:00 2001 From: "committer@tuxwarrior" Date: Sat, 28 Feb 2026 21:56:08 -0500 Subject: [PATCH] + randoms() --- dots/bash/.bashrc | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/dots/bash/.bashrc b/dots/bash/.bashrc index c6412db..54b92bc 100644 --- a/dots/bash/.bashrc +++ b/dots/bash/.bashrc @@ -104,6 +104,7 @@ lf() { fi } + # --- # superfile (change directory on quit) # --- @@ -161,11 +162,48 @@ nmrestart() { # screens / displays / power management # --- +# n/a + # --- # misc # --- +gpxImporter() { + cd /home/poq/syncDir/gitRepos/gi.op.fo/gpx-importer/go/src/ + go run main.go + cd - +} + +randoms() { + echo "----------" + + ranwrd1=$(shuf -n 1 /usr/share/dict/cracklib-small) + ranwrd1="${ranwrd1//[^[:alpha:]]/}" + ranwrd2=$(shuf -n 1 /usr/share/dict/cracklib-small) + ranwrd2="${ranwrd2//[^[:alpha:]]/}" + rancmd=$(compgen -ac | shuf -n 1) + randnum=$(( 1000 + SRANDOM % 9000 )) + randalp=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 10) + + echo "w1: ${ranwrd1} | w2: ${ranwrd2} | c: ${rancmd} | n: ${randnum} | a: ${randalp}" + + randstr0="${randnum} ${ranwrd1} ${ranwrd2} ${rancmd}_${randalp}" + randstr1="${randnum}_${ranwrd1}_${ranwrd2}_${rancmd}${randalp}" + randstr2="${randnum}${ranwrd1}${ranwrd2}${rancmd//[^[:alpha:]]/}${randalp}" + + echo "s0: ${randstr0}" + echo "s1: ${randstr1}" + echo "s2: ${randstr2}" + + echo "----------" +} + + +# --- +# rotate +# --- + # https://boulderappsco.postach.io/post/convert-decimal-to-base-36-alpha-numeric-in-bash-linux function decimal_to_base36(){ BASE36=($(echo {0..9} {A..Z})); @@ -175,12 +213,6 @@ function decimal_to_base36(){ done && echo } -gpxImporter() { - cd /home/poq/syncDir/gitRepos/gi.op.fo/gpx-importer/go/src/ - go run main.go - cd - -} - rot() { if [[ -n $1 ]] && [[ -n $2 ]] ; then if [[ $1 == "1" ]] ; then