Skip to content

Instantly share code, notes, and snippets.

View ajmazurie's full-sized avatar

Aurélien Mazurie ajmazurie

  • Bozeman, MT
View GitHub Profile
@ajmazurie
ajmazurie / broadsee-start.sh
Created October 20, 2016 19:25
Startup script for OHDSI Broadsee
#!/bin/bash
PGSCHEMA=${1:-public}; PGDATABASE=${PGDATABASE:-postgres}
PGHOST=${PGHOST:-localhost}; PGPORT=${PGPORT:-5432}
PGUSER=${PGUSER:-postgres}; PGPASSWORD=${PGPASSWORD:-postgres}
PGURI="postgresql://${PGHOST}:${PGPORT}/${PGDATABASE}"
tmp_docker_compose="docker-compose.yml"
cat > ${tmp_docker_compose} <<EOB
@ajmazurie
ajmazurie / Makefile
Last active January 16, 2020 19:35
Generic Makefile used for my Python projects
PROJECT_NAME := $(shell python setup.py --name)
PROJECT_VERSION := $(shell python setup.py --version)
SHELL := /bin/bash
BOLD := \033[1m
DIM := \033[2m
RESET := \033[0m
.PHONY: all
@ajmazurie
ajmazurie / README.md
Created December 10, 2015 20:05
ssbatch: dead-simple parameter exploration on SLURM-powered computer clusters

ssbatch

The ssbatch command-line utility makes it easy to use a SLURM-powered computer cluster to run a command with different sets of parameters and/or values for these parameters. No need to write your own sbatch submission scripts; ssbatch will do it for you.

Using tags

ssbatch offers a simple tag system to describe the values a parameter should take. You can set a single value, a list of values (including list of files), or a range. ssbatch will then iterate through all the resulting sets of parameters and submit them to SLURM as a job array.

Here are some examples:

@ajmazurie
ajmazurie / cytoscape_decorator.py
Created July 20, 2015 21:39
Short script to generate PDF figures of a Cytoscape-generated metabolic pathway overlaid with arrows. Arrow sizes are proportional to values taken from a CSV input file.
#!/usr/bin/env python
from __future__ import print_function
import csv
import sys
import xml.etree.ElementTree as etree
import pyx
import pyx.connector
@ajmazurie
ajmazurie / ansible-playbook-local
Created August 6, 2014 15:36
Very simple bash script wrapping ansible-playbook to deploy a playbook locally
#!/bin/bash
inventory_fn=$(mktemp -t $(basename $0))
echo "localhost ansible_connection=local" > ${inventory_fn}
ansible-playbook -i ${inventory_fn} $@
rm ${inventory_fn}
@ajmazurie
ajmazurie / starcluster-hostname
Last active September 9, 2016 11:30
Retrieve the hostname from an existing StarCluster cluster on the command-line
#!/bin/bash
if [[ $# != 1 ]]; then
echo "ERROR: a cluster name must be provided" 1>&2
exit 1
fi
cluster_meta="$(starcluster listclusters $1 2>&1)"
if [[ $? != 0 ]]; then