Skip to content

Instantly share code, notes, and snippets.

@vsoch
vsoch / spam-the-queue.sh
Created May 28, 2018 22:16
A nice way to submit jobs (single sbatch lines in a file) when you have a limit
#!/usr/bin/env python
#
# Copyright (C) 2018 Vanessa Sochat.
#
# 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@vsoch
vsoch / README.md
Created May 11, 2018 20:41
longest k unique palidrome

Longest K Unique Characters Substring

Given a string you need to print the size of the longest possible substring that has exactly k unique characters. If there is no possible substring print -1.

Example

For the string aabacbebebe and k = 3 the substring will be cbebebe with length 7.

Specifically, there are three unique characters (c, b, and e) and they create a substring of length 7.

@vsoch
vsoch / Singularity.swist
Last active May 9, 2018 07:56
Natalia's Nipype Issue
Bootstrap: docker
From: nipype/nipype:latest
# This is the adjusted (fixed) build recipe for the issue above.
# sudo singularity build swist Singularity.swist
%labels
Maintainer Natalia
Version v1.0
@vsoch
vsoch / doc-optopus.md
Created May 4, 2018 20:32
The start of the Documentation Octopus

Introduction

Hey friends! I'll add some notes here to follow up on the docs discussion we had earlier (I know you guys are at lunch, no worries!) I think we would do very well to do the following:

Based around Github

Github is really a strong base for current and future development. It will support integration with just about anything, involve users, and have version control and immedate rendering to nice webby places. So it follows that you can think of a documentation base as a Github repo.

Imagine some theoretical stanford-rc/lessons repo where we start adding content.

@vsoch
vsoch / strainphlan-singularity.sh
Last active October 25, 2019 23:55
A tutorial of running strainphlan from biobakery via a Singularity container on the Sherlock cluster
# Tutorial https://bitbucket.org/biobakery/biobakery/wiki/strainphlan#rst-header-how-to-run
# Dockerfiles (container guts)
# https://bitbucket.org/biobakery/biobakery/src/5580bf5ec589732246f15391b1b897eb79786091/docker/strainphlan/Dockerfile?at=default&fileviewer=file-view-default
# https://bitbucket.org/biobakery/biobakery/src/5580bf5ec589732246f15391b1b897eb79786091/docker/base/Dockerfile?at=default&fileviewer=file-view-default
# Load an interactive node
sdev
# Load singularity, ensure cache is on scratch
@vsoch
vsoch / Singularity.color
Created March 14, 2018 21:39
A quick Scientific Application to have a (color set to be on) by default interactive shell
Bootstrap: docker
From: vanessa/scif
# sudo singularity build color.simg Singularity
# ./color.simg shell color
%post
echo "%appenv color
export SHELL=/bin/bash
@vsoch
vsoch / Singularity
Last active March 7, 2018 22:24
The docker version of centos 7 for amrex
Bootstrap: docker
From: centos:7
%help
This is a container to run AMREX binarie on SKL machine. just type ./amrex.img and it should run
%post
yum install -y wget
wget https://github.com/Smahane/Intel-HPC-Container/blob/master/containers/amrex/Nyx3d.intel.MPI.OMP.SKLAVX512.ex
wget https://github.com/Smahane/Intel-HPC-Container/blob/master/containers/amrex/inputs
@vsoch
vsoch / success.sh
Created March 7, 2018 17:12
A working build of a Google Container Registry image using Singularity Global Client
# Note this is with current branch fix/gcr.io of singularityhub/sregistry-cli
# will be released as pypi 0.0.73 soon :)
$ sregistry pull docker://gcr.io/deepvariant-docker/deepvariant:0.5.0
[client|docker] [database|sqlite:////home/vanessa/.singularity/sregistry.db]
Exploding /usr/local/libexec/singularity/bootstrap-scripts/environment.tar
Exploding /home/vanessa/.singularity/docker/sha256:1be7f2b886e89a58e59c4e685fcc5905a26ddef3201f290b96f1eff7d778e122.tar.gz
Exploding /home/vanessa/.singularity/docker/sha256:6fbc4a21b806838b63b774b338c6ad19d696a9e655f50b4e358cc4006c3baa79.tar.gz
Exploding /home/vanessa/.singularity/docker/sha256:c71a6f8e13782fed125f2247931c3eb20cc0e6428a5d79edb546f1f1405f0e49.tar.gz
Exploding /home/vanessa/.singularity/docker/sha256:4be3072e5a37392e32f632bb234c0b461ff5675ab7e362afad6359fbd36884af.tar.gz
Exploding /home/vanessa/.singularity/docker/sha256:06c6d2f5970057aef3aef6da60f0fde280db1c077f0cd88ca33ec1a70a9c7b58.tar.gz
@vsoch
vsoch / config.json
Last active March 7, 2018 05:25
A working, complete python flow to get the various manifests for the gcr.io DeepVariant image
{
"config":{
"AttachStdin":false,
"Cmd":[
"/bin/bash"
],
"Volumes":null,
"Image":"sha256:9d30e8ce67321c61be656426c99dc22c6a8be8f1f03a3adcf8e0dd7d08281ed3",
"Tty":false,
"StdinOnce":false,
docker inspect gcr.io/deepvariant-docker/deepvariant:0.5.0
[
{
"Id": "sha256:c0acf3d54dce5eabf6ae422593a3d266e1d5d61129d53f32ec943d133b395a6c",
"RepoTags": [
"gcr.io/deepvariant-docker/deepvariant:0.5.0"
],
"RepoDigests": [
"gcr.io/deepvariant-docker/deepvariant@sha256:c95f3eba028ad8e3fe3fb4fd6fcc6ba0cd27ff14139c79bba2a9d4acc5a2591c"
],