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 / 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
<?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 "
@horaciod
horaciod / exportdata.sh
Last active May 7, 2021 15:38
export de todos los registros de una base de datos por tabla en local
#!/bin/bash
input="dbclean/tablas_datos.txt"
#el archivo tiene los nombres de las tablas con el esquema ej: biblio.usuarios
while IFS= read -r line
do
echo "Exportando $line"
docker exec -e PGPASSWORD=xxx sid21-db12 /usr/bin/pg_dump -Upostgres -hlocalhost siglocal2021 -a --inserts -t $line >dbclean/$line.sql
done < "$input"
@horaciod
horaciod / hiberna.sh
Created April 10, 2021 21:45
Hiberna
#!/bin/bash
zenity --question --text="Are you sure, proceed to shutdown?"
if [ $? = 0 ]; then
sudo s2disk
else
exit
fi
@horaciod
horaciod / to_timestamp.sql
Created January 28, 2021 22:58
timestamp unixtime postgresql
select(to_timestamp(61 ));
1970-01-01 01:01:01+01
---- Se me olvida siempre !!!