Skip to content

Instantly share code, notes, and snippets.

Avatar

Alan Orth alanorth

View GitHub Profile
@alanorth
alanorth / beast-array.sbatch
Created Jan 31, 2023
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 Dec 7, 2022
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 Nov 11, 2022
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 Sep 29, 2022
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',
@alanorth
alanorth / PKGBUILD
Last active Oct 4, 2022
PKGBUILD for OpenRefine 3.6.2
View PKGBUILD
# 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 Jun 13, 2022
Structure 2.3.4 mainparams and extraparams
View extraparams.txt
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 Jun 13, 2022
DSpace 7 dspace.log
View 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 Jun 3, 2022
Trying to install mmseqs2 in conda
View conda.log
$ 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
@alanorth
alanorth / 2022-01-26-tac-batch1.md
Last active Jan 26, 2022
First batch of potential duplicates of TAC reports on CGSpace (1–200)
View 2022-01-26-tac-batch1.md

Found potential duplicate:

Found potential duplicate:

Found potential duplicate:

  • Title: Integral plan for research, training and technical assistance for protein food production in Central America and the Carribean