Skip to content

Instantly share code, notes, and snippets.

View kennethgillen's full-sized avatar

Kenny Gillen kennethgillen

View GitHub Profile
@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
@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
# k.h.gillen@dundee.ac.uk
# 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 / 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
# Owned, and run by, the OMERO-server O.S. user
# Executed like ./upgrade-server.sh new-omero-version-dist.tar.gz
set -e
set -u
set -x
DIR=$1
# Your command to check status and stop OMERO.server
@kennethgillen
kennethgillen / Vagrantfile
Last active November 3, 2017 08:56
ome-ansible-training_Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |vb|
config.vm.network "forwarded_port", guest: 80, host: 8080,
auto_correct: true
config.vm.network "forwarded_port", guest: 443, host: 8443,
auto_correct: true
config.vm.network "forwarded_port", guest: 4063, host: 4063,
auto_correct: true
config.vm.network "forwarded_port", guest: 4064, host: 4064,
@kennethgillen
kennethgillen / logwatch.cfg
Created February 14, 2017 16:32
snippet from OMERO server check_mk logwatch.cfg
# Replacing this with a regex to catch all the current logfiles: (note: may want to split _brokenrequest.log as the format is very different)
/opt/omero/omero/OMERO-CURRENT/var/log/*.* regex=.*(\.log|\.err)$
# ignore up to 10-70% of servants used
I .*[1234567]0 of servants.*
# Ignore OMEROweb.log 404s
I Not Found
I .*Already locked.*
I .*Reverse for '{}' not found.*
# Ignore Django _brokenrequest 404s
I 404
@kennethgillen
kennethgillen / gist:f787b5987d3ad5116de407d3987a0c5d
Created July 7, 2016 15:03
Some Ansible "highlight word" triggers for iTerm2 from the iTerm2 prefs com.googlecode.iterm2.plist
<key>Triggers</key>
<array>
<dict>
<key>action</key>
<string>HighlightTrigger</string>
<key>parameter</key>
<integer>2005</integer>
<key>regex</key>
<string>failed</string>
</dict>
#!/bin/bash
# When updating this script, make the same changes to the PrinterInstallerClientUninstall Automator app
echo "Stopping application"osascript -e 'tell application "PrinterInstallerClient" to quit' || true
echo "Removing services"launchctl unload /Library/LaunchDaemons/com.printerlogic.client.plist || truelaunchctl remove com.printerlogic.client || truelaunchctl unload /Library/LaunchAgents/com.printerlogic.client.scheduled_refresh.plist || true# Remove any scheduled_refresh tasks from older versionslaunchctl remove com.printerlogic.client.scheduled_refresh || truelaunchctl unload /Library/LaunchAgents/com.printerlogic.client.scheduled_refresh.*.plist || truekillall -9 PrinterInstallerClientService || truekillall -9 PrinterInstallerClientInterface || truerm -f /Library/LaunchDaemons/com.printerlogic.client* || truerm -f /Library/LaunchAgents/com.printerlogic.client* || true
echo "Unregistering apps"pkgutil --packages | grep printerlogic | xargs -n 1 pkgutil --forget 2> /dev/null || truerm -rf
For Sale:
£5,995 (ono)
https://www.flickr.com/photos/wagonbuild/sets/72157620409735393/
Volkswagen transporter T25 campervan reimo conversion new MOT and taxed ready to go.
1,6 diesel reliable & 5 speed economical. Solid and clean for its age 1988 E, I have looked after this campervan
servicing and repairing for the last 9 years,(over 3 owners) and it has done well, including a tour of Europe with no hiccups.
@kennethgillen
kennethgillen / gist:e2390025a6148f42c6e3
Created July 10, 2014 09:21
OSX 10.9 brew install ice issues
ome-mvm-109:~ hudson$ brew install ice --with-python
==> Downloading http://www.zeroc.com/download/Ice/3.5/Ice-3.5.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/ice-3.5.1.tar.gz
==> Patching
patching file cpp/config/Make.rules.Darwin
patching file py/config/Make.rules.Darwin
patching file cpp/src/IceGrid/DescriptorHelper.h
==> make prefix=/usr/local/Cellar/ice/3.5.1 install_mandir=/usr/local/Cellar/ice/3.5.1/share/man/man1 ins
==> make install prefix=/usr/local/Cellar/ice/3.5.1 install_mandir=/usr/local/Cellar/ice/3.5.1/share/man/
==> make prefix=/usr/local/Cellar/ice/3.5.1 install_mandir=/usr/local/Cellar/ice/3.5.1/share/man/man1 ins