Skip to content

Instantly share code, notes, and snippets.

View jraddaoui's full-sized avatar

José Raddaoui Marín jraddaoui

  • Artefactual Systems Inc.
  • Seville, Spain
View GitHub Profile
@jraddaoui
jraddaoui / readme.md
Created December 1, 2023 11:20
SDPS Enduro + Archivematica
<?php
const TAXONOMY_ID = 37;
echo 'Have you created a backup of the database? [y/N]: ';
flush();
ob_flush();
$confirmation = trim(fgets(STDIN));
if ('y' !== $confirmation) {
exit(0);
@jraddaoui
jraddaoui / clipboard.js
Last active August 9, 2020 12:12
AtoM clipboard with ES6 classes (no arrow functions and others yet)
(function($)
{
'use strict';
class Clipboard
{
constructor(element)
{
this.$element = element;
this.$menuButton = this.$element.find('> button');
@jraddaoui
jraddaoui / fix_right_basis_terms.php
Created March 30, 2020 14:00
Script to be executed with `php symfony tools:run` to fix the PREMIS right basis terms.
<?php
print("Have you created a backup of the database? [y/N]: ");
flush();
ob_flush();
$confirmation = trim(fgets(STDIN));
if ($confirmation !== 'y')
{
exit (0);
}
@jraddaoui
jraddaoui / update_publication_status.md
Last active November 30, 2021 18:15
Update publication status of IO and descendants with raw SQL and ES' _update_by_query

Update pub. status in the database:

UPDATE status
SET status.status_id = 159
WHERE status.type_id = 158
AND status.object_id IN (
  SELECT des.id
  FROM information_object io
 JOIN information_object des
@jraddaoui
jraddaoui / docker-compose.pmm2.yml
Created March 2, 2020 13:43
AtoM Docker with PMM version 2
---
version: "2"
volumes:
pmm_data:
services:
percona:
volumes:
@jraddaoui
jraddaoui / 20000_children.php
Created February 25, 2020 21:16
Simple script to create an IO with 20000 children ... `php symfony tools:run 20000_children.php`
<?php
$parent = new QubitInformationObject;
$parent->parentId = QubitInformationObject::ROOT_ID;
$parent->identifier = "A";
$parent->indexOnSave = false;
$parent->save();
for ($i = 0; $i < 20000; $i++)
{
@jraddaoui
jraddaoui / gist:59f3812f7b379caa7511b065563cb975
Created February 11, 2020 19:28
Archivematica - Kibana

Docker Compose

  kibana:
    image: "docker.elastic.co/kibana/kibana:6.5.4"
    ports:
      - "62333:5601"

Files per format chart

@jraddaoui
jraddaoui / docker-compose.pmm.yml
Created December 9, 2019 16:57
AtoM PMM using slow query log
---
version: "2"
services:
percona:
volumes:
- ./etc/mysql/pmm.cnf:/etc/my.cnf.d/pmm.cnf:ro
pmm_server:
@jraddaoui
jraddaoui / 00_atom_hierarchies.md
Last active January 8, 2020 22:08
CTE queries for AtoM hierarchy management

MODELS WITH NESTED SET:

  • Actor
  • Repository (inherited)
  • Function
  • InformationObject
  • Menu
  • PhysicalObject
  • Taxonomy
  • Term