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 / bump_term_chat.txt
Created September 6, 2018 17:54
Slack conversation about bump term issues
mcantelon [21:21]
@djuhasz The bumpTerm function, in migrations, will take over the ID of another term if that term's using its ID, but it doesn't work if the ID's used by some other object tyle like an information object. Seems like we can't really safely have IDs be constants unless I'm missing something.
djuhasz [22:47]
@mcantelon hmm, I haven't touched static object IDs for many many years and I've never used the bumpTerm function. Maybe @radda @sbreker or @sevein can provide some guidance for you?
mcantelon [22:49]
@djuhasz Thanks! Yeah, I'm thinking I'm probably going to have to just buckle down and look up the term ID using the name (then caching the ID).
sevein [22:49]

AM - AtoM Docker Compose integration

Connect AM and AtoM Docker Compose environments using a shared external volume and other tweaks needed to test and develop DIP uploads between both applications.

  1. Setup both Docker Compose environments independently:

  2. Create local folder and Docker volume:

@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
@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 / 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 / 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 / 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 / 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 / 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 / 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');