Skip to content

Instantly share code, notes, and snippets.

Avatar

GautierMichelin gautiermichelin

View GitHub Profile
@gautiermichelin
gautiermichelin / backup-mariadb.sh
Created Mar 14, 2021 — forked from karolyi/backup-mariadb.sh
Fast backup/restore mysql databases
View backup-mariadb.sh
#!/usr/bin/env bash
mariabackup --stream=xbstream --backup --user root|pigz >mariadb-backup.gz
@gautiermichelin
gautiermichelin / my.cnf
Last active Nov 26, 2020 — forked from zabustak/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
# Edited by zabustak
# Edited by GautierMichelin, idéesculture
#
# The settings marked with a specific comment or the word "UPD" (after the value)
# should be adjusted for your system by using database diagnostics tools like:
#
# https://github.com/major/MySQLTuner-perl
View Zendesk-Statushero.php
<?php
/*
In Zendesk :
- go to Settings > Extensions > Targets (Paramètres > Extensions > Cibles)
- add a target
- URL target
- Title : Zendesk-Statushero
- URL : https://DOMAIN/PATH/TO/THIS/SCRIPT?assignee={{ticket.assignee.name}}&id={{ticket.id}}&org={{ticket.organization.name}}&title={{ticket.title}}
@gautiermichelin
gautiermichelin / clear_indexes.sql
Created Oct 12, 2018
Vider les index CollectiveAccess
View clear_indexes.sql
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 Sep 30, 2018 — forked from waja/jessie2stretch.sh
Migration from Debian Jessie to Stretch
View jessie2stretch.sh
# 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
Customized version of Pawtucket IIIFService.php to avoid a load error
View IIIFService.php
<?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
Test de connexion à une instance de CollectiveAccess (Providence)
View test_connexion_ca.php
#!/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 Apr 12, 2018
Export in TSV all the screens and the bundles from a CollectiveAccess installation, using a user id (useful for reports)
View export_uis_tsv.php
<?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 / install_ffmpeg.sh
Last active Sep 12, 2019
Install FFMPEG on Debian 9
View install_ffmpeg.sh
apt-get update -qq && apt-get -y install \
autoconf \
automake \
build-essential \
cmake \
git \
libass-dev \
libfreetype6-dev \
libsdl2-dev \
libtheora-dev \
@gautiermichelin
gautiermichelin / test-medias-clean.php
Last active Feb 26, 2018
test medias for CollectiveAccess
View test-medias-clean.php
<?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")));