Skip to content

Instantly share code, notes, and snippets.

View hardyoyo's full-sized avatar
🕺
husslin'

Hardy Pottinger hardyoyo

🕺
husslin'
View GitHub Profile
# Bash function to have Docker-Compose send a notification upon completion, because it can take a while
# "cheers" -> https://bigsoundbank.com/sound-0237-shouts-and-applauses-of-teens-2.html
# only works on a Mac, you'd have to revise it for other operating systems
docker-compose() {
local cmd="docker-compose $@"
command $cmd && osascript -e 'display notification "$cmd" with title "Docker-Compose Done" sound name "cheers"'
}
#!/usr/bin/env python3
import feedparser
import requests
import re
def monitor_jenkins_rss(rss_url):
try:
response = requests.get(rss_url)
response.raise_for_status()
@hardyoyo
hardyoyo / HandyLittleTools.md
Last active August 3, 2022 21:49
Handy Little Tools, written with Rust
@hardyoyo
hardyoyo / test-errors.txt
Last active June 23, 2022 20:29
Janeway test error on current master branch, with head at 354b7e8fd, using MySQL db, in Lando dev environment
E......EE................DEBUG 2022-06-23 17:37:44,378 middleware P:1252 T:139987040339776 [TST] Current Language not in the available languages. Activating en
INFO 2022-06-23 17:38:26,716 middleware P:1252 T:139987040339776 [TST] Request took 42.338 (13.553u, 3.932s)
.DEBUG 2022-06-23 17:38:28,487 middleware P:1252 T:139987040339776 [TST] Current Language not in the available languages. Activating en
INFO 2022-06-23 17:38:33,853 middleware P:1252 T:139987040339776 [TST] Request took 5.365 (1.939u, 0.473s)
.........DEBUG 2022-06-23 17:38:41,010 model_utils P:1252 T:139987040339776 [TST] Calculating last_mod for <class 'submission.models.Article'>: 93 - This is a test article
DEBUG 2022-06-23 17:38:41,063 model_utils P:1252 T:139987040339776 [TST] Calculating last_mod for <class 'submission.models.Section'>: 125 - Test Section
....WARNING 2022-06-23 17:38:41,221 setting_handler P:1252 T:139987040339776 [TST] Passing 'create' to get_setting has been deprecated in in favour of returning the default value
WARNING
@hardyoyo
hardyoyo / TastyAle.txt
Last active July 7, 2021 00:09
Hardy's Tasty Ale, almost a Kölsch
Vol: 5 Gals
Style: Not quite a Kölsch
Malts:
6 Lbs Northwestern LME, Gold
1 Lb Cara-pils, American
1 Lb Vienna, American
Hop Schedule:
.5 oz Chinook (12%) 60 minutes
@hardyoyo
hardyoyo / .lando.yml
Created April 30, 2021 23:16
draft Landofile for an ePrints dev environment
name: eprints
services:
appserver:
type: apache
build_as_root:
- apt-get -y update && apt-get install -y perl libncurses5 libselinux1 libsepol1 build-essential libapache2-mod-perl2 libxml-libxml-perl libcgi-pm-perl libunicode-string-perl libterm-readkey-perl libmime-lite-perl libmime-types-perl libxml-libxslt-perl libdigest-sha-perl libdbd-mysql-perl libxml-parser-perl libxml2-dev libxml-twig-perl libarchive-any-perl libjson-perl lynx wget ghostscript xpdf antiword elinks pdftk texlive-base texlive-base-bin psutils imagemagick adduser default-mysql-client unzip libsearch-xapian-perl libtex-encode-perl libio-string-perl
- ln -s /app /opt/eprints3
webroot: .
# config:
@hardyoyo
hardyoyo / janeway_testing_error_with_latest_Lando.txt
Created December 22, 2020 21:44
error running tests with current Janeway master in Lando with PostreSQL as the DB, and latest Lando, latest Docker Desktop
lando manage check
System check identified no issues (15 silenced).
hpotting@CDL-HPOTTING-9m:~/workspace/janeway master *%= |-/ lando manage test
nosetests --verbosity=1
Creating test database for alias 'default'...
Traceback (most recent call last):
File "/var/www/.local/lib/python3.6/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
psycopg2.errors.UndefinedObject: type "citext" does not exist
LINE 1: ...ne NULL, "is_superuser" boolean NOT NULL, "email" citext NOT...
@hardyoyo
hardyoyo / mint_method.py
Last active October 5, 2020 16:56
Scratchpad for developing a Python method to mint DOIs via EZID, WIP
''' a scratch pad for developing the DOI minting method we will use with Janeway '''
# import os
import re
from urllib.parse import quote
import urllib.request as urlreq
from xmltodict import unparse
SHOULDER = 'doi:10.15697/' #for the actual plugin, get the value from the settings.py
USERNAME = 'apitest' #for the actual plugin, get the value from the settings.py
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability the error(s) are [
Dependency convergence error for org.codehaus.plexus:plexus-component-annotations:1.5.5 paths to dependency are:
+-info.freelibrary:bucketeer:0.0.1-SNAPSHOT
+-info.freelibrary:freelib-utils:0.8.10
+-org.apache.maven:maven-plugin-api:3.5.4
+-org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.3
+-org.codehaus.plexus:plexus-component-annotations:1.5.5
and
+-info.freelibrary:bucketeer:0.0.1-SNAPSHOT
Exception in thread "main" java.lang.AssertionError
at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:46)
at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:247)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.readSourceFile(JavaCompiler.java:837)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ImplicitCompleter.complete(JavacProcessingEnvironment.java:1521)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1326)
at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.complete(Type.java:1140)
at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.getTypeArguments(Type.java:1066)