Skip to content

Instantly share code, notes, and snippets.

View chris-allan's full-sized avatar

Chris Allan chris-allan

View GitHub Profile
@chris-allan
chris-allan / OmeroDatasetExport.java
Created October 4, 2011 15:48
OMERO dataset export example in Java
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import Glacier2.CannotCreateSessionException;
import Glacier2.PermissionDeniedException;
import omero.ServerError;
@chris-allan
chris-allan / omero_homebrew.sh
Created October 14, 2011 08:17 — forked from joshmoore/README.md
Bootstrap script for creating and installing OMERO via Homebrew.
#!/bin/bash
set -e
set -u
DIR=$1
shift
OMERO_GIT=${OMERO_URL:-git://github.com/joshmoore/homebrew.git}
OMERO_URL=${OMERO_URL:-https://github.com/joshmoore/homebrew/tarball/omero}
@chris-allan
chris-allan / tileperf.py
Created January 25, 2012 17:51
PixelData tile performance log parsing script
#!/usr/bin/env python
# encoding: utf-8
"""
Performs various performance metrics and reports on PixelData log files.
"""
# Copyright (C) 2011 University of Dundee
# This program is free software; you can redistribute it and/or
@chris-allan
chris-allan / OmeroImport.java
Created January 31, 2012 11:59
OMERO import example in Java
import loci.formats.in.DefaultMetadataOptions;
import loci.formats.in.MetadataLevel;
import ome.formats.OMEROMetadataStoreClient;
import ome.formats.importer.ImportConfig;
import ome.formats.importer.cli.ErrorHandler;
import ome.formats.importer.cli.LoggingImportMonitor;
import omero.model.Dataset;
public class OmeroImport {
@chris-allan
chris-allan / edit_plate.py
Created September 20, 2012 16:51
OMERO plate attribute update example in Python
#
# To be run in OMERO CLI shell as follows:
#
# # Download script to current working directory
# omero shell --login
# ...
# %run -i edit_plate.py plate_id attribute value
#
import sys
@chris-allan
chris-allan / pyramid.py
Created September 27, 2012 07:57
OMERO pyramid checking script
import time
import omero
import omero.clients
from omero.rtypes import unwrap
HOST='localhost'
PORT=4064
USER='root'
@chris-allan
chris-allan / omero_stats.sh
Created January 25, 2013 13:38
OMERO server stats for Images, frames and logins
#!/bin/bash
set -e
set -u
set -x
HOSTNAME="localhost"
DATABASE="omero"
USER="omero-x"
THIRTY_DAYS_AGO="$(date -d '30 days ago' '+%Y-%m-%d %H:%M:00')"
@chris-allan
chris-allan / lock_files_in_directory.py
Last active December 11, 2015 22:48
Attempts to perform an exclusive, non-blocking lock on an open file handle to each file in a directory.
#!/usr/bin/env python
import traceback
import fcntl
import sys
import os
try:
d, = sys.argv[1:]
except ValueError:
print 'Usage: %s <directory>' % sys.argv[0]
@chris-allan
chris-allan / OMERO5.0DEV__3.sql
Last active December 16, 2015 07:59
OMERO5.0DEV__3 to OMERO5.0DEV__4 database upgrade script
-- Copyright (C) 2013 Glencoe Software, Inc. All rights reserved.
--
-- 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 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@chris-allan
chris-allan / OMERO5.0DEV__4.sql
Created June 4, 2013 12:58
OMERO5.0DEV__4 to OMERO5.0DEV__5 database upgrade script
-- Copyright (C) 2013 Glencoe Software, Inc. All rights reserved.
--
-- 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 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the