Skip to content

Instantly share code, notes, and snippets.

View kennethgillen's full-sized avatar

Kenny Gillen kennethgillen

View GitHub Profile
@kennethgillen
kennethgillen / tail-logs-restart-pixeldata.bash
Last active April 6, 2018 15:44
If OMERO PixelData process is choking on a set of uploaded files, set a shell to restart it to allow the batch to be overcome.
tail -fn0 /opt/omero/server/OMERO.server/var/log/PixelData-0.log | \
while read line ; do
echo "$line" | grep "ome.conditions.InternalException: Wrapped Exception: (java.lang.OutOfMemoryError)"
if [ $? = 0 ]
then
sudo -u omero-server /opt/omero/server/OMERO.server/bin/omero admin ice "server stop PixelData-0" && echo $(date) restarted PixelData process | tee ~/command_log.txt
fi
done
@kennethgillen
kennethgillen / omero-user-sessions-unique_users
Last active May 25, 2018 10:29
Check_MK local check for OMERO server which returns count of unique users logged-in to an OMERO server
#!/usr/bin/python
from commands import getstatusoutput
import datetime
import socket
# [email protected]
# This code is a Check_MK local check, designed to query an OMERO server via `omero sessions who`
# and return the number of logged in OMERO users to Check_MK.
# Check_MK reference: https://mathias-kettner.de/checkmk_localchecks.html
#
@kennethgillen
kennethgillen / pysearch
Last active November 1, 2018 17:15
# A simple shim using WRK to make fast Trello searching work from the UI.
#!/usr/bin/python
# A simple shim using WRK to make fast Trello searching work from the CLI.
import subprocess
import sys
import re
import argparse
debug= False