Skip to content

Instantly share code, notes, and snippets.

View bmmalone's full-sized avatar

Brandon Malone bmmalone

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / convert-all-eps2png
Created November 24, 2017 17:09
Convert all of the eps files in the current directory to png
#! /usr/bin/env bash
find . -name "*eps" -exec sh -c 'eps2png "${0%.*}"' {} \;
@bmmalone
bmmalone / hostnames2ips
Created December 2, 2017 21:18
Convert a list of hostnames to IP addresses
#! /usr/bin/env bash
while read p; do
getent hosts $p | cut -d' ' -f 1
done <$1
@bmmalone
bmmalone / build-gcc
Last active December 19, 2023 23:29 — forked from jeetsukumaran/build-gcc.sh
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="10.1.0"
WORKDIR="$HOME/gcc/src/"
INSTALLDIR="/$HOME/gcc/install/gcc-${GCC_VERSION}"
set +h
unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE LD_LIBRARY_PATH
@bmmalone
bmmalone / pickle-stan
Created March 12, 2018 09:18
Pickle a stan model file (python3)
#! /usr/bin/env python3
import argparse
import pickle
from pystan import StanModel
def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description="This script compiles a stan model and pickles it to disc")
parser.add_argument("stan", help="The stan model file")