From 010cef7a25bf8f8381a6d2686e869a0d4f122618 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 13 Nov 2025 18:40:48 -0500 Subject: [PATCH] Se agregan nuevas utilidades y varias mejoras a las existentes. --- fnc_gonzy.sh | 144 ++++++++---------- gnz_cuentaAtras.sh | 97 +++++++++++++ gnz_dado.sh | 15 ++ gnz_fotosRenombrar.sh | 64 +++----- gnz_horaSumar.sh | 34 +++-- gnz_imgAtxt.sh | 18 --- gnz_laHora.sh | 48 ++++++ gnz_numAtxt-EN.sh | 305 +++++++++++++++++++++++++++++++++++++++ gnz_numAtxt-FR.sh | 321 +++++++++++++++++++++++++++++++++++++++++ gnz_pwGenerar.sh | 36 +++++ gnz_qrCrear.sh | 42 +++--- gnz_qrDeco.sh | 5 - gnz_respaldarTermux.sh | 29 +--- gnz_smsEnvio.sh | 68 +++++++++ gnz_test.sh | 16 ++ gnz_txtLorem.sh | 21 +++ gnz_txtOrtog.sh | 53 +++++++ gnz_txtTraducir.sh | 80 ++++++++++ gnz_txtTrucos.sh | 27 ++++ gnz_urlDescifrar.sh | 13 +- gnz_urlValidar.sh | 23 +-- main_dan-one.sh | 15 +- main_gnzTools.sh | 82 +++++++++-- 23 files changed, 1292 insertions(+), 264 deletions(-) create mode 100644 gnz_cuentaAtras.sh create mode 100644 gnz_dado.sh create mode 100644 gnz_laHora.sh create mode 100644 gnz_numAtxt-EN.sh create mode 100644 gnz_numAtxt-FR.sh create mode 100644 gnz_pwGenerar.sh create mode 100644 gnz_smsEnvio.sh create mode 100644 gnz_test.sh create mode 100644 gnz_txtLorem.sh create mode 100644 gnz_txtOrtog.sh create mode 100644 gnz_txtTraducir.sh create mode 100644 gnz_txtTrucos.sh diff --git a/fnc_gonzy.sh b/fnc_gonzy.sh index 585ccda..38aad75 100644 --- a/fnc_gonzy.sh +++ b/fnc_gonzy.sh @@ -1,103 +1,77 @@ #!/bin/bash -############################################################################ -# -# Utilización: fnc_gonzy.sh -# Versión: 20251010 -# Mis funciones y otras utilerias utilizadas -# en mis scripts bash shell. -# -# Funciones: -# center_text($1 texto) -# # Centra $1 en el parrafo. -# display_center($1) -# # Centra varias lineas. Incluso -# # puede ser todo un archivo. -# fnc_gonzy_intro($1 $2 $3) -# # Imprime Titulo $1, Descripcion $2 - # y alguna nota $3 para identificar - # la utilidad y uso de la funcion. -# -# Opciones: -# - Colores y estilos de fuentes. -# https://soloconlinux.org.es/colores-en-bash/ -# -# Limitaciones: -# - -# -############################################################################ # Reset -Color_Off='\033[0m' # Text Reset + Color_Off='\033[0m' # Text Reset # Regular Colors -Black='\033[30m' # Black -Red='\033[31m' # Red -Green='\033[32m' # Green -Yellow='\033[33m' # Yellow -Blue='\033[34m' # Blue -Purple='\033[35m' # Purple -Cyan='\033[36m' # Cyan -White='\033[37m' # White + Black='\033[30m' # Black + Red='\033[31m' # Red + Green='\033[32m' # Green + Yellow='\033[33m' # Yellow + Blue='\033[34m' # Blue + Purple='\033[35m' # Purple + Cyan='\033[36m' # Cyan + White='\033[37m' # White # Bold -BBlack='\033[1;30m' # Black -BRed='\033[1;31m' # Red -BGreen='\033[1;32m' # Green -BYellow='\033[1;33m' # Yellow -BBlue='\033[1;34m' # Blue -BPurple='\033[1;35m' # Purple -BCyan='\033[1;36m' # Cyan -BWhite='\033[1;37m' # White + BBlack='\033[1;30m' # Black + BRed='\033[1;31m' # Red + BGreen='\033[1;32m' # Green + BYellow='\033[1;33m' # Yellow + BBlue='\033[1;34m' # Blue + BPurple='\033[1;35m' # Purple + BCyan='\033[1;36m' # Cyan + BWhite='\033[1;37m' # White # Cursive -CBlack='\033[3;30m' # Black -CRed='\033[3;31m' # Red -CGreen='\033[3;32m' # Green -CYellow='\033[3;33m' # Yellow -CBlue='\033[3;34m' # Blue -CPurple='\033[3;35m' # Purple -CCyan='\033[3;36m' # Cyan -CWhite='\033[3;37m' # White + CBlack='\033[3;30m' # Black + CRed='\033[3;31m' # Red + CGreen='\033[3;32m' # Green + CYellow='\033[3;33m' # Yellow + CBlue='\033[3;34m' # Blue + CPurple='\033[3;35m' # Purple + CCyan='\033[3;36m' # Cyan + CWhite='\033[3;37m' # White # Underline -UBlack='\033[4;30m' # Black -URed='\033[4;31m' # Red -UGreen='\033[4;32m' # Green -UYellow='\033[4;33m' # Yellow -UBlue='\033[4;34m' # Blue -UPurple='\033[4;35m' # Purple -UCyan='\033[4;36m' # Cyan -UWhite='\033[4;37m' # White + UBlack='\033[4;30m' # Black + URed='\033[4;31m' # Red + UGreen='\033[4;32m' # Green + UYellow='\033[4;33m' # Yellow + UBlue='\033[4;34m' # Blue + UPurple='\033[4;35m' # Purple + UCyan='\033[4;36m' # Cyan + UWhite='\033[4;37m' # White # Background -On_Black='\033[m' # Black -On_Red='\033[m' # Red -On_Green='\033[m' # Green -On_Yellow='\033[m' # Yellow -On_Blue='\033[m' # Blue -On_Purple='\033[m' # Purple -On_Cyan='\033[m' # Cyan -On_White='\033[m' # White + On_Black='\033[m' # Black + On_Red='\033[m' # Red + On_Green='\033[m' # Green + On_Yellow='\033[m' # Yellow + On_Blue='\033[m' # Blue + On_Purple='\033[m' # Purple + On_Cyan='\033[m' # Cyan + On_White='\033[m' # White # High Intensity -IBlack='\033[90m' # Black -IRed='\033[91m' # Red -IGreen='\033[92m' # Green -IYellow='\033[93m' # Yellow -IBlue='\033[94m' # Blue -IPurple='\033[95m' # Purple -ICyan='\033[96m' # Cyan -IWhite='\033[97m' # White + IBlack='\033[90m' # Black + IRed='\033[91m' # Red + IGreen='\033[92m' # Green + IYellow='\033[93m' # Yellow + IBlue='\033[94m' # Blue + IPurple='\033[95m' # Purple + ICyan='\033[96m' # Cyan + IWhite='\033[97m' # White # Bold High Intensity -BIBlack='\033[90m' # Black -BIRed='\033[91m' # Red -BIGreen='\033[92m' # Green -BIYellow='\033[93m' # Yellow -BIBlue='\033[94m' # Blue -BIPurple='\033[95m' # Purple -BICyan='\033[96m' # Cyan -BIWhite='\033[97m' # White + BIBlack='\033[90m' # Black + BIRed='\033[91m' # Red + BIGreen='\033[92m' # Green + BIYellow='\033[93m' # Yellow + BIBlue='\033[94m' # Blue + BIPurple='\033[95m' # Purple + BICyan='\033[96m' # Cyan + BIWhite='\033[97m' # White center_text() { local text="$1" @@ -119,9 +93,9 @@ display_center() { function fnc_gonzy_intro(){ clear echo -e "${UWhite}" - center_text $1 + center_text "$1" echo -e "${Color_Off}${CWhite}$2${Color_Off}${UWhite}" - center_text $3 + center_text "$3" echo -e "\n${Color_Off}" } diff --git a/gnz_cuentaAtras.sh b/gnz_cuentaAtras.sh new file mode 100644 index 0000000..7a41667 --- /dev/null +++ b/gnz_cuentaAtras.sh @@ -0,0 +1,97 @@ +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "Cuenta Atras" "Cuenta regresiva." + + read -p "Segundos?: " VarCountSec; + #read -p "Pantalla completa?: " VarCountTip; + read -p "Pantalla completa (S/N)?: " -n 1 -r VarCountTip + #if [$VarCountTip ==""]; then + if [[ ! $VarCountTip =~ ^[Ss]$ ]] then + countdown_a $VarCountSec + else + countdown_b $VarCountSec + fi +} + +function countdown_a(){ + seconds=$1 + vsec=$seconds + vlim=3 + vlim_a=$(((seconds/vlim)*2)) + vlim_b=$((seconds/vlim)) + start="$(($(date +%s) + $seconds))" + clear + while [ "$start" -ge `date +%s` ]; do + clear + time="$(( $start - `date +%s` ))" + if [ $vsec -le $vlim_a ]; then + echo -e "${Yellow}"; + printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)" | figlet; + echo -e "${Color_Off}"; + if [ $vsec -le $vlim_b ]; then + clear + echo -e "${Red}"; + printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)" | figlet; + echo -e "${Color_Off}"; + fi + else + echo -e "${Green}"; + printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)" | figlet; + echo -e "${Color_Off}"; + fi + sleep 1 + vsec=$((vsec - 1)) + done + fnc_msg_color 2 "Tiempo terminado!" + echo -e "\n" +} + +function countdown_b(){ + Set Variables + cols=$( tput cols ) + rows=$( tput lines ) + middle_row=$(( $rows / 2 )) + middle_col=$(( ($cols /2) - 4 )) + hour=0 + min=0 + sec=$1 + + donso () { + tput sgr0 + tput cup $( tput lines ) 0 + tput cnorm +} + + tput clear + tput bold + tput civis + while [ $hour -ge 0 ]; do + while [ $min -ge 0 ]; do + while [ $sec -ge 0 ]; do + if [ "$hour" -eq "0" ] && [ "$min" -eq "0" ]; then + tput setab 3 + tput clear + fi + if [ "$hour" -eq "0" ] && [ "$min" -eq "0" ] && [ "$sec" -le "10" ]; then + tput setab 1 + tput clear + fi + tput cup $middle_row $middle_col + echo -ne "$(printf %02d:%02d:%02d $hour $min $sec)\e" + let "sec=sec-1" + sleep 1 + done + sec=59 + let "min=min-1" + done + min=59 + let "hour=hour-1" + done + echo -e "${RESET}" + +donso +} + + +fnc_principal \ No newline at end of file diff --git a/gnz_dado.sh b/gnz_dado.sh new file mode 100644 index 0000000..33af29c --- /dev/null +++ b/gnz_dado.sh @@ -0,0 +1,15 @@ +#!/bin/sh +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "Dado virtual" "Muestra nunero entre 1 y 6 aleatoriamente." + + echo -e "" + fnc_msg_color 2 "Dado girando." + sleep 1 + shuf -i 1-6 -n 1 | figlet -c -t | lolcat + fnc_msg_color 1 "Tataaaaan." + echo -e "\n" +} + +fnc_principal $url_validar \ No newline at end of file diff --git a/gnz_fotosRenombrar.sh b/gnz_fotosRenombrar.sh index 5a2df13..5e364dd 100644 --- a/gnz_fotosRenombrar.sh +++ b/gnz_fotosRenombrar.sh @@ -1,39 +1,17 @@ #!/bin/bash -# Ultima Modif: 20251010 -# Utilidad que quita el prefijo IMG en las fotos -# ubicadas en ~/storage/dcim/Camera -############################################################################ -# -# Utilización: fotosRenombrar.sh -# Versión: 20251017 -# Utilidad que quita prefijo IMG en fotos -# ubicadas en ~/storage/dcim/Camera. -# -# Funciones: -# Varias pero sin relevancia para usr. -# -# Opciones: -# - Solo se llama al archivo sin parametros. -# -# Limitaciones: -# - Ruta fija. -# -############################################################################ - source fnc_gonzy.sh -fnc_gonzy_intro "Fotos_s/IMG" "Elimina prefijo IMG_ de imagenes.\nalmacebadas en ~/storage/dcim/Camera/" +function fnc_principal(){ + fnc_gonzy_intro "Fotos_s/IMG" "Elimina prefijo IMG_ de imagenes.\nalmacebadas en ~/storage/dcim/Camera/" -fnc_msg_color 2 "Buscando prefijo." -sleep 1 -cuenta=$(ls ~/storage/dcim/Camera/IMG_*.jpg -1 | wc -l) -fnc_msg_color 1 "$cuenta archivos encontrados." -echo -e "\n" -read -p "Ver listado [s/n]?: " -n 1 -r -if [[ ! $REPLY =~ ^[Ss]$ ]] then -echo "" -else -# Ejecutar vista previa + fnc_msg_color 2 "Buscando prefijo." + sleep 1 + cuenta=$(ls ~/storage/dcim/Camera/IMG_*.jpg -1 | wc -l) + fnc_msg_color 1 "$cuenta archivos encontrados." + echo -e "\n" + read -p "Ver listado [s/n]?: " -n 1 -r + if [[ ! $REPLY =~ ^[Ss]$ ]] then + echo "" echo -e "\n" fnc_msg_color 2 "Generando listado." sleep 1 @@ -42,13 +20,12 @@ else do NEWFILE=`echo $FILE | sed 's/IMG/_/g'` ; echo -e "${Gray}$FILE${Color_Off} » ${Green}$NEWFILE${Color_Off}" ; done -fi -# Ejecutar cambio de nombre(s) -echo "" -read -p "Realizar cambios [s/n]?: " -n 1 -r -if [[ ! $REPLY =~ ^[Ss]$ ]] then + fi + echo "" + read -p "Realizar cambios [s/n]?: " -n 1 -r + if [[ ! $REPLY =~ ^[Ss]$ ]] then echo "" -else + else echo "" clear for FILE @@ -62,9 +39,10 @@ else ls -C ~/storage/dcim/Camera/ echo "" fnc_msg_color 1 "Renombrado terminado!" -fi + fi + fnc_msg_color 2 "Terminando programa!" + echo -e "" + sleep 1 +} -fnc_msg_color 2 "Terminando programa!" -echo -e "" -sleep 1 -#clear \ No newline at end of file +fnc_principal \ No newline at end of file diff --git a/gnz_horaSumar.sh b/gnz_horaSumar.sh index 50217fa..4f8ac58 100644 --- a/gnz_horaSumar.sh +++ b/gnz_horaSumar.sh @@ -1,20 +1,22 @@ #!/bin/bash -# Ultima Modif: 20251010 -# Suma mimutos a la hora actual. - source fnc_gonzy.sh -fnc_gonzy_intro "Now()+min" "Sumar minutos a la hora actual." -echo "" -read -p "Cuantos minutos sumar?: " VarMinus -clear -VarAhora=`date +"%Y-%m-%d %H:%M:%S"` -VarFuturo=`date -d "now + $VarMinus minutes" +"%Y-%m-%d %H:%M:%S"` +function fnc_principal(){ + fnc_gonzy_intro "Now()+min" "Sumar minutos a la hora actual." + + echo "" + read -p "Cuantos minutos sumar?: " VarMinus + clear + VarAhora=`date +"%Y-%m-%d %H:%M:%S"` + VarFuturo=`date -d "now + $VarMinus minutes" +"%Y-%m-%d %H:%M:%S"` + + fnc_msg_color 2 "$VarAhora" + fnc_msg_color 2 " + $VarMinus min" + fnc_msg_color 2 "$VarFuturo" + sleep 1 + echo -e "\n" + fnc_msg_color 1 "Servido Gonzy!" + echo -e "\n" +} -fnc_msg_color 2 "$VarAhora" -fnc_msg_color 2 " + $VarMinus min" -fnc_msg_color 2 "$VarFuturo" -sleep 1 -echo -e "\n" -fnc_msg_color 1 "Servido Gonzy!" -echo -e "\n" \ No newline at end of file +fnc_principal \ No newline at end of file diff --git a/gnz_imgAtxt.sh b/gnz_imgAtxt.sh index ba646c8..d2a3b92 100644 --- a/gnz_imgAtxt.sh +++ b/gnz_imgAtxt.sh @@ -1,22 +1,4 @@ #!/bin/bash -############################################################################ -# -# Utilización: imgAtxt.sh -# Versión: 20251017 -# Utilidad que quita prefijo IMG en fotos -# ubicadas en ~/storage/dcim/Camera. -# -# Funciones: -# Varias pero sin relevancia para usr. -# -# Opciones: -# - Solo se llama al archivo sin parametros. -# -# Limitaciones: -# - Ruta fija. -# -############################################################################ - source fnc_gonzy.sh getHelp () { diff --git a/gnz_laHora.sh b/gnz_laHora.sh new file mode 100644 index 0000000..16ff32f --- /dev/null +++ b/gnz_laHora.sh @@ -0,0 +1,48 @@ +#!/bin/bash +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "URL_Verificar" "Verifica que URL exista." + + varFecha=`date +"%Y/%m/%d %H:%M:%S"` + varHorMex=$(TZ="America/Mexico_City" date) + + fnc_horaAhora "$varFecha" + fnc_horaMXCA "$varHorMex" +} + +function fnc_horaAhora(){ + + varNomMes=`date +"%B"` + varNomMesAbr=`date +"%b"` + varNumMes=`date +"%m"` + varNomDia=`date +"%A"` + varNomDiaMes=`date +"%d"` + varNomDiaAbr=`date +"%a"` + varNumDia=`date +"%w"` + varNumAno=`date +"%Y"` + varNumSem=$(date +%V) + + fnc_msg_color 3 "Hoy es $1" + fnc_msg_color 2 "" + sleep 1 + fnc_msg_color 3 "Año $varNumAno" + fnc_msg_color 3 "Semana $varNumSem" + fnc_msg_color 3 "Día semana $varNumDia - $varNomDia ($varNomDiaAbr)" + fnc_msg_color 3 "Mes $varNumMes - $varNomMes ($varNomMesAbr)" + fnc_msg_color 3 "Día mes $varNomDiaMes" + + echo -e "\n" +} + +function fnc_horaMXCA(){ + fnc_msg_color 3 "La hora en México." + fnc_msg_color 2 "" + sleep 1 + fnc_msg_color 3 "$1" + + echo -e "" + sleep 1 +} + +fnc_principal diff --git a/gnz_numAtxt-EN.sh b/gnz_numAtxt-EN.sh new file mode 100644 index 0000000..f07c9d6 --- /dev/null +++ b/gnz_numAtxt-EN.sh @@ -0,0 +1,305 @@ +#!/bin/bash +# Developed By Chetan Khatri +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "Numero a texto (EN)" "Obtiene el texto (en inglés) del número \ningresado, hasta 15 dígitos.\nAdaptado por Gonzy." + numberEN=0 + read -p "Número?: " numberEN; + + number=`echo $numberEN | sed s/' '/''/g` + + if [[ $? -gt 0 || -z $number ]] ; then + echo -e "\n *****Error : Número incorrecto \n" + exit 1 + fi + + if ! [[ "$number" =~ ^[0-9]+$ ]] ; then + exec >&2; echo -e "\n *****Error: No es un entero. \n"; exit 1 + fi + + number=`echo "$number * 1" | bc 2> /dev/null` + + GlobalLength=`expr length $number` + + [ $GlobalLength -gt 15 ] && echo -e "\n *****Error : Longitud incorrecta ( $number ~~> $GlobalLength Digitos) \n" && exit 1 + + Convert + exit +} + +function One(){ + local n=$1 + if [ $n -eq "1" ] ; then + words=`echo -n "$words One"` + elif [ $n -eq "2" ] ; then + words=`echo -n "$words Two"` + elif [ $n -eq "3" ] ; then + words=`echo -n "$words Three"` + elif [ $n -eq "4" ] ; then + words=`echo -n "$words Four"` + elif [ $n -eq "5" ] ; then + words=`echo -n "$words Five"` + elif [ $n -eq "6" ] ; then + words=`echo -n "$words Six"` + elif [ $n -eq "7" ] ; then + words=`echo -n "$words Seven"` + elif [ $n -eq "8" ] ; then + words=`echo -n "$words Eight"` + elif [ $n -eq "9" ] ; then + words=`echo -n "$words Nine"` + elif [[ $GlobalLength -lt "2" && $n -eq "0" ]] ; then + words="Zero" + fi +} + +function Two(){ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:1}` + if [ $n -eq "0" ] ; then + One $p + elif [[ $n -eq "1" && $p -eq "0" ]] ; then + words=`echo -n "$words Ten"` + elif [[ $n -eq "1" && $p -eq "1" ]] ; then + words=`echo -n "$words Eleven"` + elif [[ $n -eq "1" && $p -eq "2" ]] ; then + words=`echo -n "$words Twelve"` + elif [[ $n -eq "1" && $p -eq "3" ]] ; then + words=`echo -n "$words Thirteen"` + elif [[ $n -eq "1" && $p -eq "4" ]] ; then + words=`echo -n "$words Fourteen"` + elif [[ $n -eq "1" && $p -eq "5" ]] ; then + words=`echo -n "$words Fifteen"` + elif [[ $n -eq "1" && $p -eq "6" ]] ; then + words=`echo -n "$words Sixteen"` + elif [[ $n -eq "1" && $p -eq "7" ]] ; then + words=`echo -n "$words Seventeen"` + elif [[ $n -eq "1" && $p -eq "8" ]] ; then + words=`echo -n "$words Eighteen"` + elif [[ $n -eq "1" && $p -eq "9" ]] ; then + words=`echo -n "$words Nineteen"` + elif [[ $n -eq "2" ]] ; then + words=`echo -n "$words Twenty"` + One $p + elif [[ $n -eq "3" ]] ; then + words=`echo -n "$words Thirty"` + One $p + elif [[ $n -eq "4" ]] ; then + words=`echo -n "$words Forty"` + One $p + elif [[ $n -eq "5" ]] ; then + words=`echo -n "$words Fifty"` + One $p + elif [[ $n -eq "6" ]] ; then + words=`echo -n "$words Sixty"` + One $p + elif [[ $n -eq "7" ]] ; then + words=`echo -n "$words Seventy"` + One $p + elif [[ $n -eq "8" ]] ; then + words=`echo -n "$words Eighty"` + One $p + elif [[ $n -eq "9" ]] ; then + words=`echo -n "$words Ninety"` + One $p + fi + +} + +function Three(){ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:2}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Hundred"` + + fi + Two $p +} + +function Four(){ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:3}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Thousand,"` + + fi + Three $p +} + +function Five(){ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:3}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Thousand,"` + + fi + Three $p +} + +function Six(){ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:5}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Thousand,"` + + fi + Three $p +} + +function Seven(){ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:6}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Million,"` + + fi + Six $p +} + +function Eight(){ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:7}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Million,"` + + fi + Six $p +} + +function Nine(){ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:8}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Million,"` + # + fi + Six $p +} + +function Ten(){ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:9}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Billion,"` + # + fi + Nine $p +} + +function Eleven(){ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:10}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Billion,"` + + fi + Nine $p +} + +function Twelve(){ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:11}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Billion,"` + + fi + Nine $p +} + +function Thirteen(){ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:12}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Trillion,"` + # + fi + Twelve $p +} + +function Fourteen(){ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:13}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Trillion,"` + + fi + Twelve $p +} + +function Fifteen(){ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:14}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Trillion,"` + + fi + Twelve $p +} + +function Convert(){ + if [ $GlobalLength -eq "15" ] ; then + Fifteen $number + elif [ $GlobalLength -eq "14" ] ; then + Fourteen $number + elif [ $GlobalLength -eq "13" ] ; then + Thirteen $number + elif [ $GlobalLength -eq "12" ] ; then + Twelve $number + elif [ $GlobalLength -eq "11" ] ; then + Eleven $number + elif [ $GlobalLength -eq "10" ] ; then + Ten $number + elif [ $GlobalLength -eq "9" ] ; then + Nine $number + elif [ $GlobalLength -eq "8" ] ; then + Eight $number + elif [ $GlobalLength -eq "7" ] ; then + Seven $number + elif [ $GlobalLength -eq "6" ] ; then + Six $number + elif [ $GlobalLength -eq "5" ] ; then + Five $number + elif [ $GlobalLength -eq "4" ] ; then + Four $number + elif [ $GlobalLength -eq "3" ] ; then + Three $number + elif [ $GlobalLength -eq "2" ] ; then + Two $number + else + One $number + fi + fnc_msg_color 2 "Procesando." + sleep 1 + echo -e "\n" + fnc_msg_color 1 "$words" + echo -e "\n" +} + +fnc_principal \ No newline at end of file diff --git a/gnz_numAtxt-FR.sh b/gnz_numAtxt-FR.sh new file mode 100644 index 0000000..46d54c8 --- /dev/null +++ b/gnz_numAtxt-FR.sh @@ -0,0 +1,321 @@ +#!/bin/bash +# Developed By Chetan Khatri +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "Numero a texto (FR)" "Obtiene el texto (en frances) del número \ningresado, hasta 15 dígitos.\nAdaptado por Gonzy." + + read -p "Número?: " number; + + number=`echo $number | sed s/' '/''/g` + + if [[ $? -gt 0 || -z $number ]] ; then + echo -e "\n *****Error : Número incorrecto \n" + exit 1 + fi + + if ! [[ "$number" =~ ^[0-9]+$ ]] ; then + exec >&2; echo -e "\n *****Error: No ea un entero. \n"; exit 1 + fi + + number=`echo "$number * 1" | bc 2> /dev/null` + + GlobalLength=`expr length $number` + + [ $GlobalLength -gt 15 ] && echo -e "\n *****Error : Longitud incorrecta ( $number ~~> $GlobalLength Digitos) \n" && exit 1 + + Convert + exit +} + +function One() +{ + local n=$1 + if [ $n -eq "1" ] ; then + words=`echo -n "$words Un"` + elif [ $n -eq "2" ] ; then + words=`echo -n "$words Deux"` + elif [ $n -eq "3" ] ; then + words=`echo -n "$words Trois"` + elif [ $n -eq "4" ] ; then + words=`echo -n "$words Quatre"` + elif [ $n -eq "5" ] ; then + words=`echo -n "$words Cinq"` + elif [ $n -eq "6" ] ; then + words=`echo -n "$words Six"` + elif [ $n -eq "7" ] ; then + words=`echo -n "$words Sept"` + elif [ $n -eq "8" ] ; then + words=`echo -n "$words Huit"` + elif [ $n -eq "9" ] ; then + words=`echo -n "$words Neuf"` + elif [[ $GlobalLength -lt "2" && $n -eq "0" ]] ; then + words="Zéro" + fi +} + +function Two() +{ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:1}` + if [ $n -eq "0" ] ; then + One $p + elif [[ $n -eq "1" && $p -eq "0" ]] ; then + words=`echo -n "$words Dix"` + elif [[ $n -eq "1" && $p -eq "1" ]] ; then + words=`echo -n "$words Onze"` + elif [[ $n -eq "1" && $p -eq "2" ]] ; then + words=`echo -n "$words Douze"` + elif [[ $n -eq "1" && $p -eq "3" ]] ; then + words=`echo -n "$words Treize"` + elif [[ $n -eq "1" && $p -eq "4" ]] ; then + words=`echo -n "$words Quatorze"` + elif [[ $n -eq "1" && $p -eq "5" ]] ; then + words=`echo -n "$words Quinze"` + elif [[ $n -eq "1" && $p -eq "6" ]] ; then + words=`echo -n "$words Seize"` + elif [[ $n -eq "1" && $p -eq "7" ]] ; then + words=`echo -n "$words Dix-sept"` + elif [[ $n -eq "1" && $p -eq "8" ]] ; then + words=`echo -n "$words Dix-huit"` + elif [[ $n -eq "1" && $p -eq "9" ]] ; then + words=`echo -n "$words Dix-neuf"` + elif [[ $n -eq "2" ]] ; then + words=`echo -n "$words Vingt"` + One $p + elif [[ $n -eq "3" ]] ; then + words=`echo -n "$words Trente"` + One $p + elif [[ $n -eq "4" ]] ; then + words=`echo -n "$words Quarante"` + One $p + elif [[ $n -eq "5" ]] ; then + words=`echo -n "$words Cinquante"` + One $p + elif [[ $n -eq "6" ]] ; then + words=`echo -n "$words Soixante"` + One $p + elif [[ $n -eq "7" ]] ; then + words=`echo -n "$words Soixante-dix"` + One $p + elif [[ $n -eq "8" ]] ; then + words=`echo -n "$words Quatre-vingts"` + One $p + elif [[ $n -eq "9" ]] ; then + words=`echo -n "$words Quatre-vingt-dix"` + One $p + fi + +} + +function Three() +{ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:2}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Cent"` + + fi + Two $p +} + +function Four() +{ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:3}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Mille,"` + + fi + Three $p +} + +function Five() +{ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:3}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Thousand,"` + + fi + Three $p +} + +function Six() +{ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:5}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Thousand,"` + + fi + Three $p +} + +function Seven() +{ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:6}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Million,"` + + fi + Six $p +} + +function Eight() +{ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:7}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Million,"` + + fi + Six $p +} + +function Nine() +{ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:8}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Million,"` + # + fi + Six $p +} + +function Ten() +{ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:9}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Billion,"` + # + fi + Nine $p +} + +function Eleven() +{ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:10}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Billion,"` + + fi + Nine $p +} + +function Twelve() +{ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:11}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Billion,"` + + fi + Nine $p +} + +function Thirteen() +{ + local num=$1 + local n=`echo ${num:0:1}` + local p=`echo ${num:1:12}` + if [ $n -gt 0 ] ; then + One $n + words=`echo "$words Trillion,"` + # + fi + Twelve $p +} + +function Fourteen() +{ + local num=$1 + local n=`echo ${num:0:2}` + local p=`echo ${num:2:13}` + if [ $n -gt 0 ] ; then + Two $n + words=`echo "$words Trillion,"` + + fi + Twelve $p +} + +function Fifteen() +{ + local num=$1 + local n=`echo ${num:0:3}` + local p=`echo ${num:3:14}` + if [ $n -gt 0 ] ; then + Three $n + words=`echo "$words Trillion,"` + + fi + Twelve $p +} + +function Convert() +{ + if [ $GlobalLength -eq "15" ] ; then + Fifteen $number + elif [ $GlobalLength -eq "14" ] ; then + Fourteen $number + elif [ $GlobalLength -eq "13" ] ; then + Thirteen $number + elif [ $GlobalLength -eq "12" ] ; then + Twelve $number + elif [ $GlobalLength -eq "11" ] ; then + Eleven $number + elif [ $GlobalLength -eq "10" ] ; then + Ten $number + elif [ $GlobalLength -eq "9" ] ; then + Nine $number + elif [ $GlobalLength -eq "8" ] ; then + Eight $number + elif [ $GlobalLength -eq "7" ] ; then + Seven $number + elif [ $GlobalLength -eq "6" ] ; then + Six $number + elif [ $GlobalLength -eq "5" ] ; then + Five $number + elif [ $GlobalLength -eq "4" ] ; then + Four $number + elif [ $GlobalLength -eq "3" ] ; then + Three $number + elif [ $GlobalLength -eq "2" ] ; then + Two $number + else + One $number + fi + fnc_msg_color 2 "Procesando." + sleep 1 + echo -e "\n" + fnc_msg_color 1 "$words" + echo -e "\n" +} + +fnc_principal \ No newline at end of file diff --git a/gnz_pwGenerar.sh b/gnz_pwGenerar.sh new file mode 100644 index 0000000..142a78f --- /dev/null +++ b/gnz_pwGenerar.sh @@ -0,0 +1,36 @@ +#!/bin/bash +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "Generar PW" "Sugerencias de passwords." + + read -p "Longitud?: " v1; + echo -e "\n" + fnc_msg_color 2 "Generando sugerencias." + sleep 1 + echo -e "\n" + + pw1=$(gpg --gen-random --armor 1 $v1) + pw2=$(openssl rand -base64 $v1) + pw3=$(diceware -d "-" -w es -n $v1 -s $v1) + pw4=$(pwgen -ycsB1 $v1 5) + + fnc_msg_color 3 "GPG:" + echo -e "\n${Green}$pw1${Color_Off}\n" + fnc_msg_color 3 "OPENSSL:" + echo -e "\n${Green}$pw2${Color_Off}\n" + fnc_msg_color 3 "DICEWARE:" + echo -e "\n${Green}$pw3${Color_Off}\n" + echo -e "\n" + fnc_msg_color 3 "...5 mas con PWGEN" + echo -e "\n${Green}$pw4${Color_Off}\n" + echo -e "\n" + fnc_msg_color 3 "...5 NIPs" + echo -e "\n${Green}" + shuf -i 1000-9999 -n 5 + echo -e "${Color_Off}\n" + fnc_msg_color 2 "" + echo -e "\n" +} + +fnc_principal \ No newline at end of file diff --git a/gnz_qrCrear.sh b/gnz_qrCrear.sh index 47ba8e4..86393bb 100644 --- a/gnz_qrCrear.sh +++ b/gnz_qrCrear.sh @@ -1,16 +1,12 @@ #!/bin/bash -# Ultima Modif: 20251012 -# Convertir JPG o PNG a TXT. - source fnc_gonzy.sh function fnc_principal(){ fnc_gonzy_intro "QR_Crear" "Crea código QR." - PS3="Tipo de QR?: " + PS3="Opción?: " items=( -"Texto" +"Txt & URL" "Texto.TXT" -"URL" "Email" "SMS" "vCard" @@ -23,15 +19,26 @@ while true; do case $REPLY in 1) clear; - read -p "Texto: " VarQR; + read -p "Texto o URL?: " VarQR; fnc_qr_gral "txt" $VarQR; break;; 2) clear; - source qr.sh; + fnc_msg_color 2 "Generando listado." + sleep 1 + echo -e "\n" + ls ~/storage/shared/Documents/txt2qr + echo -e "\n" + read -p "Archivo?: " VarQR; + fnc_qr_gral "file" $VarQR; break;; - 3) - source qr.sh; + 3) + clear; + read -p "Dirección?: " VarQR_mail; + read -p "Asunto?: " VarQR_subject; + read -p "Mensaje?: " VarQR_body; + vvs="$VarQR_subject" + fnc_qr_gral "mail" "mailto:$VarQR_mail?subject=$vvs&body=$VarQR_body"; break;; 4) source qr.sh; @@ -46,13 +53,7 @@ while true; do 7) source qr.sh; break;; - 8) - source qr.sh; - break;; $((${#items[@]}+1))) - #clear; - #cowsay "..." | lolcat; - #echo -e "\n"; source main_gnzTools.sh; break 2;; *) @@ -69,16 +70,19 @@ while true; do function fnc_qr_gral(){ dt=`date +%Y%m%d_%H%M%S` fnc_msg_color 2 "Generando QR." - var_qr=$(qrencode -o ~/storage/shared/Documents/qr2txt/qr-$1_$dt.png -t png -s 15 $2) + if [[ $1 == 'file' ]]; then + var_qr=$(qrencode -o ~/storage/shared/Documents/qr2txt/qr-$1_$dt.png -t png -s 15 -r ~/storage/shared/Documents/txt2qr/$2) + else + var_qr=$(qrencode -o ~/storage/shared/Documents/qr2txt/qr-$1_$dt.png -t png -s 15 $2) + fi sleep 1 fnc_msg_color 1 "Código QR generado." + echo -e "\n" fnc_msg_color 3 "qr-$1_$dt.png" echo -e "\n" ls ~/storage/shared/Documents/qr2txt/ echo -e "\n" - #fnc_msg_color 2 "Abriendo QR." sleep 1 - #xdg-open ~/storage/shared/Documents/qr2txt/qr-$1_$dt.png echo -e "\n" } diff --git a/gnz_qrDeco.sh b/gnz_qrDeco.sh index 27eec76..929df8f 100644 --- a/gnz_qrDeco.sh +++ b/gnz_qrDeco.sh @@ -1,7 +1,4 @@ #!/bin/bash -# Ultima Modif: 20251012 -# Decodificar QR como TXT sin abrir enlaces. - source fnc_gonzy.sh function fnc_principal(){ @@ -12,10 +9,8 @@ function fnc_principal(){ fnc_msg_color 2 "Generando listado." sleep 1 echo -e "\n" - ls ~/storage/shared/Documents/qr2txt echo -e "\n" - fnc_msg_color 1 "Listado terminado." echo -e "\n" read -p "Nombre de QR?: " VarQR diff --git a/gnz_respaldarTermux.sh b/gnz_respaldarTermux.sh index b3a621c..d2d67fc 100644 --- a/gnz_respaldarTermux.sh +++ b/gnz_respaldarTermux.sh @@ -1,26 +1,9 @@ #!/bin/bash -############################################################################# -# -# Utilización: respaldarTermux.sh -# Versión: 20251016 -# Crear respaldo en archivo comprimido -# de listado con nombre de fecha y hora -# en que se creó. -# -# Funciones: -# - fncComprimir -# -# Opciones: -# - $ nombre del archivo de respaldo. -# -# Limitaciones: -# - Ruta fija. -# -############################################################################ - source fnc_gonzy.sh -function fncComprimir() { +function fnc_principal() { + fnc_gonzy_intro "Respaldar_Termux." "Crear respaldo Termux." + VarNomRes=Termux-Armor28T-gonzy_$1.tar.gz echo -e "Nombre respaldo: \n${Yellow}$VarNomRes${Color_Off}" echo -e "\nElementos a respaldar:" @@ -81,10 +64,6 @@ function fncComprimir() { fi } -fnc_gonzy_intro "Respaldar_Termux." "Crear respaldo Termux." dt=`date +%Y%m%d_%H%M%S` - -# Listado de directorios y archivos -# a respaldar. -fncComprimir $dt +fnc_principal $dt echo -e "\n" diff --git a/gnz_smsEnvio.sh b/gnz_smsEnvio.sh new file mode 100644 index 0000000..3c2535f --- /dev/null +++ b/gnz_smsEnvio.sh @@ -0,0 +1,68 @@ +#!/bin/bash +source fnc_gonzy.sh + +function fnc_principal(){ + varNomMes=`date +"%B"` + varNomMesAbr=`date +"%b"` + varNumMes=`date +"%m"` + varNomDia=`date +"%A"` + varNomDiaMes=`date +"%d"` + varNomDiaAbr=`date +"%a"` + varNumDia=`date +"%w"` + varNumAno=`date +"%Y"` + + fnc_gonzy_intro "Enviar SMS" "Enviar SMS personalizados." + + PS3="Opción?: " +items=( +"Cris - SdG: OK" +) +while true; do + select item in "${items[@]}" Regresar + do + case $REPLY in + 1) + vNumCel="+15144023664" + #vNumCel="+15147426198" + vMsg="Hola amor!\nYa pagué el SdG mensual ($varNumAno-$varNumMes) de los enanos." + fncEnviarSMS $vNumCel "$vMsg" + break;; + $((${#items[@]}+1))) + source main_gnzTools.sh; + break 2;; + *) + clear; + echo -e "${Red}"; + center_text "La opcion $REPLY no es valida."; + echo -e "${Color_Off}\n"; + break; + esac + done + done +} + +function fncEnviarSMS(){ + echo -e "\n" + fnc_msg_color 3 "Información a enviar:" +#+1 514 402-3664 +telefono=$1 +telefono=$(printf "%s(%s) %s-%s\n" "${telefono:0:2}" "${telefono:2:3}" "${telefono:5:3}" "${telefono:8:4}") + +# + echo -e "\nSMS se enviará al ${Yellow}$telefono${Color_Off}\nTexto de SMS:\n${Yellow}$2${Color_Off}\n" + read -p "Continuar con envío (S/N)?: " -n 1 -r + echo -e "\n" + if [[ ! $REPLY =~ ^[Ss]$ ]] + then + fnc_msg_color 2 "Envío cancelado." + sleep 1 + else + fnc_msg_color 2 "Enviando SMS." + termux-sms-send -n $1 $2 + sleep 1 + fnc_msg_color 1 "SMS Enviado." + fi + echo -e "\n" +} + +fnc_principal diff --git a/gnz_test.sh b/gnz_test.sh new file mode 100644 index 0000000..aec5730 --- /dev/null +++ b/gnz_test.sh @@ -0,0 +1,16 @@ +check_finger_access() { + local command="$1" + shift + termux-fingerprint | grep -q "AUTH_RESULT_SUCCESS" && { + echo -e "\\n\\e[32m> ACCESS GRANTED <\\e[0m\\n" + command $command "$@" + } || { + echo -e "\\n\\e[31m> ACCESS DENIED <\\e[0m\\n" + return 1 + } +} + +check_finger_access +# Create aliases that require fingerprint +#alias nano='check_finger_access nano' +#alias bash='check_finger_access bash' \ No newline at end of file diff --git a/gnz_txtLorem.sh b/gnz_txtLorem.sh new file mode 100644 index 0000000..0db9067 --- /dev/null +++ b/gnz_txtLorem.sh @@ -0,0 +1,21 @@ +#!/bin/bash +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "TXT Lorem" "Obtiene texto Lorem." + + echo -e "\n" + read -p "Cuantos parrafos?: " VarParr + clear + fnc_msg_color 3 "Obteniendo Lorem..." + echo -e "\n" + sleep 1 + curl -s http://metaphorpsum.com/sentences/${1-$VarParr} | termux-clipboard-set + termux-clipboard-get | grep . | cowsay + + echo -e "\n" + fnc_msg_color 1 "Servido Gonzy!" + echo -e "\n" +} + +fnc_principal \ No newline at end of file diff --git a/gnz_txtOrtog.sh b/gnz_txtOrtog.sh new file mode 100644 index 0000000..983fef1 --- /dev/null +++ b/gnz_txtOrtog.sh @@ -0,0 +1,53 @@ +#!/bin/bash +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "Ortografia" "Revisa la ortografia de un archivo." + + fnc_msg_color 2 "Archivos disponibles." + echo -e "\n" + sleep 1 + ls -x ~/storage/shared/Documents/txt2ortografia/ + echo -e "\n" + read -p "Archivo?: " vFile; + echo -e "\n" + + PS3="Opción?: " +items=( +"Español" +"English" +"Français" +) +while true; do + select item in "${items[@]}" Regresar + do + case $REPLY in + 1) + vLang="es" + aspell --lang=$vLang -c ~/storage/shared/Documents/txt2ortografia/$vFile + #xdg-open ~/storage/shared/Documents/txt2ortografia/$vFile + break;; + 2) + vLang="en" + aspell --lang=$vLang -c ~/storage/shared/Documents/txt2ortografia/$vFile + break;; + 3) + vLang="fr" + aspell --lang=$vLang -c ~/storage/shared/Documents/txt2ortografia/$vFile + break;; + $((${#items[@]}+1))) + source main_gnzTools.sh; + break 2;; + *) + clear; + echo -e "${Red}"; + center_text "La opcion $REPLY no es valida."; + echo -e "${Color_Off}\n"; + break; + esac + done + done + #xdg-open ~/storage/shared/Documents/txt2ortografia/$vFile +} + +fnc_principal \ No newline at end of file diff --git a/gnz_txtTraducir.sh b/gnz_txtTraducir.sh new file mode 100644 index 0000000..74c9f1b --- /dev/null +++ b/gnz_txtTraducir.sh @@ -0,0 +1,80 @@ +#!/bin/bash +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "Traducir" "Traduce un archivo de un idioma a otro." + + fnc_msg_color 2 "Archivos disponibles." + echo -e "\n" + sleep 1 + ls ~/storage/shared/Documents/txt2ortografia/ + echo -e "\n" + read -p "Archivo?: " vFile; + echo -e "\n" + + PS3="Opción?: " +items=( +"ES-EN" +"ES-FR" +"FR-ES" +"FR-EN" +"EN-ES" +"EN-FR" +) +while true; do + select item in "${items[@]}" Regresar + do + case $REPLY in + 1) + horaaaaq "es-en" $vFile + break;; + 2) + horaaaaq "es-fr" $vFile + break;; + 3) + horaaaaq "fr-es" $vFile + break;; + 4) + horaaaaq "fr-en" $vFile + break;; + 5) + horaaaaq "en-es" $vFile + break;; + 6) + horaaaaq "en-fr" $vFile + break;; + $((${#items[@]}+1))) + source main_gnzTools.sh; + break 2;; + *) + clear; + echo -e "${Red}"; + center_text "La opcion $REPLY no es valida."; + echo -e "${Color_Off}\n"; + break; + esac + done + done +} + +function horaaaaq(){ + vLang=$1 + vFile=$2 + reptext=":" + vLangFile="${vLang//-/"$reptext"}" + echo -e "\n" + fnc_msg_color 3 "Traduccion (de $vLang) se guardará en" + echo -e "${Yellow}~/storage/shared/Documents/txt2ortografia/$vFile.trad_$vLang${Color_Off}\n" + #echo -e "\n" + fnc_msg_color 2 "Procesando." + trans -b $vLangFile -i ~/storage/shared/Documents/txt2ortografia/$vFile -o ~/storage/shared/Documents/txt2ortografia/$vFile.trad_$vLang + fnc_msg "~/storage/shared/Documents/txt2ortografia/$vFile.trad_$vLang" +} + +function fnc_msg(){ + echo -e "\n" + fnc_msg_color 1 "Terminado." + echo -e "\n" +} + +fnc_principal \ No newline at end of file diff --git a/gnz_txtTrucos.sh b/gnz_txtTrucos.sh new file mode 100644 index 0000000..cf90507 --- /dev/null +++ b/gnz_txtTrucos.sh @@ -0,0 +1,27 @@ +#!/bin/bash +source fnc_gonzy.sh + +function fnc_principal(){ + fnc_gonzy_intro "TXT Trucos" "Hace una serie de curiosidades con el texto." + + read -p "Texto?: " strval; + + echo -e "\n" + fnc_msg_color 2 "Procesando." + sleep 1 + echo -e "\n" + + vLongTxt=$(expr length "$strval") + fnc_msg_color 3 "Longitud: $vLongTxt" + + frase=$strval + + esarf="" + for ((i=$((${#frase}-1));i>=0;i--)) { + esarf=${esarf}${frase:$i:1} + } + fnc_msg_color 3 "Reverse mode: ${esarf}" + echo -e "\n" +} + +fnc_principal \ No newline at end of file diff --git a/gnz_urlDescifrar.sh b/gnz_urlDescifrar.sh index 3027bdb..e86d460 100644 --- a/gnz_urlDescifrar.sh +++ b/gnz_urlDescifrar.sh @@ -1,11 +1,9 @@ #!/bin/bash -# Ultima Modif: 20251010 -# Descifra una URL acortada, lo hace dos veces. -# Uso: url_descifra.sh {url-corta} - source fnc_gonzy.sh -function fncDescifrar(){ +function fnc_principal(){ + fnc_gonzy_intro "URL_Descifrar" "Descifra URL acortada.\np.e. https://tinyurl.com/msxc5ydt" + UrlAcortada="$1" if [ "$UrlAcortada" == "" ]; then echo -e "${Red}" @@ -32,8 +30,5 @@ function fncDescifrar(){ echo "" } -fnc_gonzy_intro "URL_Descifrar" "Descifra URL acortada.\np.e. https://tinyurl.com/msxc5ydt" -#termux-clipboard-set "https://tinyurl.com/msxc5ydt"; - read -p "URL corta: " url_corta; -fncDescifrar $url_corta \ No newline at end of file +fnc_principal $url_corta \ No newline at end of file diff --git a/gnz_urlValidar.sh b/gnz_urlValidar.sh index 5ae5fbc..9b8f4f4 100644 --- a/gnz_urlValidar.sh +++ b/gnz_urlValidar.sh @@ -1,25 +1,9 @@ #!/bin/bash -# Ultima Modif: 20251012 -# Valida si URL está acriva. -# Uso: url_valida.sh {url-a-validar} - source fnc_gonzy.sh -# NO funciona -function valida_a(){ -resultado=$(curl -sIL $1 | grep '^HTTP' | tail -1 | awk '{print $2}') - -if [[ "$resultado" == "200" ]]; then - echo -e "${Green}Existe${Color_Off}" -elif [[ "$resultado" == "404" ]]; then - echo -e "${Red}No Existe${Color_Off}" -else - echo -e "${Yellow}No lo se.${Color_Off}" -fi -} +function fnc_principal(){ + fnc_gonzy_intro "URL_Verificar" "Verifica que URL exista." -# SI funciona -function valida_b(){ echo -e "" if wget --spider -S "$1" 2>&1 | grep -w "200\|301"; then fnc_msg_color 1 "URL activo" @@ -29,6 +13,5 @@ function valida_b(){ echo "" } -fnc_gonzy_intro "URL_Verificar" "Verifica que URL exista." read -p "URL a validar: " url_validar; -valida_b $url_validar +fnc_principal $url_validar diff --git a/main_dan-one.sh b/main_dan-one.sh index 8578120..4d2c0c3 100644 --- a/main_dan-one.sh +++ b/main_dan-one.sh @@ -1,16 +1,13 @@ #!/bin/bash -# Ultima Modif: 20251010 -# Herramientas que uso en Danone. - source fnc_gonzy.sh clear -fnc_menu(){ -PS3="Con que te ayudo?: " -items=("↑ 500 gr" "↑ 650 gr" "↑ 750 gr" +function fnc_principal(){ + PS3="Con que te ayudo?: " + items=("↑ 500 gr" "↑ 650 gr" "↑ 750 gr" "↓ 500 gr" "↓ 650 gr" "↓ 750 gr" "Fotos") -while true; do + while true; do select item in "${items[@]}" Salir do case $REPLY in @@ -37,7 +34,7 @@ while true; do break; esac done -done + done } figlet -w 50 -c "DAN-ONE" | lolcat @@ -45,4 +42,4 @@ echo -e "${Blue}" center_text "una app de gonzy.top" echo -e "${Color_Off}\n" -fnc_menu \ No newline at end of file +fnc_principal \ No newline at end of file diff --git a/main_gnzTools.sh b/main_gnzTools.sh index d94e28f..5d2f07e 100644 --- a/main_gnzTools.sh +++ b/main_gnzTools.sh @@ -1,13 +1,10 @@ #!/bin/bash -# Ultima Modif: 20251010 -# Menu de mis herramientas. - source fnc_gonzy.sh clear -fnc_menu(){ -PS3="Script a usar?: " -items=( +function fnc_principal(){ + PS3="Opción?: " + items=( "Backup Termux" "IMG a TXT" "Fotos s/IMG_" @@ -16,10 +13,20 @@ items=( "URL validar" "QR crear" "QR decod" -"WWW buscar" +"TXT Lorem" +"TXT Ortog" +"TXT transl" +"TXT trucos" +"CuentAtras" +"Dado virtual" +"La Hora" +"Genera PW" +"Num a TXT EN" +"Num a TXT FR" +"Envío de SMS" ) while true; do - select item in "${items[@]}" Salir + select item in "${items[@]}" Salir do case $REPLY in 1) @@ -50,7 +57,37 @@ while true; do source gnz_qrDeco.sh; break;; 9) - source gnz_wwwBuscar.sh; + source gnz_txtLorem.sh; + break;; + 10) + source gnz_txtOrtog.sh; + break;; + 11) + source gnz_txtTraducir.sh; + break;; + 12) + source gnz_txtTrucos.sh; + break;; + 13) + source gnz_cuentaAtras.sh; + break;; + 14) + source gnz_dado.sh; + break;; + 15) + source gnz_laHora.sh; + break;; + 16) + source gnz_pwGenerar.sh; + break;; + 17) + source gnz_numAtxt-EN.sh; + break;; + 18) + source gnz_numAtxt-FR.sh; + break;; + 19) + source gnz_smsEnvio.sh break;; $((${#items[@]}+1))) clear; @@ -69,10 +106,25 @@ while true; do done } -figlet -w 50 -c "Tools" | lolcat -echo -e "${Blue}" -center_text "una app de gonzy.top" -center_text "v-2.0" -echo -e "${Color_Off}\n" +check_finger_access() { + local command="$1" + shift + termux-fingerprint | grep -q "AUTH_RESULT_SUCCESS" && { +# echo -e "\\n\\e[32m> ACCESS GRANTED <\\e[0m\\n" +# command $command "$@" + figlet -w 50 -c "Tools" | lolcat + echo -e "${Blue}" + center_text "una app de gonzy.top" + center_text "optimizado para Termux." + center_text "v-2.0" + echo -e "${Color_Off}" + fnc_principal + } || { + echo -e "${Red}" + echo -e "Intruso!" | cowsay -f tux + echo -e "${Color_Off}" + return 1 + } +} -fnc_menu \ No newline at end of file +check_finger_access \ No newline at end of file