Skip to content

Instantly share code, notes, and snippets.

View icaoberg's full-sized avatar

icaoberg icaoberg

View GitHub Profile
@icaoberg
icaoberg / numberofusers.sh
Created May 25, 2013 17:29
[OMERO.server][OMERO.searcher] Get number of users in a group using the command line tools
#!/bin/bash
GROUPNAME=developers
omero group list | grep $GROUPNAME | cut -d"|" -f5
@icaoberg
icaoberg / adduser2group.sh
Created May 25, 2013 18:31
[OMERO.server][OMERO.searcher] Add a user to an existing group using the command line tools
#!/bin/bash
USERNAME=icaoberg
GROUPNAME=developers
omero group insert $GROUPNAME $USERNAME
@icaoberg
icaoberg / removeuserfromgroup.sh
Created May 25, 2013 18:32
[OMERO.server][OMERO.searcher] Remove a user to an existing group using the command line tools
#!/bin/bash
USERNAME=icaoberg
GROUPNAME=developers
omero group remove $GROUPNAME $USERNAME
@icaoberg
icaoberg / copyallusers.sh
Created May 25, 2013 18:35
[OMERO.server][OMERO.searcher] Copy all the users from one group to another
#!/bin/bash
FIRSTGROUPNAME=developers
SECONDGROUPNAME=murphylab
omero group copyusers $FIRSTGROUPNAME $SECONDGROUPNAME
@icaoberg
icaoberg / isuser.sh
Created May 25, 2013 19:34
[OMERO.server][OMERO.searcher] Check if a user exists in the OMERO.server
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <username>" >&2
exit 1
fi
USERNAME=$1
TEMP=`omero user list | grep "$USERNAME"`
if [ -z "$TEMP" ]; then echo false; else echo true; fi
@icaoberg
icaoberg / isgroup.sh
Last active December 17, 2015 18:08
[OMERO.server][OMERO.searcher] Check if a group exists in the OMERO.server
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <groupname>" >&2
exit 1
fi
GROUPNAME=$1
TEMP=`omero group list | grep "$GROUPNAME"`
if [ -z "$TEMP" ]; then echo false; else echo true; fi
@icaoberg
icaoberg / mayavi_install.sh
Last active May 28, 2017 06:02
[Python] Install Mayavi in Ubuntu
#!/bin/bash
sudo apt-get install python-vtk python-wxgtk2.6 python-setuptools python-numpy python-configobj
sudo easy_install pip
sudo pip install mayavi
@icaoberg
icaoberg / list_all_queues.sh
Created June 7, 2013 20:14
[PBS] List all queues
pbs -Q
@icaoberg
icaoberg / rename.sh
Created July 16, 2013 04:30
[BASH] Rename all files in the current folder using a universally unique identifier (UUID)
#!/bin/bash
for FILE in *
do
if [ -f "$FILE" ];then
ID=`uuidgen`
EXTENSION=${FILE#*.}
mv -v "$FILE" "$ID"."$EXTENSION"
fi
done
@icaoberg
icaoberg / rename.sh
Created July 16, 2013 04:35
[BASH] Rename all files in the subdirectories of the current folder using a universally unique identifier (UUID)
for FOLDER in *
do
if [ -d "$FOLDER" ]; then
echo "$FOLDER"
cd "$FOLDER"
for FILE in *
do
ID=`uuidgen`
EXTENSION=${FILE#*.}
mv -v "$FILE" "$ID"."$EXTENSION"