Skip to content

Instantly share code, notes, and snippets.

View alanorth's full-sized avatar

Alan Orth alanorth

View GitHub Profile
@alanorth
alanorth / PKGBUILD
Created February 26, 2023 18:47
PKGBUILD for waybar-git, updated to match official Arch Linux waybar package
# 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
#!/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>
@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
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',
@alanorth
alanorth / PKGBUILD
Last active October 4, 2022 07:41
PKGBUILD for OpenRefine 3.6.2
# Maintainer: Simon Legner <Simon.Legner@gmail.com>
# Contributor: Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
pkgname=openrefine
pkgver=3.6.2
pkgrel=1
pkgdesc="A free, open source power tool for working with messy data and improving it"
arch=('any')
url=https://openrefine.org/
license=('BSD')
@alanorth
alanorth / extraparams.txt
Last active June 13, 2022 08:21
Structure 2.3.4 mainparams and extraparams
EXTRA PARAMS FOR THE PROGRAM structure. THESE PARAMETERS CONTROL HOW THE
PROGRAM RUNS. ATTRIBUTES OF THE DATAFILE AS WELL AS K AND RUNLENGTH ARE
SPECIFIED IN mainparams.
"(int)" means that this takes an integer value.
"(d)" means that this is a double (ie, a Real number such as 3.14).
"(B)" means that this variable is Boolean
(ie insert 1 for True, and 0 for False).
PROGRAM OPTIONS
@alanorth
alanorth / dspace.log
Created June 13, 2022 05:55
DSpace 7 dspace.log
2022-06-13 08:52:46,191 INFO unknown unknown org.apache.commons.beanutils.FluentPropertyBeanIntrospector @ Error when creating PropertyDescriptor for public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)! Ignoring this property.
2022-06-13 08:52:46,337 INFO unknown unknown org.apache.commons.beanutils.FluentPropertyBeanIntrospector @ Error when creating PropertyDescriptor for public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)! Ignoring this property.
2022-06-13 08:52:46,346 INFO unknown unknown org.apache.commons.beanutils.FluentPropertyBeanIntrospector @ Error when creating PropertyDescriptor for public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)! Ignoring this property.
2022-06-13 08:52:46,348 INFO unknown unknown org.apache.commons.beanutils.FluentPropertyBeanIntrospector @ Error when creating Prope
@alanorth
alanorth / conda.log
Created June 3, 2022 12:21
Trying to install mmseqs2 in conda
$ conda install mmseqs2=12.113e3=h2d02072_2
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed