Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Drupal\oaks_fields\Plugin\search_api\processor;
use Drupal\search_api\Datasource\DatasourceInterface;
use Drupal\search_api\Item\ItemInterface;
use Drupal\search_api\Processor\ProcessorPluginBase;
use Drupal\search_api\Processor\ProcessorProperty;
use Drupal\node\Entity\Node;
use Drupal\controlled_access_terms\EDTFUtils;
@joecorall
joecorall / batch.sh
Last active January 12, 2024 15:03
Batch media ingest from i7 to i2
#!/usr/bin/env bash
set -eou pipefail
BASE_CONFIG=configs/i7.yml
# Example BASE_CONFIG:
# task: add_media
# host: "https://example.com"
# username: admin
# password: password
@joecorall
joecorall / missing.sh
Last active January 12, 2024 15:04
For a list of PIDs you need to import into i2 from i7, get the metadata from i7 via workbench
#!/usr/bin/env bash
set -eou pipefail
# how many items to fetch at once
PARALLEL_EXECUTIONS=10
PIDS=($(cat ./pids.csv))
while [ "${#PIDS[@]}" -gt 0 ]; do
for ((i = 0; i < PARALLEL_EXECUTIONS; i++)); do
@joecorall
joecorall / rsync-ocfl.sh
Last active May 10, 2024 10:39
rsync a production server to staging. This script is meant to run from the production server to make a copy to staging in the fastest way possible. Used on an Islandora OCFL fcrepo filesystem and a drupal filesystem totaling ~7TB
#!/usr/bin/env bash
set -eou pipefail
# the source and target directory we want to rsync to another server
# this script assumes its the same name on both servers
DIR=/opt/islandora/volumes
# where to send the files to
# replace USER and STAGING with your staging server domain