Skip to content

Instantly share code, notes, and snippets.

@sbamin
sbamin / bkup_dotfiles_configs.md
Created February 12, 2017 17:35
How to rsync dot files and directories of remote server

backup dotfiles

  • Following will copy all of dot ~/. files and directories (including its contents) directly underneath home directory.
  • To avoid copying cache and other local configs, e.g., that of web browser, java apps, etc., preferably query directory size tool under entire home $HOME/, using ncdu $HOME of similar tool.
  • Exclude all those large directories using rsync --exclude=.local --exclude=.cache format
  • Avoid rsync password, ssh keys, .bash_history, etc. if you are uploading to github, etc.
  • rsync home dotfiles and configs as follows:
# in your local machine
source 'https://rubygems.org'
gem 'nokogiri', '= 1.6.8.1'
group :jekyll_plugins do
gem 'github-pages', '>= 127'
end
group :jekyll_misc_plugins do
gem 'jekyll-compose', '>= 0.4.1'
@sbamin
sbamin / .bash_aliases
Created April 27, 2017 14:21
bash dotfiles for helix
# User specific aliases and functions
# JAX Helix - HPC
# v 2.2.3 | 03-17 | @sbamin
alias ll='ls -alhF'
alias la='ls -A'
alias l='ls -CF'
alias df='df -H'
alias du='du -ch'
alias cd..='cd ..'
@sbamin
sbamin / mutect_v1.1.7_manpage.txt
Created October 12, 2017 20:38
mutect v1.1.7 manpage
--------------------------------------------------------------------------------
The Genome Analysis Toolkit (GATK) v3.1-0-g72492bb, Compiled 2015/01/21 17:10:56
Copyright (c) 2010 The Broad Institute
For support and documentation go to http://www.broadinstitute.org/gatk
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
usage: java -jar mutect-1.1.7.jar -T <analysis_type> [-args <arg_file>] [-I <input_file>] [-rbs <read_buffer_size>] [-et
<phone_home>] [-K <gatk_key>] [-tag <tag>] [-rf <read_filter>] [-L <intervals>] [-XL <excludeIntervals>] [-isr
<interval_set_rule>] [-im <interval_merging>] [-ip <interval_padding>] [-R <reference_sequence>] [-ndrs] [-maxRuntime
<maxRuntime>] [-maxRuntimeUnits <maxRuntimeUnits>] [-dt <downsampling_type>] [-dfrac <downsample_to_fraction>] [-dcov
@sbamin
sbamin / exampleRScript1.r
Last active November 11, 2017 17:00 — forked from ericminikel/exampleRScript1.r
An example of how to use Rscript and optparse to run R in batch mode with command line args.
#!/usr/bin/env Rscript
# modified from a script by:
# Eric Vallabh Minikel
# https://gist.github.com/ericminikel/8428297
# example of how to use optparse in R scripts
# usage: ./exampleRScript1.r -a thisisa -b hiagain
# ./exampleRScript1.r --avar thisisa --bvar hiagain
@sbamin
sbamin / backup_linuxbox.sh
Created November 16, 2017 14:47
Backup Linux Box
#!/bin/bash
## backup script for my_env
TSTAMP=$(date +%d%b%y_%H%M%S%Z)
SOURCEDIR="/projects/my_env"
BKUPDIR="/backupdisk/my_env"
SOURCECHECK=$(test -d "${SOURCEDIR}" && echo Exists || echo Does not exist)
@sbamin
sbamin / mutect_gatk3.8_v2_manpage.txt
Created December 7, 2017 20:13
mutect2 gatk3.8 manpage
----------------------------------------------------------------------------------
The Genome Analysis Toolkit (GATK) v3.8-0-ge9d806836, Compiled 2017/07/28 21:26:50
Copyright (c) 2010-2016 The Broad Institute
For support and documentation go to https://software.broadinstitute.org/gatk
[Thu Dec 07 15:12:03 EST 2017] Executing on Linux 2.6.32-431.23.3.el6.x86_64 amd64
OpenJDK 64-Bit Server VM 1.8.0_92-b15
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
usage: java -jar GenomeAnalysisTK.jar -T <analysis_type> [-args <arg_file>] [-I <input_file>] [--showFullBamList] [-rbs
<read_buffer_size>] [-rf <read_filter>] [-drf <disable_read_filter>] [-L <intervals>] [-XL <excludeIntervals>] [-isr
@sbamin
sbamin / grepjobinfo
Created December 13, 2017 14:46
Extract info from jobs running on HPC
#!/bin/bash
#usage
show_help() {
cat << EOF
Check info for non-array jobs on HPC using checkjob command
Usage: ${0##*/}
Extended Usage: ${0##*/} -e <options for qstat> -p <options for grep command> -s <string pattern for grep command to extract>
@sbamin
sbamin / start_interactive
Created December 18, 2017 16:35
request interactive job on HPC Helix
#!/bin/bash
# Wrapper to run interactive job on helix hpc.
# @sbamin | helix
# usage
show_help() {
cat << EOF
Start interactive job on Helix: Only one job is allowed at a time.