Skip to content

Commit

Permalink
First commit adding environment setup and hw directories
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfeld committed Jan 31, 2017
1 parent c17adca commit bb9640c
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .bash_profile
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -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}"'

7 changes: 7 additions & 0 deletions .projects
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

function hcp_env()
{
source /scratch/PSB6351/envs/.env/.psb6351_environment
}

16 changes: 16 additions & 0 deletions psb6351_env_setup.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit bb9640c

Please sign in to comment.