Have all sample names in samples, one per line and run:
for sample in $(cat samples); do
IFS=$'\n'
for line in $(./sra-runs.py $sample); do
echo $sample $line >> runs
done
| [T]he difference between a bad programmer and a | |
| good one is whether he considers his code or his | |
| data structures more important. Bad programmers | |
| worry about the code. Good programmers worry about | |
| data structures and their relationships. | |
| -- Linus Torvalds | |
| ~~~ | |
| Clarity and brevity sometimes are at odds. | |
| When they are, I choose clarity. | |
| -- Jacob Kaplan-Moss |
| # Stashing is a great way to pause what you’re currently working on and come | |
| # back to it later. For example, if you working on that awesome, brand new | |
| # feature but someone just found a bug that you need to fix. Add your changes to | |
| # the index using | |
| $ git add . | |
| # Or add individual files to the index, your pick. Stash your changes away with: | |
| $ git stash |
| library("shiny") | |
| library("foreign") |
| #!/path/2/Rscript | |
| # License: CC0 (just be nice and point others to where you got this) | |
| # Author: Robert M Flight <rflight79@gmail.com>, github.com/rmflight | |
| # | |
| # This is a post-commit hook that after a successful commit subsequently increments the package version in DESCRIPTION | |
| # and commits that. Analogous to the pre-commit at https://gist.github.com/rmflight/8863882, but useful if you only have | |
| # good reasons for not doing it on the pre-commit. | |
| # | |
| # To install it, simply copy this into the ".git/hooks/post-commit" file of your git repo, change /path/2/Rscript, and make |
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
2017-08-03: Since I wrote this in 2014, the universe, specifically Kirill Müller (https://github.com/krlmlr), has provided better solutions to this problem. I now recommend that you use one of these two packages:
I love these packages so much I wrote an ode to here.
I use these packages now instead of what I describe below. I'll leave this gist up for historical interest. 😆
| # -*- coding: utf-8 -*- | |
| """A simple tool to document how to control AWS resources. | |
| AWS AUTHENTICATION | |
| ------------------- | |
| In order to run any of the code below, you need a profile with AWS credentials | |
| set up on your computer. It's very easy to do this. Google how to configure | |
| your profile with boto3, or visit the docs: |
Sometimes you want to retrieve EC2 insntances' region information.
You can query that information through instance metadata(169.254.169.254).
$ curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document
{
"privateIp" : "172.31.2.15",
"instanceId" : "i-12341ee8",
"billingProducts" : null,
"instanceType" : "t2.small",