This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess | |
from celery.task import task | |
# Task overlapping: | |
# lvm_create --> archive --> transfer(delayed?) --> (verify) --> lvm_destroy | |
# basecalling --> fastq transfer (8h ?) | |
# Without LVM: | |
# archive --> transfer --> verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Small logbook snippet addressing some confusion on record injection | |
import logbook | |
handler = logbook.MailHandler("test@example.com", ['recipient@example.com'], | |
format_string=u'''Subject: [BCBB] {record.extra[run]} \n\n {record.message}''', level='INFO', bubble = True) | |
log = logbook.Logger("mailtest.log") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import csv | |
import sys | |
import os | |
ss_reader = csv.DictReader(open(sys.argv[1], 'rU')) | |
ss_writer = csv.DictWriter(open(os.path.splitext(sys.argv[1])[0]+"_a.csv", 'w'), ss_reader.fieldnames) | |
ss_writer.writerow(dict((fn,fn) for fn in ss_reader.fieldnames)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Generates a TAR archive while computing MD5 checksum for each file. | |
# From VeriTAR: http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/ | |
DATASET_PATH=`readlink -f $1` | |
DATASET=`basename $DATASET_PATH` | |
EXCLUDE_FILES="--exclude .DS_Store --exclude .AppleDouble" | |
echo "Creating TAR + MD5 for dataset: $DATASET" | |
tar -cvpf $DATASET.tar $DATASET_PATH $EXCLUDE_FILES \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import os | |
import logging | |
import glob | |
import random | |
from collections import * | |
fters = defaultdict(set) | |
all = set(["%04d.filter" % x for x in range(1, 70)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DATASET=" | |
SRC="" | |
DST="" | |
if [ -d ${SRC}${DATASET} ]; then | |
echo "Copying ${SRC}${DATASET} into $DST..." | |
chown -R $USER:uppmax ${SRC}${DATASET} | |
rsync -a ${SRC}${DATASET} ${DST} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import json | |
import gzip | |
import datetime | |
import requests | |
import cPickle as pickle | |
from datetime import datetime | |
slack_token = "<SLACK_TOKEN>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import flickrapi | |
import datetime | |
import os | |
import shutil | |
import subprocess | |
api_key = 'SETME!!!' | |
api_secret = 'SETME!!!' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To use an Openstack cloud you need to authenticate against keystone, which | |
# returns a **Token** and **Service Catalog**. The catalog contains the | |
# endpoint for all services the user/tenant has access to - including nova, | |
# glance, keystone, swift. | |
# | |
# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We | |
# will use the 1.1 *compute api* | |
export OS_AUTH_URL=https://pouta.csc.fi:5001/v2.0 |