Skip to content

Instantly share code, notes, and snippets.

Avatar

Alan Orth alanorth

View GitHub Profile
@alanorth
alanorth / error.log
Created May 17, 2023 10:30
Error during `test_database` step of `ant update` with DSpace 7.6-SNAPSHOT.
View error.log
$ 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
View PKGBUILD
# 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
View PKGBUILD
# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: Limao Luo <luolimao+AUR@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# From core package
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>
_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
View geojson-test.py
#!/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
View PKGBUILD
# Maintainer: Alexis Rouillard <contact@arouillard.fr>
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
View beast-array.sbatch
#!/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.
View find-by-metadata-field.md

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+.
View migrate-ldif.awk
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.
View iwmi-rss.xml
<?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>
@alanorth
alanorth / thumbnail.component.ts
Created September 29, 2022 09:42
Trying to set the defaultImage in a custom theme in DSpace 7.4-SNAPSHOT
View thumbnail.component.ts
import { Component } from '@angular/core';
import { ThumbnailComponent as BaseComponent } from '../../../../app/thumbnail/thumbnail.component';
/**
* This component renders a given Bitstream as a thumbnail.
* One input parameter of type Bitstream is expected.
* If no Bitstream is provided, an HTML placeholder will be rendered instead.
*/
@Component({
selector: 'ds-thumbnail',