Skip to content

Instantly share code, notes, and snippets.


Kent Kawashima kentwait

View GitHub Profile
kentwait / python_pool_processes.ipynb
Last active Oct 28, 2015
How to use a pool of processes to speed up analysis in Python
View python_pool_processes.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
kentwait / network_summary_stats.ipynb
Last active Jun 12, 2018
Understanding networks through descriptive statistics
View network_summary_stats.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
kentwait /
Last active Jun 11, 2021
Install HDF5 and h5py supporting MPI (Parallel HDF5)

How to install HDF5 and h5py supporting MPI on OS X

Works on Mac OS 10.11.6, HDF5 1.8.17


  1. Download and install dependencies like zlib, openmpi. Use homebrew.
  2. Download source tarball from
  3. Configure Makefile using the following command:
$ CC=/usr/local/bin/mpicc ./configure --with-zlib=/usr/local/opt --disable-fortran --prefix=/usr/local/ --enable-shared --enable-parallel
kentwait /
Last active Apr 16, 2022
Mount VirtualBox shared folder on boot using fstab

How to mount a VirtualBox shared folder when the Guest OS boots


While using VirtualBox's Guest Additions to mount shared folders provides a seamless way to mount shared folders, there are also disadvantages.

  • Shared folders will always mount in /media/sf_(share name) unless specified using through vbox drivers in the guest OS
  • Mounting does not happen at boot-time. Applications that require paths at boot will not be able to access the shared folder even after it is mounted - such as Docker.


Instead of relying on Guest Additions, if you have sudo permissions, shared folders can be mounted at boot-time using fstab. Using this approach allows

kentwait /
Last active Feb 23, 2017
Docker command tricks

Remove ALL containers

docker rm -f $(docker ps -a -q)

Remove ALL images

docker rmi $(docker images -q)

Remove dangling docker images

docker images -qf dangling=true | xargs docker rmi

Bind docker.sock to access docker commands from inside a container

kentwait /
Last active May 4, 2022
How to set-up CUDA, BEAGLE, and MrBayes/BEAST


Bayesian phylogentic programs like MrBayes and BEAST work better when the BEAGLE library is installed. BEAGLE provides these programs with an MCMC sampler using CPU-based or GPU-based computation. Therefore, before compiling or using MrBayes and BEAST, BEAGLE and other prerequisites must be set-up and installed first. Unfortunately, setting-up all these software and libraries can become pretty frustrating very quickly.

Here I show how to properly set-up these programs to keep your frustration to a minimum. Broadly speaking, these instructions are applicable for Windows, Mac, and Linux. However, because I am specifically recounting my own experiencing setting-up my Linux machine, the more detailed parts of this guide focuses on installing on Linux.

'AAA': 'K',
'AAC': 'N',
'AAG': 'K',
'AAT': 'N',
'ACA': 'T',
'ACC': 'T',
'ACG': 'T',
'ACT': 'T',
'AGA': 'R',
# 1. What will the following code print out?
x = 0
if x > 10:
# 2. Refer to the following function
def f(a, b=0):
if 0 in a:
def fibo_r(x):
if x <= 2:
return 1
return fibo_r(x-1) + fibo_r(x-2)
def fibo_l(x):
l = [0, 1, 1]
if x <= 2:
return 1
for i in range(3, x):
View Raspbian_lite
# Add .asoundrc file
Copied from
# ps3 eye + 3.5mm speaker Raspberry Pi
## Suggested by
## Modified by
pcm.jack {
type hw
card ALSA