Create a new session then rename it:
C-b :new C-b $
Create a new named session:
import os | |
import sys | |
# Ensure that a virtualenv is active before importing non-stdlib dependencies. | |
venv = os.environ.get('VIRTUAL_ENV') | |
if not venv: | |
sys.exit('--> an active virtualenv is required'.format(venv)) | |
from SCons.Script import (Environment, Variables, Help, Decider) |
#!/bin/bash | |
# Requires argparse.bash (https://github.com/nhoffman/argparse-bash) | |
# in the same directory as this script | |
# Installation: | |
# cd ~/bin # or another location on your $PATH | |
# curl https://gist.githubusercontent.com/nhoffman/8636c6e267cb4403ac3a35ff0bc53f3d/raw/ > ssh-tunnel | |
# chmod +x ssh-tunnel | |
# curl -O https://raw.githubusercontent.com/nhoffman/argparse-bash/master/argparse.bash |
#!/usr/bin/python2.7 | |
""" | |
Performs a web BLAST query against NR using DNA sequences read from a fasta | |
file, storing the results in a SQLite database. | |
Dependencies: BioPython | |
BioPython may be installed using the Python package index: | |
$ sudo easy_install -f http://biopython.org/DIST/ biopython |
#!/bin/bash | |
# Incremental backup using rsync | |
# see http://www.mikerubel.org/computers/rsync_snapshots/#Incremental | |
set -e | |
BACKUP_DIR=backup | |
rot_cycle_days=7 # for example |
#!/usr/bin/env Rscript | |
if(Sys.getenv("VIRTUAL_ENV") == ""){ stop("An active virtualenv is required") } | |
source(file.path(Sys.getenv('VIRTUAL_ENV'), 'bin', 'rvenv')) | |
suppressPackageStartupMessages(library(argparse, quietly = TRUE)) | |
suppressPackageStartupMessages(library(rmarkdown, quietly = TRUE)) | |
main <- function(arguments){ |
import os | |
import sys | |
import ConfigParser | |
from os import path, environ | |
import glob | |
import itertools | |
venv = environ.get('VIRTUAL_ENV') | |
if not venv: | |
sys.exit('--> an active virtualenv is required'.format(venv)) |
sshmount () { | |
# Usage: sshmount host directory | |
host=$1 | |
pth=$2 | |
mountpoint=~/mnt/${host}+$(basename $pth) | |
mkdir -p $mountpoint | |
sshfs $host:$pth $mountpoint -oauto_cache,reconnect,defer_permissions,negative_vncache,volname=${host}+$(basename $pth) | |
cd $mountpoint | |
echo "unmount using: umount $mountpoint" | |
} |
#!/usr/bin/env Rscript | |
suppressPackageStartupMessages(library(lattice, quietly = TRUE)) | |
suppressPackageStartupMessages(library(latticeExtra, quietly = TRUE)) | |
suppressPackageStartupMessages(library(argparse, quietly = TRUE)) | |
main <- function(arguments){ | |
parser <- ArgumentParser() | |
parser$add_argument('infile') |
#!/bin/bash | |
set -e | |
REQFILE="${1-requirements.txt}" | |
WHEELSTREET="${2-wheelstreet}" # base dir for wheel dirs | |
if [[ ! -f "$REQFILE" ]]; then | |
echo "Cannot find requirements file named $REQFILE" | |
echo "Usage: $(basename $0) [requirements.txt] [wheelstreet]" |