Skip to content

Instantly share code, notes, and snippets.

View hisplan's full-sized avatar
🎯
Focusing

Jaeyoung Chun hisplan

🎯
Focusing
  • Memorial Sloan Kettering Cancer Center
  • New York, NY
  • 03:48 (UTC -04:00)
View GitHub Profile
tree | sed 's/├/\+/g; s/─/-/g; s/└/\+/g'
tree --charset ascii
@hisplan
hisplan / git-commit-hash.sh
Last active September 28, 2018 19:27
git last commit hash
$ git ls-remote https://github.com/......... HEAD | cut -f1
0a033196ee92e75f94a8dd27c97d6b882210103e
$ git show -s --format=%H
0a033196ee92e75f94a8dd27c97d6b882210103e
$ git show -s --format=%h
0a03319
$ git rev-parse HEAD
@hisplan
hisplan / linux-io-redirect.md
Last active October 6, 2017 04:18
Linux I/O redirection

Redirect both stdout and stderr to a file

cmd &>out.txt

Redirect stderr to a file

cmd > out.txt 2>error.txt
@hisplan
hisplan / cwltoil-help.txt
Last active February 3, 2018 00:35
cwltoil --help
usage: cwltoil [-h] [--logOff] [--logCritical] [--logError] [--logWarning]
[--logInfo] [--logDebug] [--logLevel LOGLEVEL]
[--logFile LOGFILE] [--rotatingLogging] [--workDir WORKDIR]
[--stats] [--clean {always,onError,never,onSuccess}]
[--cleanWorkDir {always,never,onSuccess,onError}]
[--clusterStats [CLUSTERSTATS]] [--restart]
[--batchSystem BATCHSYSTEM] [--disableHotDeployment]
[--scale SCALE] [--mesosMaster MESOSMASTERADDRESS]
[--parasolCommand PARASOLCOMMAND]
[--parasolMaxBatches PARASOLMAXBATCHES] [--provisioner {aws}]
@hisplan
hisplan / upgrade-gcc.sh
Created March 15, 2017 14:27
Upgrade gcc on Linux
wget https://ftp.gnu.org/gnu/gcc/gcc-6.3.0/gcc-6.3.0.tar.gz
cd gcc-6.3.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-6.3.0/configure --prefix=$HOME/gcc-6.3.0 --enable-languages=c,c++ --disable-multilib
make
make install
npm config set init-author-name="Jaeyoung Chun"
npm config set init-author-email="jaeyoung.chun@gmail.com"
@hisplan
hisplan / tree.py
Created March 3, 2017 05:38
When tree is not avail
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# tree.py
#
# Written by Doug Dahms
#
# Prints the tree structure for the path specified on the command line
from os import listdir, sep
@hisplan
hisplan / rsync-remote-host.sh
Created March 2, 2017 18:40
Rsync with a non-standard ssh port
rsync -avz -e "ssh -p $portNumber" user@remoteip:/path/to/files/ /local/path/
@hisplan
hisplan / parse.sh
Created March 2, 2017 16:33
parse docker label
sudo docker inspect bwa | python -c "import json; import sys; j=json.loads(sys.stdin.read()); print j[0]['Config']['Labels']"
@hisplan
hisplan / read-from-stdin.sh
Last active March 3, 2017 16:07
Python: read from stdin
echo "hello" | python -c "import sys; sys.stdout.write( sys.stdin.read() )"