Skip to content

Instantly share code, notes, and snippets.

View kerphi's full-sized avatar

Stéphane Gully kerphi

  • Abes
  • Montpellier
View GitHub Profile
@kerphi
kerphi / sudoc_parallel_orig
Last active November 10, 2023 09:23
parallélisation api <ppn>.rdf
```python
SUDOC_URIS = [
"https://www.sudoc.fr/190605901.rdf",
"https://www.sudoc.fr/244375704.rdf",
"https://www.sudoc.fr/224827553.rdf",
"https://www.sudoc.fr/261936891.rdf",
"https://www.sudoc.fr/256277346.rdf",
"https://www.sudoc.fr/272009032.rdf",
"https://www.sudoc.fr/248493957.rdf",
"https://www.sudoc.fr/23011279X.rdf",
#!/bin/bash
# Script pour nettoyer en masse des releases et tag associés
VERSION_LIST=$(gh release list | awk '{print $1}' | grep 9.9)
#VERSION_LIST=$(git tag | grep 9.9)
for VERSION in $VERSION_LIST;
do
gh release delete $VERSION -y
git tag -d $VERSION
git push --delete origin $VERSION
@kerphi
kerphi / gist:14dcfb0a8323d338bcb8
Created November 5, 2014 11:27
interroger des événements de consultation ezpaarse avec l'outil Q
curl -X POST http://ezpaarse.couperin.org --data-binary @./bibliovie.log | \
q -H --delimiter=";" "SELECT login FROM - WHERE platform = 'wiley' AND rtype = 'ARTICLE' GROUP BY login"
@kerphi
kerphi / gist:e6975df924bed2d774b6
Created August 19, 2014 15:10
Utilisation d'xmlstarlet pour supprimer d'un document XML des éléments ciblés par une liste de XPATH
echo '<?xml version="1.0"?>
<xml>
<table>
<rec id="1">
<numField>123</numField>
<stringField>String Value</stringField>
</rec>
<rec id="2">
<numField>346</numField>
<stringField>Text Value</stringField>
@kerphi
kerphi / profile
Last active August 29, 2015 14:04 — forked from wolever/profile
# prompt examples:
# [3 jobs master virtualenv] ~/code/myproject/foo
# [1 job my-branch virtualenv] ~/code/bar/
# [virtualenv] ~/code/
# ~
# Very, very fast, only requiring a couple of fork()s (and no forking at all to determine the current git branch)
# 100% pure Bash (no forking) function to determine the name of the current git branch
gitbranch() {
export GITBRANCH=""
@kerphi
kerphi / fill-with-random-lots.js
Last active December 19, 2015 15:28
Petit script en nodejs permettant d'écrire des lots (fichiers) ayant des noms aléatoires dans 3 niveaux de répertoires. Chaque lot contenant 1000 JSON : un par ligne.
#!/usr/bin/env node
/**
* Script chargé de générer des fichiers contenant 1000 lignes avec un JSON par ligne
* les fichiers on des noms alléatoires générés par uuid
* et sont stockés dans une structure de 3 répertoires imbriqués.
*
* Paramètres :
* rootPath : répertoire seront écrits les répertoires et les fichiers
* nbObj : le nombre de JSON à créer avant que le script prenne fin automatiquement
* nbPerLot : le nombre d'objet par lot
@kerphi
kerphi / fill-with-random-files.js
Last active December 19, 2015 13:08
Petit script en nodejs permettant d'écrire des fichiers avant des noms aléatoires dans 3 niveaux de répertoires.
#!/usr/bin/env node
/**
* Script chargé de générer des fichiers avec des noms alléatoires
* dans une structure de 3 répertoires imbriqués.
*
* Paramètres :
* rootPath : répertoire seront écrits les répertoires et les fichiers
* nbfile : le nombre de fichiers à créer avant que le script prenne fin automatiquement
* tempo : le temps max d'attente entre la création de deux fichiers
*
@kerphi
kerphi / streamv2reader.js
Created May 18, 2013 09:11
basic usage of nodejs stream v2
# command called:
# ./streamv2writer.js | ./streamv2reader.js
# generates:
.................................................
end of 50 chunks
end of stdin stream
#!/usr/bin/env node
//
// example :
// find xml-orig/ -type f | ./xml2xml.js -c 10 --xslt mafeuille.xslt --dpath ./xml-dest --epath ./xml-error
//
// Requirements:
// npm install shelljs optimist lazy async
//
// tentative non concluante :
// sudo apt-get install libxml2-dev
#!/bin/bash
### BEGIN INIT INFO
# Provides: log.io-harvester
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the log.io-harvester daemon
### END INIT INFO