Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am petrohs on github.
  • I am petrohs (https://keybase.io/petrohs) on keybase.
  • I have a public key whose fingerprint is 15AD 0077 7028 D720 539C D2B0 CEB5 C220 F1B7 1CDB

To claim this, I am signing this object:

@petrohs
petrohs / _xlock.bash
Last active May 24, 2020 23:05
_xlock.bash¦ Script para personalizar el bloqueo de pantalla.
#!/bin/bash
ayuda () { echo '
#===============================================================================
# USO: _xlock
#
# DESCRIPCION: Parametros personalizados para xlock
# OPCIONES: ---
# DEPENDENCIAS: xscreensaver
# xset
# BUGS: ---
@petrohs
petrohs / listaVPN.bash
Last active May 24, 2020 23:05
listaVPN¦ Conecta o desconecta a vpn
#!/bin/bash
ayuda () { echo '
#===============================================================================
# SCRIPT: listaVPN.bash
#
# USO: listaVPN.bash [-h]
# DESCRIPCION: Identifica si esta conectado a la vpn
# Si no esta conectado muestra lista de vpns y conecta
# Si esta conectado pregunta si desconecta
# OPCIONES: -h ayuda
@petrohs
petrohs / SCc_c.bash
Last active May 24, 2020 23:06
SCc_c¦ registros desde soundcloud
#!/bin/bash
URL="$1";
MEDIA=`wget "$URL" -o /dev/null -O - | grep streamUrl | sed -e 's/.*"streamUrl"/"streamUrl"/' | cut -d, -f1 | cut -d\" -f4`;
NOM=`basename "$URL"`;
wget "$MEDIA" -o /dev/null -O "$NOM".mp3
@petrohs
petrohs / cambiapT.bash
Last active May 24, 2020 23:06
cambiapT¦ cambia el papel tapiz
#!/bin/bash
ayuda () { echo '
#===============================================================================
# USO: cambiapT.bash
#
# DESCRIPCION: cambia el papel tapiz
# OPCIONES: ---
# DEPENDENCIAS: fbsetbg
# BUGS: ---
# NOTAS: ---
@petrohs
petrohs / transl.bash
Last active May 24, 2020 23:07
transl¦ traductor de google desde zenity
#!/bin/bash
cad=`zenity \
--title="Trans" \
--forms \
--add-entry=idioma \
--add-entry=cadena \
--text="A traducir"`
idio=`echo $cad | cut -d\| -f1`
trad=`echo $cad | cut -d\| -f2-`
@petrohs
petrohs / Vxrandr.bash
Created May 24, 2020 23:39
Vxrandr¦ activa o desactiva monitores
#!/bin/bash
if [[ -e /tmp/xrandr.petrohs ]]
then
xrandr --output VGA-1 --off --output eDP-1 --primary --mode 1600x900 --pos 0x0 --rotate normal --output HDMI-3 --off --output HDMI-2 --off --output HDMI-1 --off --output DP-3 --off --output DP-2 --off --output DP-1 --off
rm /tmp/xrandr.petrohs
exit 0;
fi
xrandr | grep "HDMI-3 connected " >/dev/null 2>/dev/null
@petrohs
petrohs / parse_yaml.bash
Created May 24, 2020 23:43
parse_yaml¦ convertir un archivo en formato yaml a export de variables bash
#!/bin/bash
ayuda() { echo '
* parse_yaml.bash *
DESCRIPCION: ---
USO: parse_yaml.bash [-k] archivo.yaml [pref]
USO: parse_yaml.bash [-i] [-h|-?] [-v]
OPCIONES: archivo.yaml archivo con configuraciones en formato yaml
pref perfijo a usar de manera opcional
-k en lugar de mostrar en pantalla, crea un archivo temporal
@petrohs
petrohs / _screenshotClipboad.bash
Created May 24, 2020 23:47
_screenshotClipboad¦ capturar segmento de pantalla
#!/bin/bash
gnome-screenshot -a -f /tmp/capSecc000.png
xclip -selection clipboard -t image/png /tmp/capSecc000.png
exit 0;
@petrohs
petrohs / validaFormatoFecha.sh
Created May 25, 2020 01:25
validaFormatoFecha.¦ validar que una fecha este ene l formato definido
#!/bin/sh
ayuda () { echo '
#===============================================================================
#
# SCRIPT: validaFormatoFecha.sh
#
# USO: ./validaFormatoFecha.sh [-f formato ] fecha
#
# DESCRIPCION: valida que la cadena corresponda a una fecha valida
# si es valida la regresa en formato aaaammdd si no regresa