Instantly share code, notes, and snippets.

View solar graph.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Largest+contigs+clean.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View m4a2mp3.bash
#!/usr/local/bin/bash
# Error handling
set -o nounset
set -o errexit
set -o pipefail
# BASH 4 script to convert m4a files into mp3 files
# Needed programs : faad and lame
OIFS="$IFS"
IFS=$'\n'
View get_tree_size.py
#!/usr/bin/env python3
# Simple script to print:
# Size of a directory tree
# Number of files in that tree
# Number of hard links in that tree
# Number of softlinks in that tree
import os
import sys
import datetime
View ssh_alias.sh
#!/bin/bash
# Script to create bash aliases for hostnames in ssh config and known_hosts files
# Original fom http://samrowe.com/wordpress/2008/07/29/bash-ssh-happiness/
# Updated by ja@vanhaarst.net
# Example usage:
# ALIAS_TEMP=$(mktemp);bash ssh_alias.sh | sort -r > $ALIAS_TEMP;source $ALIAS_TEMP;rm $ALIAS_TEMP;alias
set -o errexit # Exit on error
set -o nounset # Exit on use of unset variable
#set -o verbose # Prints shell input lines as they are read.
View gistmirror.sh
#!/bin/bash
# Gist mirror script
# Jan van Haarst jan@vanhaarst.net
# 20150115
# Debug
#set -o xtrace
#set -o verbose
# Stop on error
View filehash.py
__author__ = 'danlmarmot'
"""
This Python script measures hash performance, and attempts to answer this question:
'Given a hash function and a block size for reading, which is the fastest hash function and block size?'
There's no warm up, there's no cache/memory/whatever filling, just a simple way to explore performance for
commonly used functions with the timeit library
"""
View gist:11378466
# bootstrap.yml
---
- hosts: newservers
vars:
- ubuntu_release: raring
- logwatch_email: <your email addy>
# crypted passwords, generated on a Linux box using:
# echo 'import crypt,getpass; print crypt.crypt(getpass.getpass(), "$6$YOURSALT")' | python -
- root_password: ''
View getinsertsize.py
#!/usr/bin/env python
'''
Automatically estimate insert size of the paired-end reads for a given SAM/BAM file.
Usage: getinsertsize.py <SAM file> or samtools view <BAM file> | getinsertsize.py -
Author: Wei Li
'''
from __future__ import print_function
import sys;
View sym2hard.py
#!/usr/bin/env python
import os
import sys
import uuid
random_unique_name = str(uuid.uuid4()) + str(uuid.uuid1())
def find_mount_point(path): # http://stackoverflow.com/questions/4453602/how-to-find-the-mountpoint-a-file-resides-on
path = os.path.abspath(path)