+ randoms()
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user