Skip to content

Instantly share code, notes, and snippets.

View kmtu's full-sized avatar

KM Tu kmtu

View GitHub Profile
@kmtu
kmtu / tmux-share.sh
Last active May 22, 2017 09:31
A bash script simplifying the procedure of sharing tmux session between users
#!/bin/bash
cmds=('new' 'join' 'list')
socket="/tmp/tmux-share"
grp="ggparty"
bin=tmux-share
usage0="tmux-share ${cmds[0]} <name>"
usage1="tmux-share ${cmds[1]} [<name>]"
usage2="tmux-share ${cmds[2]}"
usage="Usage:\n$usage0\n$usage1\n$usage2"
@kmtu
kmtu / Documentation.md
Created December 2, 2016 08:58 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@kmtu
kmtu / run_md-npt.sh
Last active November 13, 2015 05:18
Produce a cpt file every 1 ns for NPT run (for Gromacs ver. 5.1)
#!/bin/sh
cd ${PBS_O_WORKDIR}
NPROCS=`wc -l <$PBS_NODEFILE`
GMDIR=$HOME/local/gromacs-5.1/bin
GMX=$GMDIR/gmx_d
GROMPP="$GMX grompp"
TPBCONV="$GMX convert-tpr"
MDRUN=$GMDIR/mdrun_mpi_d
#!/bin/sh
# fix the configure files
patch -p1 config.guess < fix-config-sx9.diff
# make the build directory
mkdir -p builder
cd builder
# configure
! XDR Fortran Interface Example Program
! 2014 (c) James W. Barnett <jbarnet4@tulane.edu>
! https://github.com/wesbarnett/
program read_xtc_prog
use, intrinsic :: iso_c_binding, only: C_NULL_CHAR, C_PTR, c_f_pointer
use xtc
implicit none
! XDR Fortran Interface
! 2014 (c) James W. Barnett <jbarnet4@tulane.edu>
! https://github.com/wesbarnett/
module xtc
use, intrinsic :: iso_c_binding, only: C_PTR, C_CHAR, C_FLOAT, C_INT
implicit none
private
@kmtu
kmtu / run-md-nve.sh
Last active August 29, 2015 14:08
run-md-nve.sh
if [[ ! $# == 1 ]]; then
echo "Usage: $0 <index of md>"
exit 1;
fi
idx=$1
sdir=../../2-npt
tdir=md$idx
if [[ ! -d "$tdir" ]]; then
@kmtu
kmtu / make-run_md-nve.sh
Last active August 29, 2015 14:08
make-run_md-nve.sh
if [[ ! $# == 1 ]]; then
echo "Usage: $0 <md index>"
exit 1;
fi
IDX=$1
cd md$1 &&\
cat > run_md-nve.sh <<EOF
#PBS -l nodes=2:ppn=12
#PBS -N system-md$IDX
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{
@kmtu
kmtu / make-NVE.sh
Last active August 29, 2015 14:07
make-NVE.sh
if [[ ! $# == 1 ]]; then
echo "Usage: $0 <index of md>"
exit 1;
fi
idx=$1
sdir=../../2-npt
tdir=md$idx
mkdir $tdir