Skip to content

Instantly share code, notes, and snippets.

View alanorth's full-sized avatar

Alan Orth alanorth

View GitHub Profile
@alanorth
alanorth / 2022-01-26-tac-batch1.md
Last active January 26, 2022 17:36
First batch of potential duplicates of TAC reports on CGSpace (1–200)

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
@alanorth
alanorth / convert-libaom.sh
Created October 22, 2021 06:50
Script to convert video to constant quality (CRF) mode AV1 attempting to match a target VMAF.
#!/usr/bin/env bash
#
# v2021-10-21
#
# I run it like this (using zsh syntax):
#
# $ for video (~/Pictures/2021/**/*.mp4(ND.)); do ~/Downloads/av1-tests/convert-av1.sh "$video"; done
#
# Reference:
# - https://ffmpeg.org/ffmpeg-codecs.html#libaom_002dav1
@alanorth
alanorth / parse_logs.diff
Last active September 28, 2021 06:16
Minor improvement to AbuseIPDB.com parse_logs.py script (remove duplicate IPs, mark regexes as raw strings, use f-strings for readability, and format with black).
14,18c14,23
< description=__doc__,
< formatter_class=argparse.RawDescriptionHelpFormatter)
< parser.add_argument('infile', help="Input file", type=argparse.FileType('r'))
< parser.add_argument('-o', '--outfile', help="Output file",
< default=sys.stdout, type=argparse.FileType('w'))
---
> description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
> )
> parser.add_argument("infile", help="Input file", type=argparse.FileType("r"))
@alanorth
alanorth / purge_haplotigs.log
Created June 21, 2021 09:29
purge_haplotigs test log on HPC
[aorth@hpc: ~]$ module load purge_haplotigs/1.1.1
[aorth@hpc: ~]$ purge_haplotigs test
purge_haplotigs readhist -b aligned.bam -g contigs.fa
[21-06-2021 12:25:50] bedtools OK!
[21-06-2021 12:25:50] Rscript OK!
[21-06-2021 12:25:50] samtools OK!
[21-06-2021 12:25:50] ALL DEPENDENCIES OK
[21-06-2021 12:25:51] Beginning read-depth histogram generation
@alanorth
alanorth / doi-to-handle.py
Created January 5, 2021 14:17
DOI to Handle script so we can Tweet some Handles without Altmetric scores and have Altmetric notice them
#!/usr/bin/env python3
#
# doi-to-handle.py 0.0.1
#
# Copyright 2021 Alan Orth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@alanorth
alanorth / gist:2257946
Created March 30, 2012 23:45
Fix melfas touch screen on ICS
diff --git a/drivers/input/touchscreen/melfas_ts.c b/drivers/input/touchscreen/melfas_ts.c
index 2bb5b95..3b6e9c1 100755
--- a/drivers/input/touchscreen/melfas_ts.c
+++ b/drivers/input/touchscreen/melfas_ts.c
@@ -144,7 +144,8 @@
input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x); \
input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y); \
input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, amplitude); \
- input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, width); \
+ input_report_abs(ts->input_dev, ABS_MT_PRESSURE, amplitude); \
@alanorth
alanorth / arch-install-encrypted.md
Last active October 11, 2020 00:02
Installing Arch Linux on an SSD with plain boot but encrypted /, /home, etc.
@alanorth
alanorth / request.json
Created September 25, 2020 10:08
DSpace Statistics API with POST to /items
{
"limit": 10,
"page": 0,
"dateFrom": "2020-01-01T00:00:00Z",
"dateTo": "2020-09-09T00:00:00Z",
"items": ["f44cf173-2344-4eb2-8f00-ee55df32c76f", "2324aa41-e9de-4a2b-bc36-16241464683e", "8542f9da-9ce1-4614-abf4-f2e3fdb4b305", "0fe573e7-042a-4240-a4d9-753b61233908", "b2c1bbfd-65b0-438c-9e49-d271c49b2696", "000dc7cd-9485-424b-8ecf-78002613cc87", "000e1616-3901-4431-80b1-c6bc67312d8c", "000e61ca-695d-43e5-9ab8-1f3fd7a67a32", "000ea897-5557-49c7-9f54-9fa192c0f83b", "000ec427-97e5-4766-85a5-e8dd62199ab5", "000f60f1-19d6-436a-b607-1573901fbfe4", "0010511b-a15f-496a-93b4-1885e6cf9ad8", "00115034-8e0f-4665-b589-e30ed01378ed", "001289a1-260c-466c-8def-5a786cf06ca7", "0012c0d0-6224-4f8a-84a6-0a4281bd8837", "0013519c-6753-4fe1-afff-22e0060140c7", "00135d25-b5f8-4bea-92ae-9bbecb2b441f", "0013f7e9-8def-45e0-aaf2-16cbc09d3d34", "0014d899-a29e-4472-84aa-e8b42ccaa687", "0015da03-c836-4e58-bfd7-d5bac17f8c3e", "0015e295-18a9-4bd2-ab44-99cf0a5cd4ee", "0016716f-e980-4aa7-b196-13bb9f69215a", "00193a18-dba5-43b
@alanorth
alanorth / monster-software.md
Last active August 27, 2020 18:03
Software installed for Abdulfatai on Monster server in Addis in 2020-08

Software Installation Notes

A list of software installed on the Monster server in Addis in 2020-08:

  • AdapterRemoval/2.3.1
  • AdmixTools/7.0.1
  • bamstats/1.25
  • bcftools/1.10.2
  • bowtie2/2.4.1
  • fastq_screen/0.14.1
  • fastqc/0.11.9
@alanorth
alanorth / mirage2-ubuntu16.04.md
Last active July 30, 2020 20:26
Preparing the Mirage 2 build environment on Ubuntu 16.04

Build Environment for Mirage 2 on Ubuntu 16.04

My earlier notes for 14.04 basically work fine on Ubuntu 16.04 but I've corrected and improved a few things in this version.

DSpace 5's Mirage 2 requires some extra setup if you want to tweak the base config and rebuild it. As Mirage 2 is based on the Bootstrap framework it needs a few NodeJS and Ruby packages to be available in the build environment.

We build and deploy DSpace from the tomcat7 system user (which is the default user for Tomcat on Ubuntu), and there are a few assumptions that must be met to allow the installation of NodeJS and Ruby:

  • The tomcat7 user must be able to write to its home folder — /usr/share/tomcat7 — so it can create the ~/.nvm, ~/.npm, ~/.rvm, ~/.gnupg and other directories during installation
  • The ~tomcat7/.profile file must exist and be writable before installing nvm and rvm, as this is the default config file for lo