Skip to content

Instantly share code, notes, and snippets.

View atarkowska's full-sized avatar

Ola Tarkowska atarkowska

  • Cambridge, UK
View GitHub Profile
@atarkowska
atarkowska / curl_omero_web.sh
Created January 18, 2016 12:12
Log in to OMERO.web
#!/bin/bash
#
set -u
set -e
set -x
COOKIES=cookies.txt
LOGIN_URL=https://omero.host/prefix/webclient/login/
@atarkowska
atarkowska / test-download.sh
Last active February 3, 2016 09:54
Test download
#!/bin/bash
#
set -u
set -e
set -x
OMERO_HOST='https://cowfish.openmicroscopy.org/merge'
DIRECTORY='/data/files'
if [ -d "$DIRECTORY" ]; then
@atarkowska
atarkowska / gene.py
Created March 15, 2016 16:13
Load all genes
import omero
import omero.gateway
import time, datetime
from omero.rtypes import *
host = "localhost"
port = 4064
passwd = "SECRET"
user = "USER"
$ dist/bin/omero import /Users/ola/OMERO/IMAGE/DEMO/PTRE/P-TRE_1_R3D_D3D.dv --debug=DEBUG
Previously logged in to 192.168.99.100:4064 as root
Server: [192.168.99.100:4064]
Username: [root]
Password:
Created session b851c807-efd4-462d-b57f-567daaa622c3 ([email protected]:4064). Idle timeout: 10 min. Current group: system
2016-04-28 13:59:14,273 247 [ main] INFO ome.formats.importer.ImportConfig - OMERO Version: 5.2.2-205-5acf9b8-dirty-ice35-b1
2016-04-28 13:59:14,287 261 [ main] INFO ome.formats.importer.ImportConfig - Bioformats version: 5.1.8 revision: 9eb8da31c1f01989f439963b9cc215b4398bedd8 date: 12 February 2016
2016-04-28 13:59:14,327 301 [ main] INFO formats.importer.cli.CommandLineImporter - Log levels -- Bio-Formats: DEBUG OMERO.importer: DEBUG
2016-04-28 13:59:14,329 303 [ main] DEBUG ome.formats.importer.ImportConfig - Loaded savedDirectory from ome.formats.importer.util.IniFileLoader@6e6c3152
lifesci-45789:omero-grid-docker ola$ eval "$(docker-machine env omerodev)"
lifesci-45789:omero-grid-docker ola$ ./build.py omero-grid
Running: docker build --build-arg OMERO_VERSION=latest -t openmicroscopy/omero-grid:latest omero-grid
Sending build context to Docker daemon 10.75 kB
Step 1 : FROM centos:centos7
---> 778a53015523
Step 2 : MAINTAINER [email protected]
---> Using cache
---> 068ba647d62a
Step 3 : RUN yum -y install epel-release && curl -o /etc/yum.repos.d/zeroc-ice-el7.repo http://download.zeroc.com/Ice/3.5/el7/zeroc-ice-el7.repo && yum -y install unzip wget patch java-1.8.0-openjdk ice ice-python ice-servers python-pip numpy scipy python-matplotlib python-pillow python-tables postgresql && yum clean all
@atarkowska
atarkowska / omero-web-cache.conf
Last active May 26, 2016 13:34
Example of omero web rendering cache for nginx
proxy_cache_path /data/omero-cache levels=1:2 keys_zone=omero:200m inactive=30d use_temp_path=off;
map $request_uri $skip_cache
{
default 1;
"~web(client|gateway)/(render)_*" 0;
}
upstream omeroweb_omero {
...
@atarkowska
atarkowska / test_mapannotation
Last active June 9, 2016 10:36
MapAnnotation vs NamedValue
import omero, os
import omero.gateway
from omero.rtypes import *
from omero.rtypes import unwrap
host = "localhost"
port = 4064
pass = "ome"
user = "test"
@atarkowska
atarkowska / mapannotation_remove_duplicates
Last active July 1, 2016 15:53
Remove duplicates of MapAnnotations
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
import omero, os
host = "localhost"
port = 4064
user = "user-1"
password = "ome"
c = omero.client(host=host, port=port)
s = c.createSession(user, password)
@atarkowska
atarkowska / share-group.log
Last active June 26, 2016 07:35
This is an output of OMERO CLI to prepare users and groups and then put group into share to override the default group permission making it rear-only and sharing with public user
+ echo 'create public user'
create public user
+ /home/omero/workspace/OMERO-server/OMERO.server/bin/omero login -u root -w omero -s localhost -p 4064
Created session acc7b1af-82a2-4762-b9ff-a30ada1c0676 (root@localhost:4064). Idle timeout: 10 min. Current group: system
+ /home/omero/workspace/OMERO-server/OMERO.server/bin/omero group add public --perms rwr---
Using session acc7b1af-82a2-4762-b9ff-a30ada1c0676 (root@localhost:4064). Idle timeout: 10 min. Current group: system
Added group public (id=3) with permissions rwr---
+ /home/omero/workspace/OMERO-server/OMERO.server/bin/omero user add public Public User --group-name public -P ome
Using session acc7b1af-82a2-4762-b9ff-a30ada1c0676 (root@localhost:4064). Idle timeout: 10 min. Current group: system
Added user public (id=2) with password