parent
ebeb4e8247
commit
010cef7a25
@ -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 |
||||
@ -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 |
||||
@ -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 |
||||
@ -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 |
||||
@ -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 |
||||
@ -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 |
||||
@ -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 |
||||
@ -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' |
||||
@ -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 |
||||
@ -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 |
||||
@ -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 |
||||
@ -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 |
||||
Loading…
Reference in new issue