Merge branch 'master' of github.com:vishap/scripts
This commit is contained in:
@@ -121,8 +121,8 @@ if [ -n "$PS1" ]; then
|
||||
c_cwd="$(tput setaf 99)"
|
||||
c_time="$(tput setaf 33)" #Light blue
|
||||
c_branch="$(tput setaf 138)"
|
||||
c_exit="$(tput setaf 203)" #Red
|
||||
c_jobs="$(tput setaf 220)" #Yellow
|
||||
c_error="$(tput setaf 203)" #Red
|
||||
c_info="$(tput setaf 220)" #Yellow
|
||||
else
|
||||
c_reset="$(tput sgr0)"
|
||||
c_user="$(tput setaf 1)" #
|
||||
@@ -130,8 +130,8 @@ if [ -n "$PS1" ]; then
|
||||
c_cwd="$(tput setaf 7)" #White
|
||||
c_time="$(tput setaf 6)" #Cyan
|
||||
c_branch="$(tput setaf 6)" #Cyan
|
||||
c_exit="$(tput setaf 1)" #Red
|
||||
c_jobs="$(tput setaf 3)" #Yellow
|
||||
c_error="$(tput setaf 1)" #Red
|
||||
c_info="$(tput setaf 3)" #Yellow
|
||||
fi
|
||||
|
||||
[ -n "$(which svn)" ] && prompt_check_svn=true
|
||||
@@ -177,21 +177,29 @@ if [ -n "$PS1" ]; then
|
||||
# exit code if not zero
|
||||
#
|
||||
if [ "$exit_code" -ne "0" ]; then
|
||||
PS1+=",\[$c_exit\]rc=$exit_code"
|
||||
PS1+=",\[$c_error\]rc=$exit_code"
|
||||
fi
|
||||
#
|
||||
# Python venv.
|
||||
#
|
||||
local jobs_bg=$(jobs -r | wc -l | tr -d ' ')
|
||||
if [ -n "$VIRTUAL_ENV" ]; then
|
||||
# PS1+=",\[$c_info\]$(realpath --relative-to=$PWD $VIRTUAL_ENV)"
|
||||
PS1+=",\[$c_info\]$(basename $VIRTUAL_ENV)"
|
||||
fi
|
||||
#
|
||||
# Info about jobs.
|
||||
#
|
||||
local jobs_bg=$(jobs -r | wc -l | tr -d ' ')
|
||||
if [ $jobs_bg -gt 0 ]; then
|
||||
PS1+=",\[$c_jobs\]bg=$jobs_bg"
|
||||
PS1+=",\[$c_info\]bg=$jobs_bg"
|
||||
fi
|
||||
#
|
||||
# Info about jobs.
|
||||
#
|
||||
local jobs_stopped=$(jobs -s | wc -l | tr -d ' ')
|
||||
if [ $jobs_stopped -gt 0 ]; then
|
||||
PS1+=",\[$c_jobs\]stp=$jobs_stopped"
|
||||
PS1+=",\[$c_info\]stp=$jobs_stopped"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export DEV_CPPINC=-I.
|
||||
export DEV_FINC=-I.
|
||||
|
||||
#I need this to run distributor locally.
|
||||
export PGPASSFILE=$HOME/.fit_pgpass
|
||||
export PGPASSFILE=$HOME/.pgpass
|
||||
export PGSERVICEFILE=$HOME/.fit_pg_service.conf
|
||||
|
||||
export SRC_DIR=$HOME/devel/src
|
||||
@@ -25,6 +25,7 @@ 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/
|
||||
export PIP_INDEX_URL=https://artprod.dev.bloomberg.com/artifactory/api/pypi/bloomberg-pypi/simple
|
||||
|
||||
alias bb='cd $HOME/devel/bb >/dev/null'
|
||||
#complete -f -X '!*.mk' plink
|
||||
@@ -48,7 +49,7 @@ if [[ "$os" == "GNU/Linux" ]]; then
|
||||
else
|
||||
BBBITS=32
|
||||
fi
|
||||
export BBTAG=$(/opt/bb/bin/robolibs-current-build --tag local --bits $BBBITS)
|
||||
export BBTAG=$(/opt/bb/bin/robolibs-current-build --tag trunk --bits $BBBITS)
|
||||
|
||||
getop() { # BOX
|
||||
if [[ $# -ne 1 ]]; then
|
||||
@@ -73,73 +74,14 @@ run() {
|
||||
fi
|
||||
}
|
||||
|
||||
sun() { # CMD
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "Usage: sun <command>"
|
||||
else
|
||||
run njtsdev3 $@
|
||||
fi
|
||||
use-blot-meta(){
|
||||
export DPKG_ARCH=$(/opt/bb/bin/dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
export DPKG_DISTRO_DIR=$HOME/bb/blot-meta/cmake-distro-dev/${DPKG_ARCH}
|
||||
}
|
||||
|
||||
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
|
||||
use-local-distro(){
|
||||
unset DPKG_ARCH
|
||||
unset DPKG_DISTRO_DIR
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
93
local/bb_local_dev/.bashrc.local
Normal file
93
local/bb_local_dev/.bashrc.local
Normal file
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
|
||||
#wget
|
||||
#export http_proxy=devproxy.bloomberg.com:82
|
||||
#export https_proxy=devproxy.bloomberg.com:82
|
||||
|
||||
export DOCKER_HOST=tcp://0.0.0.0:2375
|
||||
|
||||
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 IS_64BIT=yes
|
||||
BBBITS=64
|
||||
#PATH=/bb/build/Linux-x86_64-64/release/robolibs/stage/opt/bb/libexec/build-base/:$PATH
|
||||
#export BBTAG=$(/opt/bb/bin/robolibs-current-build --tag local --bits $BBBITS) #Doesn't work on bbvpn
|
||||
export ARCHCODE=amd64
|
||||
export DPKG_DISTRO=unstable
|
||||
export DPKG_DISTRO_DIR=$HOME/cmake-distro-dev
|
||||
#export DPKG_SNAPSHOT=$(/opt/bb/bin/dpkg-distro-current-snapshot $DPKG_DISTRO) #This is slow.
|
||||
|
||||
export PATH=/opt/bb/bin:$PATH
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user