Skip to content

Instantly share code, notes, and snippets.

View alanorth's full-sized avatar

Alan Orth alanorth

View GitHub Profile
@alanorth
alanorth / dspaces.csv
Last active July 11, 2024 13:08
List of DSpace 7 instances to serve as inspiration for those of us who have not yet managed to take the plunge
version url
7.0 https://repository.museumsiam.org
7.0 https://minerva-access.unimelb.edu.au
7.0 https://unsworks.unsw.edu.au
7.4 https://corpus.ulaval.ca
7.5-SNAPSHOT https://dspace.alquds.edu
7.5 https://openaccess.marmara.edu.tr
7.2.1 https://oasis.col.org
7.2.1 https://open.fsc.org
7.4 https://openaccess.bezmialem.edu.tr
@alanorth
alanorth / error.log
Created May 17, 2023 10:30
Error during `test_database` step of `ant update` with DSpace 7.6-SNAPSHOT.
$ ant update clean_backups -Doverwrite=true
Buildfile: /home/aorth/src/git/DSpace-7/dspace/target/dspace-installer/build.xml
prepare_configs:
[mkdir] Created dir: /home/aorth/src/git/DSpace-7/dspace/target/dspace-installer/config-temp
[copy] Copying 232 files to /home/aorth/src/git/DSpace-7/dspace/target/dspace-installer/config-temp
[copy] Copying 1 file to /home/aorth/src/git/DSpace-7/dspace/target/dspace-installer/config-temp
[copy] Copying 14 files to /home/aorth/src/git/DSpace-7/dspace/target/dspace-installer/config-temp
copy_configs_keep:
@alanorth
alanorth / PKGBUILD
Created May 11, 2023 12:13
Arch Linux PKGBUILD for system76-scheduler 2.0.1
# Maintainer: Donald Carr <d _at_ chaos-reins.com>
_pkgname=system76-scheduler
pkgname=${_pkgname}
pkgver=2.0.1
pkgrel=1
pkgdesc='system76 userspace scheduler'
arch=(x86_64)
url='https://github.com/pop-os/system76-scheduler'
license=('MPL-2')
@alanorth
alanorth / PKGBUILD
Created March 30, 2023 18:46
Updated PKGBUILD for imagemagick-git
# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: Limao Luo <[email protected]>
# Contributor: Stefan Husmann <[email protected]>
# From core package
# Maintainer: Antonio Rojas <[email protected]>
# Contributor: Eric Bélanger <[email protected]>
_pkgname='imagemagick'
pkgbase="${_pkgname}-git"
_srcdir='ImageMagick'
@alanorth
alanorth / geojson-test.py
Created March 6, 2023 12:37
Checking if GPS points are in a polygon with Shapely
#!/usr/bin/env python
#
# Given the three points below, this code prints:
#
# $ ~/src/geojson-test.py
# True
# True
# False
#
# Requires shapely to be installed in the virtual environment.
@alanorth
alanorth / PKGBUILD
Created February 26, 2023 18:47
PKGBUILD for waybar-git, updated to match official Arch Linux waybar package
# Maintainer: Alexis Rouillard <[email protected]>
pkgname=waybar-git
pkgver=r2429.09142fa3
pkgrel=1
pkgdesc='Highly customizable Wayland bar for Sway and Wlroots based compositors (GIT)'
arch=('x86_64')
url="https://github.com/Alexays/Waybar/"
license=('MIT')
depends=(
@alanorth
alanorth / beast-array.sbatch
Created January 31, 2023 08:34
Example of SLURM array job for Everlyn
#!/usr/bin/bash -l
#SBATCH -p batch
#SBATCH -n 8
#SBATCH -J prank
# Start a job array with eight CPUs total where we iterate over 1,000+ FASTA
# files and start a prank command for each one. SLURM ensures that there are
# no more than eight running at the same time within the same allocation.
#
# See: https://support.ceci-hpc.be/doc/_contents/QuickStart/SubmittingJobs/SlurmTutorial.html#packed-jobs-example
@alanorth
alanorth / find-by-metadata-field.md
Last active December 7, 2022 15:38
Example of using the DSpace 6.x REST API's find-by-metadata-field endpoint.

Step 1

POST a JSON object with your search terms:

$ curl -s -f -H "Content-Type: application/json" -X POST \
    "https://dspacetest.cgiar.org/rest/items/find-by-metadata-field?expand=bitstreams" \
    -d '{"key":"dcterms.subject", "value":"climate variability","language": "en_US"}' | \
    python -m json.tool
...
@alanorth
alanorth / migrate-ldif.awk
Created November 11, 2022 07:20
Migrate an LDIF from RFC 2307 to RFC 2307bis, ie the schema used in 389-ds 1.3.x to 1.4+.
BEGIN {}
/dn: uid=.*,ou=People,dc=ilri,dc=cgiar,dc=org/ {
print "# User migrated to RFC 2307bis";
# Keep getting the next line until we have a blank one (which means this
# user's LDIF entry is finished).
while ($0 !~ /^$/) {
# Lines to update or remove. I comment them out by printing a hash and
# "&", which is a special awk syntax to print the pattern that matched.
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<title>International Water Management Institute (IWMI)</title>
<link>https://hdl.handle.net/10568/16814</link>
<description>IWMI</description>
<pubDate>Sun, 02 Oct 2022 14:12:11 GMT</pubDate>
<dc:date>2022-10-02T14:12:11Z</dc:date>
<opensearch:itemsPerPage>40</opensearch:itemsPerPage>
<opensearch:totalResults>7644</opensearch:totalResults>