Skip to content

Instantly share code, notes, and snippets.

@vjrj
vjrj / la-cas-keys-auto-generatel.sh
Created January 28, 2021 07:46
CAS keys generator for LA inventories
#!/bin/bash
# Dependencies: java 8 and curl
DEST=.
if [[ ! -f $DEST/jwk-gen.jar ]]; then
curl -s -o $DEST/jwk-gen.jar --location --remote-header-name --remote-name https://raw.githubusercontent.com/apereo/cas/master/etc/jwk-gen.jar
fi
function gen {
@vjrj
vjrj / sample of etc-nginx-conf.d-cors file
Last active February 12, 2020 18:21
nginx include config to enable cors to domains and subdomains in LA sites
# Use with
# include /etc/nginx/conf.d/cors;
# in your locations
# Allow static fonts
location ~* .(eot|otf|svg|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
set $cors '';
@vjrj
vjrj / check-dr-collection-in-solr.sh
Created November 25, 2019 10:40
Verification of LA data mappings in solr
#!/bin/bash
# Put this, for instance in /usr/loca/bin/ and adapt to your LA node
#
# Used in conjuntion with this other script:
# https://gist.github.com/vjrj/2b077a2bb786227a517ca03f7e30cf4c
#
# Depends on jq (apt install jq)
#
USER=XXX
@vjrj
vjrj / check-mappings-in-ocurrences.sh
Last active November 25, 2019 10:39
Verification of mappings in LA biocache-store after load
#!/bin/bash
#
# Adapt urls and put this in your /usr/local/bin (for instance) and call it with your biocache-store like:
# check-mappings-in-ocurrences.sh dr100 dr102
#
# Depends on jq (apt install jq) and https://pypi.org/project/xq/
#
drs=$1
@vjrj
vjrj / check-dr-linked-record-consumers.sh
Created November 25, 2019 10:26
Basic LA record consumers test
#!/bin/bash
# Usage "check-dr-linked-record-consumers.sh dr225 dr226"
#
ERRORS=0
DEBUG=1
drs=$1
for dr in $(echo $drs | tr "," "\n")
@vjrj
vjrj / grc.conf
Created November 25, 2019 09:17
A grc configuration for biocache tasks
#
# A grc configuration we use to add colors to biocache-store logs
# used in conjuntion with AnsiColor plugin:
# http://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin
#
# Usage:
# apt install grc
# put this file in /etc/grc.conf (for instance)
#
# Pipe bioache commands to grcat:
@vjrj
vjrj / gbif-backbone-parse-for-ala.js
Last active December 13, 2022 08:13
A node parse-transform utility to remove authors from scientificNames in GBIF Backbone to use in ALA
//
// DEPRECATED
// Use: https://github.com/living-atlases/gbif-taxonomy-for-la
//
const parse = require("csv-parse/lib/es5");
const transform = require('stream-transform');
const fs = require('fs');
var readStream = fs.createReadStream("./gbif-backbone/Taxon.tsv.orig");
@vjrj
vjrj / la-components-table-row.sh
Last active May 13, 2019 09:17
An small script to format a row for LA Node Components
#!/bin/bash
# Sample usage:
# $ la-components-table-row.sh "Elurikkus - Estonia" https://elurikkus.ee/en https://elurikkus.ee/en/collections/ https://elurikkus.ee/generic-hub/ https://elurikkus.ee/biocache-service/ https://elurikkus.ee/bie-hub/ https://elurikkus.ee/bie-index/ https://elurikkus.ee/lists/ https://elurikkus.ee/regions/
# to get:
# | [Elurikkus - Estonia](https://elurikkus.ee/en) | [✓](https://elurikkus.ee/en/collections/) | [✓](https://elurikkus.ee/generic-hub/) | [✓](https://elurikkus.ee/biocache-service/) | [✓](https://elurikkus.ee/bie-hub/) | [✓](https://elurikkus.ee/bie-index/) | [✓](https://elurikkus.ee/lists/) | [✓](https://elurikkus.ee/regions/) |
# Order:
# | NodeName | Collectory | Biocache | BiocacheService | Species | SpeciesService | SpeciesLists | Regions | Images | Spatial | CAS | Sightings | Alerts | Volunteer |
@vjrj
vjrj / la-get-versions.py
Last active October 8, 2020 09:28
A script to get LA component versions via BuildInfo and meta
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import csv
import urllib2
import re
import json
from bs4 import BeautifulSoup
@vjrj
vjrj / check-mappings
Created April 23, 2019 09:13
A small unofficial script to check data mappings in LA collectory
#!/bin/bash
#
# A small unofficial script to check data mappings in LA collectory
#
# Installation:
#
# - Copy this script in /usr/local/bin of a collectory host (for instance)
# - Put 'docopts' in /usr/local/bin (See INSTALL of: https://github.com/docopt/docopts), or just
# download https://github.com/Sylvain303/docopts/releases/download/v0.6.3-alpha1/docopts and put
# in /usr/local/bin of a collectory