Skip to content

Instantly share code, notes, and snippets.

@indraniel
indraniel / GitHub curl.sh
Created Dec 4, 2018 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
View GitHub curl.sh
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@indraniel
indraniel / replme.sh
Created Dec 3, 2018
clj tools version of `lein-try`
View replme.sh
#!/bin/sh
# tools-deps equivalent of `lein-try`
#
# Additionally see:
#
# https://github.com/hagmonk/find-deps -- what user/find-deps links to
# https://github.com/juxt/edge/blob/master/main/aliases/rebel/edge/rebel/main.clj
# https://clojars.org/seancorfield/depstar -- clj-based uberjarrer
View Running and Writing Output to console at the same time
p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
# Grab stdout line by line as it becomes available. This will loop until
# p terminates.
while p.poll() is None:
l = p.stdout.readline() # This blocks until it receives a newline.
print l
# When the subprocess terminates there might be unconsumed output
# that still needs to be processed.
print p.stdout.read()
@indraniel
indraniel / GenotypeGVCF.wdl
Last active Nov 14, 2018
Example of the internals of a cromwell script (taken from the GenotypeGVCFs task of the GATK4 pipeline_)
View GenotypeGVCF.wdl
task GenotypeGVCFs {
File workspace_tar
String interval
String output_vcf_filename
String gatk_path
File ref_fasta
File ref_fasta_index
@indraniel
indraniel / tramp-gcloud-ssh
Created Sep 8, 2018 — forked from scjody/tramp-gcloud-ssh
EMACS TRAMP setup for "gcloud compute ssh"
View tramp-gcloud-ssh
;; TRAMP gcloud ssh
(add-to-list 'tramp-methods
'("gssh"
(tramp-login-program "gssh")
(tramp-login-args (("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
("-o" "UserKnownHostsFile=/dev/null")
@indraniel
indraniel / 1_google_cloud_storage_backup_tutorial.md
Created Sep 8, 2018 — forked from rnwolf/1_google_cloud_storage_backup_tutorial.md
Tutorial shows how to make backups to Google Cloud Storage.
View 1_google_cloud_storage_backup_tutorial.md

Google Cloud Storage backup tutorial

Introduction

This tutorial shows how to make backups to Google Cloud Storage. The backups are:

  • automatic
  • stored off site
  • incremental
@indraniel
indraniel / gcp-price-list.json
Created Jun 13, 2018
Old style google cloud platform (GCP) JSON price list . Modern times now use the GCP billing API
View gcp-price-list.json
{
"comment": "If you've gotten here by mistake, this is the JSON data used by our pricing calculator. It is helpful for developers. Go to https://cloud.google.com/products/calculator/ to get back to our web calculator.",
"version": "v1.13",
"updated": "01-August-2017",
"gcp_price_list": {
"sustained_use_base": 0.25,
"sustained_use_tiers": {
"0.25": 1.0,
"0.50": 0.8,
"0.75": 0.6,
@indraniel
indraniel / Dockerfile-GATK4
Last active Jun 6, 2018
GATK4 Dockerfile (4.0.4.0)
View Dockerfile-GATK4
# Using OpenJDK 8
FROM broadinstitute/gatk:gatkbase-1.2.3
ARG DRELEASE
ADD . /gatk
WORKDIR /gatk
RUN /gatk/gradlew clean compileTestJava sparkJar localJar createPythonPackageArchive -Drelease=$DRELEASE
WORKDIR /root
View common-lisp-scripting-with-roswell.md

Common Lisp Scripting with Roswell

"Roswell Script" is implementation-independent Common Lisp scripting program which uses Roswell. Although Roswell itself is a unified interface to Common Lisp implementations, it also encourages writing scripts with it.

To start writing it, run ros init in your terminal:

$ ros init
Usage: ros init [template] name [options...]