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 / string.sql
Last active April 20, 2023 23:43
postgresql-funciones-string
-- Teniendo una columna activida con el texto
-- Se ha validado la tapa de OLESID060417 con el archivo https://bibliotecas.uncuyo.edu.ar/sig/catalogo/editor/tapa/tapaurl.
-- se puede obtener solo el código con la siguiente sql
select substring (actividad, length('Se ha validado la tapa de '),
position(' ' in replace(actividad, 'Se ha validado la tapa de ',
''))),
actividad
from "logueo"
where actividad like 'Se ha validado la tapa de%'
@horaciod
horaciod / alter_seq.sql
Created March 8, 2023 23:27
alter sequence
SELECT setval(‘table_id_seq’, (SELECT MAX(id) FROM table));
#!/bin/bash
num=10
short=0
timestyle='--time-style=locale'
#"+%d-%b-%Y%H:%M:%S "'
## number of files to print
## set to 1 for short listing
## GNU-specific time format
opts=Aadn:os
@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 June 20, 2021 23:22
replace regular expression in VSCode
de
if (isset($_REQUEST['aplic_mensaje'])) {
$this->mensaje = $_REQUEST['aplic_mensaje'];
}
search : \$_REQUEST\[(.*?)\]
replace : getrequest($1)
a