From bb9640cccfe77fe13ba265b4135e0345fe8400c9 Mon Sep 17 00:00:00 2001 From: Aaron Mattfeld Date: Tue, 31 Jan 2017 16:48:01 -0500 Subject: [PATCH] First commit adding environment setup and hw directories --- .bash_profile | 25 +++++++++++++++++++++++++ .bashrc | 31 +++++++++++++++++++++++++++++++ .projects | 7 +++++++ psb6351_env_setup.py | 16 ++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 .bash_profile create mode 100644 .bashrc create mode 100644 .projects create mode 100644 psb6351_env_setup.py diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..ee41f9e --- /dev/null +++ b/.bash_profile @@ -0,0 +1,25 @@ +if [ -f /home/share/Modules/global/profile.modules ] +then + . /home/share/Modules/global/profile.modules +# put your own module loads here + module load lsf + module load gcc/4.8.1 +fi +# .bash_profile + +# Get the aliases and functions +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi + +# User specific environment and startup programs + +# Permissions +umask 0002 + +PATH=$PATH:$HOME/bin +# ATM added during October setup +ANTSPATH=${ANTSPATH:="/home/applications/ANTs/1.9.4/bin/"} + +export PATH +export ANTSPATH diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..e4aaeea --- /dev/null +++ b/.bashrc @@ -0,0 +1,31 @@ +case "$0" in + -sh|sh|*/sh) modules_shell=sh ;; + -ksh|ksh|*/ksh) modules_shell=ksh ;; + -zsh|zsh|*/zsh) modules_shell=zsh ;; + -bash|bash|*/bash) modules_shell=bash ;; +esac +module() { eval `/home/share/Modules/default/bin/modulecmd $modules_shell $*`; } +#module() { eval `/bin/modulecmd $modules_shell $*`; } +# .bashrc + +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +# Project specific environments +source ~/.projects + +# Permissions +umask 0002 + +# User specific aliases and functions +# Added by Cassian 03/29/2016 +umask g+w +alias ls="ls --color=auto" +# Setup a fancy shell command prompt: +prompt1="\[\e[0;33m\][\A]\[\e[0m\]" # Display the time in the bash prompt +prompt2="\[\e[1;39m\]\u@\h:\W\$\[\e[0m\]" # Add username@host:dir$ +promptinfo=`${HOME}/.nodeload` +PROMPT_COMMAND='PS1="\[\e[1;37m\e[44m\]${project_name}\[\e[0;0m\]${prompt1}${promptinfo}${prompt2}"' + diff --git a/.projects b/.projects new file mode 100644 index 0000000..f22119d --- /dev/null +++ b/.projects @@ -0,0 +1,7 @@ +#! /bin/bash + +function hcp_env() +{ +source /scratch/PSB6351/envs/.env/.psb6351_environment +} + diff --git a/psb6351_env_setup.py b/psb6351_env_setup.py new file mode 100644 index 0000000..864de32 --- /dev/null +++ b/psb6351_env_setup.py @@ -0,0 +1,16 @@ +import os +import time + +files = ['.bashrc', '.bash_profile', '.projects', '.env', '.nodeload'] + +for f in files: + if os.path.exists(os.path.expanduser('~/%s'%f)): + now = ''.join(time.ctime().split(' ')).replace(':','') + newname = '~/%s_%s'%(f,now) + cmd = 'mv ~/%s %s'%(f,newname) + print cmd + os.system(cmd) + cmd = 'ln -s %s ~/'%os.path.abspath(f) + print cmd + os.system(cmd) +