Skip to content

Instantly share code, notes, and snippets.

View bmmalone's full-sized avatar

Brandon Malone bmmalone

View GitHub Profile
@bmmalone
bmmalone / git-pull-all
Last active December 5, 2017 22:42
Pull all of the git repos in the current working directory
#! /usr/bin/env bash
###
# This is `Zarat`'s comment to `leo`'s answer from this SO thread:
# https://stackoverflow.com/questions/3497123
#
# Plus some additional logic to checkout a branch, if specified
###
set -x # echo on
@bmmalone
bmmalone / install-bio-programs
Last active July 27, 2017 20:50
This script downloads and installs many common bioinformatics programs into $HOME/local
#! /usr/bin/env bash
export STAR_VERSION=2.5.3a
export SAMTOOLS_VERSION=1.4.1
export BOWTIE2_VERSION=2.3.2
export SEQAN_VERSION=2.2.0
export FLEXBAR_VERSION=3.0.3
export BITSEQ_VERSION=0.7.5
sudo apt-get install libtbb-dev
@bmmalone
bmmalone / latex-beamer-includes.tex
Last active November 19, 2017 19:59
Latex beamer templates
%%%
% Add spaces when necessary after commands
%%%
\usepackage{xspace}
%%%
% Make sure we can use colors
%%%
\usepackage{xcolor}
@bmmalone
bmmalone / paper.tex
Last active May 23, 2023 06:53
Simple template for latex file with many useful includes and comments
\documentclass[a4paper,10pt]{article}
% make writing commands easier
\usepackage{xparse}
% colored text
\usepackage{color}
% include eps, pdf graphics
\usepackage{graphicx}
@bmmalone
bmmalone / install-python-prereqs
Last active July 15, 2021 08:02
Install all of the packages necessary to build all of the optional modules for python
#! /usr/bin/env bash
sudo apt-get --assume-yes install build-essential
sudo apt-get --assume-yes install gfortran
sudo apt-get --assume-yes install zlib1g-dev
sudo apt-get --assume-yes install libreadline-dev
sudo apt-get --assume-yes install libncursesw5-dev
sudo apt-get --assume-yes install lib32ncurses5-dev
sudo apt-get --assume-yes install libgdbm-dev
sudo apt-get --assume-yes install libsqlite3-dev
@bmmalone
bmmalone / .tmux.conf-1.9
Last active September 7, 2018 10:07
Example tmux config file
# largely from here: https://gist.github.com/justin808/9493723
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Toggle mouse on
bind m \
set -g mode-mouse on \;\
@bmmalone
bmmalone / .vimrc
Last active May 10, 2017 00:07
Example vim config file
syntax on
set autoindent
set number
" try to handle tabs in makefiles correctly
filetype plugin on
" change to the directory of the current file by default
" workaround. see: https://github.com/vim/vim/issues/704
autocmd VimEnter * set autochdir
@bmmalone
bmmalone / psgrep
Created April 30, 2017 17:09
Find processes from the current user which match the given regex
#! /usr/bin/env bash
ps aux | grep -E $USER.*$1 | grep -v 'grep\|-bash\|sshd:\|ps aux\|less' | less
@bmmalone
bmmalone / fig2eps
Last active April 30, 2017 21:25
Convert an exported Xfig figure to an eps figure
#! /usr/bin/env python3
import argparse
import os.path
import shutil
import subprocess
user_home = os.path.expanduser('~')
default_template_file = os.path.join(
user_home,
@bmmalone
bmmalone / eps2png
Created April 30, 2017 16:14
Add a bounding box to the eps figure using epstool and convert it to png
#! /usr/bin/env bash
epstool --copy --bbox $1.eps $1.bb.eps
rm $1.eps
mv $1.bb.eps $1.eps
convert $1.eps $1.png