Skip to content

Instantly share code, notes, and snippets.

View willfurnass's full-sized avatar

Will Furnass willfurnass

View GitHub Profile
@willfurnass
willfurnass / dss2emails.sh
Last active February 20, 2022 12:03
Extract usernames and emails from a Synology DSS config dump file (.dss)
#!/bin/bash
# Will Furnass
# Oct 2017
if [[ $# -lt 1 ]]; then
echo 1>&2 "Extract list of user email addresses from Synology DSS '.dss' config dump"
exit 1
fi
dss_path="$1"
@willfurnass
willfurnass / qrshx
Created April 19, 2017 14:44
Simple wrapper for Sun Grid Engine's qrsh that propagates SGE environment variables and enables X forwarding
#!/bin/sh
# David Jones and Will Furnass (University of Sheffield)
# `qrsh` is often the most convenient utility for starting interactive shell
# sessions on Sun/Son of Grid Engine (SGE) clusters but it has some limitations (as
# configured on the ShARC/Iceberg clusters):
#
# - none of the standard SGE environment vars (e.g. JOB_ID, PE_HOSTFILE,
# NSLOTS) that are defined in qsub/qsh batch/interactive sessions are set
# (annoying but not the end of the world);
@willfurnass
willfurnass / sge_cheatsheet.md
Last active April 19, 2023 15:00
(Son of) Grid Engine tips and tricks

Random Grid Engine tips and tricks

The following work with Son of Grid Engine (SGE) 8.1.9 as configured on the University of Sheffield's ShARC and Iceberg clusters.

Jobs with dependancies

You can use the -hold_jid <<job-name or job-name>> option to make jobs run only when other jobs have finished, rather than having jobs start and sit waiting for other tasks to complete.

@willfurnass
willfurnass / bng.py
Created March 1, 2016 18:36
Convert alphanumeric British National Grid references to/from easting northing integer pairs
import numpy as np
myriad_codes = np.array((
None, None, None, None, "HP", None, None,
None, None, None, "HT", "HU", None, None,
None, "HW", "HX", "HY", "HZ", None, None,
"NA", "NB", "NC", "ND", None, None, None,
"NF", "NG", "NH", "NJ", "NK", None, None,
"NL", "NM", "NN", "NO", None, None, None,
None, "NR", "NS", "NT", "NU", None, None,