Skip to content

Instantly share code, notes, and snippets.

@petrohs
petrohs / wikiFotosCC.bash
Created December 7, 2021 05:55
wikiFotosCC¦ Descarga fotos de creativecommons y le da un efecto de foto polaroid
#!/bin/bash
ARCH="$1";
TEXTO="[[${ARCH}]] petrohsW/wikiCommons CC by sa (20181117)"
URL_PAG="https://commons.wikimedia.org/wiki/File:${ARCH}"
wget ${URL_PAG} -o ${ARCH}.log -O ${ARCH}.html
URL_FOTO=$(grep 'div class="fullMedia"' ${ARCH}.html | sed -e "s'.*a href=\"''" -e "s/\" class=\"internal.*//")
wget ${URL_FOTO} -o ${ARCH}.2.log
@petrohs
petrohs / debianHuerfanosPopular.bash
Created September 17, 2020 06:08
debianHuerfanosPopular¦ obtener listado de paquetes huarfanos de la lista de popularidad Debian
#!/bin/bash
rm by_vote orphaned.html orphaned.txt huerfanosPopulares.txt;
wget https://popcon.debian.org/by_vote
wget https://www.debian.org/devel/wnpp/orphaned.html
#grep 'bugs.debian.org' orphaned.html | cut -d: -f2 | cut -d\> -f2 | sed -e "s/.*/& /" | head -2 > orphaned.txt
grep 'bugs.debian.org' orphaned.html | sed -e "s'.*<li><a href=.https://bugs.debian.org/........' '" -e "s/:.*/ /" > orphaned.txt
grep -f orphaned.txt by_vote > huerfanosPopulares.txt
@petrohs
petrohs / rotaFot.sh
Created August 20, 2020 06:36
rotaFot¦ Girar imagenes
#!/bin/sh
# 270 >
grad="$1";
imag="$2";
convert -rotate $grad $imag a${imag} && mv a${imag} $imag
@petrohs
petrohs / buscaCdrDxl.sh
Created August 20, 2020 06:19
buscaCdrDxl¦ Busca el cdr dentro de un archivo volcado dxl
#!/bin/sh
ayuda () { echo '
#===============================================================================
#
# SCRIPT: buscaCdrDxl.sh
#
# USO: buscaCdrDxl.sh [-i lista] [-d dir/dxls] [-s arch_sal]
# buscaCdrDxl.sh [-t tipo] [-D num]
# buscaCdrDxl.sh [-h|-?|--help] [-v|--version]
#
@petrohs
petrohs / descargaConfiguracion.sh
Created August 20, 2020 06:15
descargaConfiguracion¦ Descarga variables de configuraciones desde base de datos
#!/bin/sh
##/usr/bin/sh
ayuda () { echo '
#===============================================================================
# SCRIPT: descargaConfiguracion
#
# USO: descargaConfiguracion.sh [-t pref] [-o sal] [-b bloq] osid
# DESCRIPCION: descarga variables de configuraciones desde base de datos
# OPCIONES: osid Identificador de la base a la que consultara
# -t prefijo Prefijo de la tabla _C_PARAMETROS por omision
@petrohs
petrohs / extrae_plantilla.bash
Created August 20, 2020 06:11
extrae_plantilla¦ Se autoextrae las plantillas desde el script
#!/bin/bash
ayuda () { echo '
#==============================================================================
# SCRIPT: * Extraer las plantillas para desarrollo *
#
# USO: ./extrae_plantilla.bash [-h|-v]
#
# DESCRIPCION: Se autoextrae las plantillas desde el script
# Continene un conjunto de directorios base para desarrollo
#
@petrohs
petrohs / field_attr.sh
Created August 20, 2020 06:08
field_attr¦ Obtiene el correspondiente a field y attributes
#!/bin/sh
ayuda () { echo '
#===============================================================================
#
# SCRIPT: field_attr.sh
#
# USO: ./field_attr.sh [-f field] [-a attrib]
# ./field_attr.sh "field_id=17, attr_id=9"
#
# DESCRIPCION: Obtiene el correspondiente a field y attributes
@petrohs
petrohs / zimScripts_pcal.bash
Created August 20, 2020 06:05
zimScripts_pcal¦ Script para zim generando pcal
#!/bin/bash
BASE=/home/petrohs/Notebooks/Notes/Journal
cad=`zenity \
--title="pCal" \
--forms \
--add-entry=Año \
--add-entry=Mes \
--text="Mes a generar"`
@petrohs
petrohs / _Pprism.sh
Created August 20, 2020 06:02
_Pprism¦ Lista en zenity para prism
#!/bin/bash
ayuda () { echo '
#===============================================================================
#
# SCRIPT: _Pprism.sh
#
# USO: _Pprism.sh
#
# DESCRIPCION: ---
#
@petrohs
petrohs / _Kprogs.sh
Created August 20, 2020 05:58
_Kprogs¦ Matar evolution, flock, gnotify o firefox
#!/bin/bash
if [ "$1" = "evolution" ]
then
kill -9 `ps -fea | grep "/usr/bin/evolution --component=mail" | grep -v grep | tr -s " " "_" | cut -d_ -f2 | xargs`
kill -9 `ps -fea | grep " /usr/lib/evolution/" | grep -v grep | tr -s " " "_" | cut -d_ -f2 | xargs`
elif [ "$1" = "flock" ]
then
kill -9 `ps -fea | grep " /bin/sh /usr/local/bin/flock-browser" | grep -v grep | tr -s " " "_" | cut -d_ -f2 | xargs`
kill -9 `ps -fea | grep " /usr/local/progs/flock/flock-bin" | grep -v grep | tr -s " " "_" | cut -d_ -f2 | xargs`