Skip to content

Instantly share code, notes, and snippets.

View matsen's full-sized avatar

Erick Matsen matsen

View GitHub Profile
@matsen
matsen / refresh-ssh-in-tmux.sh
Created January 3, 2020 14:42
A shell command to refresh SSH_AUTH_SOCK in a running tmux session
r () {
if [[ -n $TMUX ]]
then
NEW_SSH_AUTH_SOCK=`tmux showenv|grep "^SSH_AUTH_SOCK"|cut -d = -f 2`
if [[ -n $NEW_SSH_AUTH_SOCK ]] && [[ -S $NEW_SSH_AUTH_SOCK ]]
then
echo "New auth sock: $NEW_SSH_AUTH_SOCK"
SSH_AUTH_SOCK=$NEW_SSH_AUTH_SOCK
fi
NEW_DISPLAY=`tmux showenv|grep "^DISPLAY"|cut -d = -f 2`
#!/bin/sh
set -e
set -o
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y \
autojump \
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matsen
matsen / seqs2png
Last active February 9, 2016 04:11
A simple script to render a molecular sequence file as a PNG, with a specified number of pixels per symbol.
#!/usr/bin/env python
"""
Turn a sequence file into a PNG, with a specified number of pixels per symbol.
Gaps are shown in light gray.
Unknown symbols, including N and X, are shown in pink.
Requires matplotlib, seqmagick, and their dependencies.
"""
# A modification of `gallifrey` to show virtualenv information.
# I also found the return code information to be annoying, so it's commented out.
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%{$fg[green]%}%m%{$reset_color%} $(virtualenv_prompt_info)%2~ $(git_prompt_info)%{$reset_color%}%B»%b '
#RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
@matsen
matsen / md-nb-diffs.md
Last active February 22, 2021 21:44 — forked from iamlemec/nb2md
Markdown diffs for jupyter notebooks.

For sane jupyter notebook diffs

  • Install the nbconvert package, though you probably already have it if you are using jupyter.
  • Put the nb2md script below in your path and make executable
  • Add the following to your .gitattributes file, which can be in your home directory (use nb2md for all projects) or in the root of your project:
*.ipynb diff=nb2md
  • Run
@matsen
matsen / prep-crouton.sh
Last active October 17, 2016 17:55
Preparing a crouton chroot environment for productivity.
#!/bin/sh
# sudo visudo
# matsen ALL = (root) NOPASSWD: /usr/local/bin/xiwi,/usr/bin/evince,/usr/bin/inkscape
set -e
set -o
sudo hostnamectl set-hostname flyx
@matsen
matsen / response-to-exascale-hpc-rfi.md
Last active October 1, 2015 12:19
Response to "Science Drivers Requiring Capable Exascale High Performance Computing" RFI

We can piggyback on the coding development community.

Many good things are happening in open source and industry, and we face many of the same issues that they do. For example, GitHub has provided enormous value to science, both through filling a need and by direct engagement. It has gotten almost unbelievably popular in the computational life sciences. However, other tools such as continuous integration, for example by Travis CI, or containers, for example by Docker, have gotten less traction despite the

@matsen
matsen / keybase.md
Created April 6, 2015 16:55
keybase.md

Keybase proof

I hereby claim:

  • I am matsen on github.
  • I am ematsen (https://keybase.io/ematsen) on keybase.
  • I have a public key whose fingerprint is BEE5 925E E22C 76C3 EC0D 4074 319F C81F 9510 3B94

To claim this, I am signing this object:

@matsen
matsen / sysbio.tex
Last active December 15, 2015 15:29
Framework for a latex file designed for both arXiv and Systematic Biology submission.
%%For arXiv, uncomment this block and comment the next block.
%\documentclass{amsart}
%\usepackage{amsmath,amsfonts,amssymb,amsthm}
%\usepackage[english]{babel}
%\usepackage{graphicx}
%\usepackage{url}
%\usepackage[round]{natbib}
%\newcommand{\forarxiv}[1]{#1}
%\newcommand{\notforarxiv}[1]{}