Skip to content

Instantly share code, notes, and snippets.

@lcolladotor
Created April 10, 2020 13:12
Show Gist options
  • Save lcolladotor/3b1063db30a206835ee7e086c8f037ee to your computer and use it in GitHub Desktop.
Save lcolladotor/3b1063db30a206835ee7e086c8f037ee to your computer and use it in GitHub Desktop.
Hi!
Here’s the recording from my session today with Sang Ho, Kristen and Abby.
Here are the links and content for several config files I gave Sang Ho throughout the session:
R https://cran.r-project.org/
RStudio https://rstudio.com/products/rstudio/download/#download
JHPCE register: https://jhpce.jhu.edu/register/user/
JHPCE ssh keys: https://jhpce.jhu.edu/knowledge-base/authentication/ssh-key-setup/
Laptop ~/.ssh/config:
touch config
open config
Host j jhpce
User YOUR_USERNAME
Hostname jhpce01.jhsph.edu
ForwardX11 yes
ForwardX11Trusted yes
Cyberduck https://cyberduck.io/
JHPCE ~/.Rprofile (can also be applied to your laptop):
## Change colors
# Source https://github.com/jalvesaq/colorout
if(Sys.getenv('TERM') %in% c("term", "xterm-256color", "cygwin", "screen") & interactive()) {
installed <- require("colorout")
if(!installed) {
cat('remotes::install_github("jalvesaq/colorout")\n')
}
rm(installed)
}
JHPCE ~/.inputrc (can also be applied to your laptop):
#Page up/page down
"\e[B": history-search-forward
"\e[A": history-search-backward
$include /etc/inputrc
JHPCE ~/.bashrc (not the same as laptop!!)
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
# Auto-complete command from history
# http://lindesk.com/2009/04/customize-terminal-configuration-setting-bash-cli-power-user/
export INPUTRC=~/.inputrc
# http://www.biostat.jhsph.edu/~afisher/ComputingClub/webfiles/KasperHansenPres/IntermediateUnix.pdf
# https://unix.stackexchange.com/questions/48713/how-can-i-remove-duplicates-in-my-bash-history-preserving-order
export HISTCONTROL=ignoreboth:erasedups
export HISTSIZE=20000
shopt -s histappend
shopt -s cmdhist
# http://superuser.com/questions/384769/alias-rm-rm-i-considered-harmful
alias rmi='rm -i'
# Change command prompt
# http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
# http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
# https://bbs.archlinux.org/viewtopic.php?id=48910
# previous in enigma2: "[\u@\h \W]\$ "
# previously in mac: "\h:\W \u\$ "
export PS1="\[\e[0;33m\]\A \W \$ \[\e[m\]"
# Main working directory
alias labold="cd /dcl01/lieber/ajaffe/lab"
# colors
# http://norbauer.com/notebooks/code/notes/ls-colors-and-terminal-app
# used BSD pattern ExGxFxDxBxEgEdxbxgxhxd on http://geoff.greer.fm/lscolors/
# that tool does not specify the colors, which I did by looking manually at
# http://blog.twistedcode.org/2008/04/lscolors-explained.html
# and the norbauer.com site previously mentioned
alias ls="ls --color=auto"
#export LS_COLORS="di=1;34;40:ln=1;36;40:so=1;35;40:pi=1;93;40:ex=1;31;40:bd=1;34;46:cd=1;34;43:su=0;41:sg=0;46:tw=0;47:ow=0;43"
## After switching to RStudio:
# https://askubuntu.com/questions/466198/how-do-i-change-the-color-for-directories-with-ls-in-the-console
export LS_COLORS="di=0;32:ln=0;36:so=0;35:pi=0;93:ex=0;31:bd=0;34;46:cd=0;34;43:su=0;41:sg=0;46:tw=0;47:ow=0;43:fi=0;33"
## Load the git module by default when qrsh/qsub
## thanks to Jiong Yang
if [[ $HOSTNAME == compute-* ]]; then
echo "Adding LIBD modules"
module use /jhpce/shared/jhpce/modulefiles/libd
echo "Loading git"
module load git
module load git-status-size/github
module load git-lfs/2.8.0
module load rmate/1.5.9
module load conda_R/3.6.x
fi
## To deal with running nextflow without requesting much more memory
## https://jhpce.jhu.edu/question/why-do-i-get-memory-errors-when-running-java/
export _JAVA_OPTIONS="-Xms5g -Xmx6g"
JHPCE ~/.bashrc alias for spatial 10x (not for everyone!):
## Shortcut alias
alias spatial="cd /dcl02/lieber/ajaffe/SpatialTranscriptomics/HumanPilot"
Example reproducibility code we saved in JHPCE at ~/reproducibility.R:
library('sessioninfo')
## Wait for 60 seconds (did this with Kristen, not on the video)
Sys.sleep(60)
## Reproducibility information
print('Reproducibility information:')
Sys.time()
proc.time()
options(width = 120)
session_info()
sgejobs package website http://research.libd.org/sgejobs/index.html
JHPCE default config ~/.sge_request:
# Set a default maximum file size that an SGE job can create
-l h_fsize=100G
# Define my email
-M YOUR_EMAIL@gmail.com
# To get an email on a job use -m e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment