Skip to content

Instantly share code, notes, and snippets.

View horaciod's full-sized avatar
💭
aprendiendo todo lo posible

Horacio Degiorgi horaciod

💭
aprendiendo todo lo posible
View GitHub Profile
@horaciod
horaciod / screentelegram.sh
Last active May 11, 2022 03:05
Toma un screenshot en linux y lo envía con el script telegram-notify.sh a un bot en telegram.
#!/bin/bash
### llamar con la cantidad de segundos de espera entre captura y captura
sleep 3
while true
do
gnome-screenshot -f /tmp/screen.png
fecha=`date +%Y-%m-%d\ %H:%M`
echo $fecha
@horaciod
horaciod / ips.sh
Created May 5, 2022 12:12
lista de ips con vista pretty
#!/bin/bash
ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print '
@horaciod
horaciod / screentelegram.sh
Created May 2, 2022 15:47
toma screenshot y envia a telegram
#!/bin/bash
sleep 3
while true
do
gnome-screenshot -f /tmp/algo.png
./telegram-notify.sh --success --texto "pantalla" --photo /tmp/algo.png
rm /tmp/algo.png
sleep 300
echo "enviado cada 5 minutos"
done
@horaciod
horaciod / ipdocker.sh
Created September 20, 2021 20:29
obtener ip de un contenedor docker corriendo
#!/bin/bash
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $1
@horaciod
horaciod / readme-change.md
Last active September 13, 2021 22:23
implementing Google Analytics on vufind 7.x (universal with CSP)

cambio en vufind para google analytics.

We need to change one php file module/VuFind/src/VuFind/View/Helper/Root/GoogleAnalytics.php

on function "getRawJavascript"

//new code that insert the nonce attribute on "script" tag created by s.createElement()
 if ($this->universal) {
@horaciod
horaciod / limpiar_busquedas.sh
Created August 25, 2021 02:41
Script para limpiar sesiones en VUFIND #vufind
#!/bin/bash
export VUFIND_LOCAL_DIR=/usr/local/vufind/local
cd /usr/local/vufind/util
/usr/bin/php expire_searches.php
@horaciod
horaciod / gist:c3a19fcba5a1128f65ac2a8ccd691eee
Last active July 26, 2025 12:47
replace regular expression in VSCode
de
if (isset($_REQUEST['aplic_mensaje'])) {
$this->mensaje = $_REQUEST['aplic_mensaje'];
}
search : \$_REQUEST\[(.*?)\]
replace : getrequest($1)
a
<?php
// obtener el listado de funciones que llama un objeto llamado conn
// grep -or "conn->.*.(" >/tmp/llamadas.txt
$f = file_get_contents('/tmp/llamadas.txt');
$lineas = explode("\n" , $f) ;
$aux = [ ];
foreach($lineas as $l){
if (strstr($l, 'vendor')===false)
@horaciod
horaciod / backkupgitrepo.sh
Created June 17, 2021 11:57
backup de cambios de un repositorio git sin hacer commit
#!/bin/bash
tar czvf $1 `git diff --name-only`
@horaciod
horaciod / exportdata.sh
Created May 7, 2021 15:59
export de todos los registros de una base de datos por tabla en local
#!/bin/bash
input="dbclean/tablas_datos.txt"
n=$((0))
while IFS= read -r line
do
((n++))
nn=`printf '%03d' "$n"`
echo "Exportando $nn $line "