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 / ex-revistas.sh
Created February 18, 2019 03:35
extracción de url y nombre de revistas de un directorio repleto de xmls resultado de una cosecha OAI/PMH
#!/bin/bash
echo "" >/tmp/titulos.txt
echo "">/tmp/url.txt
for file in *.xml
do
xmlstarlet sel -t -m '//dc:source[1]' -v . -n < ${file} >>/tmp/titulos.txt
xmlstarlet sel -t -m '//dc:identifier[1]' -v . -n < ${file} >>/tmp/url.txt
done
cut -d ';' -f 1 < /tmp/titulos.txt |sort | uniq > titulosrevistas.txt
@horaciod
horaciod / updatesolr.sh
Created February 18, 2019 15:32
Update / Add fields in solr index based in search (agregar o modificar registros en un indice solr usando un resultado de búsqueda
#!/usr/bin/bash
# primer parametro que buscar ej: country_str:argentina
# segundo parametro que archivo de template utilizar. ej: chile.j
##### archivo template
##### { "id": .id , country_str:{"set":"Chile" }}
echo "$2 en portal '$1'"
solrdump -verbose -server http://localhost:8389/solr/biblio -q "$1" -fl 'id' |jq -f $2 -c >update.json
solrbulk -server http://localhost:8389/solr/biblio update.json
@horaciod
horaciod / enrolldecurso_a_curso.sh
Created August 8, 2019 22:24
moodle enroll all students from on course to another using moosh https://moosh-online.com/commands/
#!/bin/bash
# dos parámetros / two parameters
# ex. ./enrolldecurso_a_curso.sh --id 20 715
# $1 curso orign $2 curso destino
# ### path of the moodle root
cd /datos/webs/moodle36/html
#export curso
php /home/desarrollo/moosh/moosh.php user-list --course=$1 --id >/tmp/exportados.txt
#exit 111
@horaciod
horaciod / docker-compose-web.yml
Last active August 29, 2019 03:54
docker compose para php 7.0 postgresql 10 pgadmin y nginx
###############################################################################
# Genera un entorno de desarrollo con
# PHP 7.0 nginx pgadmin4 postgresql.10 todo con volumenes especiales para el
# pgdadmin4 postgresql y archivos de la aplicación
# https://github.com/thaJeztah/pgadmin4-docker
# https://phpdocker.io/generator
###############################################################################
version: "3.1"
services:
db:
@horaciod
horaciod / docker-compose-devil.yml
Created August 31, 2019 21:37
Docker compose recipe for old development enviroment.
###############################################################################
# Generated on phpdocker.io #
###############################################################################
version: "3.1"
services:
db:
image: postgres:10
container_name: ideas-db
restart: always
volumes:
@horaciod
horaciod / .env
Created August 31, 2019 21:41
.env file for docker-compose-devil.yml
email=myemail@gmail.com
password=some
dbpassword=somedbpass
@horaciod
horaciod / permisos.yml
Last active October 15, 2019 14:36
algo de algo
version: "3.1"
services:
db:
image: postgres:10
container_name: sid-db
restart: always
volumes:
- /datos/webs/sid/sigsid2018/pgdb:/var/lib/postgresql/data
ports:
- "5432:5432"
@horaciod
horaciod / updateinventario_numeral.sql
Last active October 30, 2019 13:54
expresion regular para limpieza de campo en postgresql
update biblio.items set inventario_numeral =
REGEXP_REPLACE(inventario, '([A-Z|a-z|\.|\()|\-|/|[:space:]|ó|ª|;|\+|\\|\:\,|´|}])' , '','g' )::integer
where inventario ~ '[0-9]' and length(inventario)<=10 and inventario_numeral is null;
version: '3'
services:
wp:
image: wordpress:latest # https://hub.docker.com/_/wordpress/
ports:
- ${IP}:80:80 # change ip if required
volumes:
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
- ./wp-app:/var/www/html # Full wordpress project
@horaciod
horaciod / deletebyquery.sh
Created January 20, 2020 22:36
borrado por post en solr
/usr/local/vufind/solr/vendor/bin/post -url http://usuario:clave@lab1.draphp.com:8389/solr/biblio/update -d "<delete><query>$1</query></delete>"