Skip to content

Instantly share code, notes, and snippets.

View gautiermichelin's full-sized avatar

GautierMichelin gautiermichelin

View GitHub Profile
@gautiermichelin
gautiermichelin / clear_indexes.sql
Created October 12, 2018 05:26
Vider les index CollectiveAccess
SET FOREIGN_KEY_CHECKS=0;
truncate table ca_sql_search_word_index;
truncate table ca_sql_search_words;
SET FOREIGN_KEY_CHECKS=1;
@gautiermichelin
gautiermichelin / jessie2stretch.sh
Last active September 30, 2018 15:02 — forked from waja/README.md
Migration from Debian Jessie to Stretch
# Release notes : http://www.debian.org/releases/stretch/releasenotes
# upgrade to UTF-8 locales (http://www.debian.org/releases/stretch/amd64/release-notes/ap-old-stuff.en.html#switch-utf8)
dpkg-reconfigure locales
# remove unused config file
rm -rf /etc/network/options /etc/environment
# migrate over to systemd (before the upgrade) / you might want reboot if you install systemd
@gautiermichelin
gautiermichelin / IIIFService.php
Created May 14, 2018 19:13
Customized version of Pawtucket IIIFService.php to avoid a load error
<?php
/** ---------------------------------------------------------------------
* app/lib/ca/Service/IIIFService.php
* ----------------------------------------------------------------------
* CollectiveAccess
* Open-source collections management software
* ----------------------------------------------------------------------
*
* Software by Whirl-i-Gig (http://www.whirl-i-gig.com)
* Copyright 2016-2017 Whirl-i-Gig
@gautiermichelin
gautiermichelin / test_connexion_ca.php
Last active May 7, 2018 15:43
Test de connexion à une instance de CollectiveAccess (Providence)
#!/usr/bin/php
<?php
error_reporting(E_ALL);
//The username or email address of the account.
define('USERNAME', $argv[1]);
print "\n".
"Test de connexion CollectiveAccess\n".
"----------------------------------\n".
"2018, idéesculture\n\n".
@gautiermichelin
gautiermichelin / export_uis_tsv.php
Last active April 12, 2018 08:30
Export in TSV all the screens and the bundles from a CollectiveAccess installation, using a user id (useful for reports)
<?php
require_once("setup.php");
$vt_user = new ca_users(16);
$vt_list_item = new ca_list_items();
print "Table CollectiveAccess | Editeur\tEcran de saisie\tLibellé du champs ou conteneur\tIdentifiant du champs ou conteneur\tType de données\n";
function getScreens($idno) {
@gautiermichelin
gautiermichelin / test-medias-clean.php
Last active February 26, 2018 08:58
test medias for CollectiveAccess
<?php
require_once('setup.php');
require_once(__CA_MODELS_DIR__."/ca_objects.php");
require_once(__CA_MODELS_DIR__."/ca_lists.php");
require_once(__CA_MODELS_DIR__."/ca_list_items.php");
$list = new ca_lists("object_types");
// Getting list item id of the first object type defined
$first_object_type = reset(array_keys($list->getItemsForList("object_types")));
@gautiermichelin
gautiermichelin / pdf2png
Created November 24, 2017 09:55
pdf2png as a simple command, using ghostscript and imagemagick
#!/bin/bash
PDF=$1
PNG=$2
convert -density 300x300 -units pixelsperinch $PDF -background white -alpha background -alpha off $PNG
@gautiermichelin
gautiermichelin / mysql_backup.sh
Created June 10, 2017 05:24 — forked from guiyomh/mysql_backup.sh
Mysql Backup data and schema
#!/bin/bash
# Configuration de base: datestamp e.g. YYYYMMDD
DATE=$(date +"%Y%m%d")
# Dossier où sauvegarder les backups (créez le d'abord!)
BACKUP_DIR="/backup/mysql"
@gautiermichelin
gautiermichelin / transfer.fish
Created July 5, 2017 18:57 — forked from nl5887/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@gautiermichelin
gautiermichelin / LICENSE.txt
Last active March 21, 2017 15:29 — forked from mejackreed/LICENSE.txt
Leaflet-IIIF Annotation Example
MIT License
Copyright (c) 2016 Jack Reed
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: