Files
scripts/local/bb/.bashrc.local
2020-02-28 05:57:38 -05:00

226 lines
5.5 KiB
Bash
Executable File

#!/bin/bash
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# if chimera generated aliases exist, pull them into the current ENV
[ -f ~/.bbalias ] && . ~/.bbalias
#wget
#export http_proxy=devproxy.bloomberg.com:82
#export https_proxy=devproxy.bloomberg.com:82
if [[ "$(hostname)" == "lnxmqts01" ]]; then
export SKELETON_DEPLOY=$HOME/devel/bb/skeleton_internals
fi
export DEV_CINC=-I.
export DEV_CPPINC=-I.
export DEV_FINC=-I.
#I need this to run distributor locally.
export PGPASSFILE=$HOME/.fit_pgpass
export PGSERVICEFILE=$HOME/.fit_pg_service.conf
export SRC_DIR=$HOME/devel/src
export BOOST_DIR=$SRC_DIR/boost
#export TBB_DIR=$SRC_DIR/tbb
#export TBB_LIB=$TBB_DIR/build/linux_intel64_gcc_cc4.8.2_libc2.12_kernel2.6.32_release/
#export TBB_LIB_DEBUG=$TBB_DIR/build/linux_intel64_gcc_cc4.8.2_libc2.12_kernel2.6.32_debug/
alias bb='cd $HOME/devel/bb >/dev/null'
#complete -f -X '!*.mk' plink
#complete -f -X '!*.mk' llcalc
#complete -W "build clean build_all clean_all skeleton_setup jenkins_update" make
stty sane # should normalize backspace issues?
#
# BLOOMBERG and TOMS
#
export BB=$HOME/devel/bb
PATH=$PATH:$BB/scripts
PATH=$MYSCRIPTS/local/bb:$PATH
# PATH=$HOME/bb/bas-codegen/bin:$PATH
if [[ "$os" == "GNU/Linux" ]]; then
export IS_64BIT=yes
BBBITS=64
#PATH=/bb/build/Linux-x86_64-64/release/robolibs/stage/opt/bb/libexec/build-base/:$PATH
else
BBBITS=32
fi
export BBTAG=$(/opt/bb/bin/robolibs-current-build --tag local --bits $BBBITS)
getop() { # BOX
if [[ $# -ne 1 ]]; then
echo "Usage: getop <machine>"
else
local BOX="$1"
local BIN="/bb/bin/getprdwin"
$BIN -u op1 -i -s $BOX -d "op1 for $USER on $BOX"
fi
}
run() {
if [[ $# -lt 1 ]]; then
echo "Usage: run <server> <command>"
elif [[ $# -eq 1 ]]; then
SERVER=$1
ssh $LOGNAME@$SERVER "cd $PWD; exec $BASH --login"
else
SERVER=$1
shift
ssh $LOGNAME@$SERVER "cd $PWD; $@"
fi
}
sun() { # CMD
if [[ $# -ne 1 ]]; then
echo "Usage: sun <command>"
else
run njtsdev3 $@
fi
}
ibm() { # CMD
if [[ $# -ne 1 ]]; then
echo "Usage: ibm <command>"
else
run ibm3 $@
fi
}
git-repo-setup(){
if [[ $# -ne 0 ]]; then
echo "Usage: just run inside a bbgithub repo."
return
fi
st=$(git status)
if [[ $? -ne 0 ]]; then
echo "Looks this is not a git repo."
return
fi
us=$(git remote get-url upstream 2> /dev/null)
if [[ $? -eq 0 ]]; then
echo "Upstream already exist as $us."
return
fi
url=$(git remote get-url origin)
if [[ $? -ne 0 ]]; then
echo "Origin URL is unknown."
return
fi
re="^(.*)[/:]([^/:]*)/(.*)$"
if [[ $url =~ $re ]]; then
prefix=${BASH_REMATCH[1]}
org=${BASH_REMATCH[2]}
repo=${BASH_REMATCH[3]}
else
echo "Failed to pars the repo URL."
return
fi
upstream_repo=bbgithub:$org/$repo
origin_repo=bbgithub:vkhachatrya5/$repo
git remote rm origin
echo "Setting origin=$origin_repo"
git remote add origin $origin_repo
echo "Setting upstream=$upstream_repo"
git remote add upstream $upstream_repo
git remote -v
}
git-master-refresh(){
git fetch upstream master
git co upstream/master
git br -D master
git co -b master
}
#
#alias dirs='dirs -v'
#alias ack='ack --ignore-file=ext:d,dd'
#
#alias dirtree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' "
#alias currgit='cd /bb/mbig/mbig1205/devgit/s_tktapi2/src; echo -e "I am here $(pwd)"'
#alias tktapi='cd /bb/mbig/mbig1205/devgit/tktapi/src; echo -e "I am here $(pwd) \n $(ls)"'
#alias bastest='/bbsrc/abin/basclient'
#alias bas_codegen='/bb/shared/bin/bas_codegen.pl'
#alias metasymfind="cat - | awk '{ print \$1 }' | xargs symfind | awk 'BEGIN{FS=\"[\"} { print \$1 }' | sort | uniq | tr '\n' ' ' | sed -e 's/\(\b\S\)/-l\1/g' && echo \"\""
#
#alias git-robo='ssh devgit svnsync $(git remote -v | grep "(fetch)" | cut -d ":" -f2 | cut -d "(" -f1); git fetch origin; git pull; git merge robo/trunk; read -p "!!!!! PUSH the merged version back !!!!! ? [Y] / Ctrl+C to stop"; git push'
#alias intuorcreate=/bbsrc/internal/isystest/uorcreate/intuorcreate
#
#
#
#export BIGHOME=/bb/mbig/mbig1205
#export PLINK_PARALLEL_BUILD=true
#export EDITOR=/opt/swt/bin/nedit
#export PAGER=less
#export GROUP=trading-systems-group
#export mysvn="svn+ssh://devsvn"
#export myrobosvn="svn+ssh://devsvn/robo/branches/trunk"
#export PATH=/opt/swt/bin:~/bin:/bb/util/common/studio12/SUNWspro/bin:${PATH}
#export DEVGIT=${BIGHOME}/devgit
#export VISUAL=/opt/swt/bin/nedit
#export MAIL=/usr/mail/${LOGNAME:?}
#
#
#
##ssh() {
# #echo "wut"
# #[[ -n "$INSCREEN" ]] && TERM=screen-256color
# #env ssh -t $*
# #$SCREEN_TITLE_CMD
##}
#
#
#biggest() {
# dir=${1:-.}
# find $dir -type f -exec du -a {} \+ | sort -rn
#}
#
## Screen variables
#function last2dirs {
# pwd | awk -F\/ '{print $(NF-1),$(NF)}' | sed 's# #/#'
#}
#
##screen specific functionality
##if [[ -n ${STY} ]]
##then
# PROMPT_COMMAND='echo -ne "\033k${HOSTNAME} $(last2dirs)\033\\";
# history -a;'
##fi
#
#function dupscreen {
# screen bash -c "export SSHCDPATH=$PWD && exec $SHELL --login"
#}
#
#if [[ -e ~/.git-completion.bash ]]
#then
# source ~/.git-completion.bash
#fi
#
#if [ -n "$BBENV" ] && [[ -f ~/bin/hijackEOD.sh ]]
#then
# source `which hijackEOD.sh`
#fi
#
#
#
# Don't source the rest twice.
#
#if [ "$BASHRC_VAHAGNK_DONT_SOURCE_THIS_FILE_TWICE" == "true" ]; then
# return
#fi