Skip to content

Instantly share code, notes, and snippets.

@stianlagstad
stianlagstad / sortTestsByTimeTaken.sh
Created January 19, 2018 07:54
Using maven and surefire? This script will help you figure out which tests are slow.
#!/bin/bash
# This script goes through tests results in `target/surefire-reports` and sorts the results by the
# amount of time they took. This is helpful to identify slow tests.
set -e
# Make sure the surefire folder exists
if [ ! -d "target/surefire-reports" ]; then
echo "The folder 'target/surefire-reports' doesn't exists. Please run tests before using this script."
@stianlagstad
stianlagstad / pyodbc in Docker with MySQL and Oracle
Created December 21, 2017 21:47
This Dockerfile should get you going with pyodbc in Docker with the drivers to talk to MySQL and Oracle databases
FROM python:3
WORKDIR /usr/src/app
# Copy over the drivers
# MySQL ODBC Ansi
COPY drivers/mysql-connector-odbc-5.3.9-linux-ubuntu16.04-x86-64bit.tar.gz .
# Oracle 11.2
COPY drivers/oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm .
COPY drivers/oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm .
@stianlagstad
stianlagstad / getSequenceById.sh
Created February 3, 2016 12:23
Extract specific sequences from a fastq file with this bash oneliner
egrep -A 3 '@readid1|readid2|readid3' reads.fastq | sed '/^--$/d'