Create a new session then rename it:
C-b :new C-b $
Create a new named session:
| --- | |
| title: [title] | |
| author: Noah Hoffman | |
| date: "`r format(Sys.time(), '%Y-%m-%d')`" | |
| output: | |
| html_document: | |
| toc: true | |
| --- | |
| # setup |
| from scipy.interpolate import interp1d | |
| import numpy as np | |
| import shlex | |
| import subprocess as sp | |
| import prettyplotlib as ppl | |
| from matplotlib import pyplot as plt | |
| from matplotlib.ticker import FuncFormatter | |
| import io |
| 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" | |
| } |