From bce6fd6a2c7df600d9ae52fabe71e556b7a1be8e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 19 Sep 2018 06:54:35 +0100 Subject: [PATCH 01/14] Backup script. --- bin/backup.hdd.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 bin/backup.hdd.sh diff --git a/bin/backup.hdd.sh b/bin/backup.hdd.sh new file mode 100755 index 0000000..83549f6 --- /dev/null +++ b/bin/backup.hdd.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +DATE=/bin/date +RSYNC=/usr/bin/rsync +TIMESTAMP=`$DATE +%Y%m%d-%H:%M%z` + +LOGFILE=/mnt/hdd/backup/log/backup.mybook.public.$TIMESTAMP.log +LOG="/usr/bin/tee -a $LOGFILE" + +function term() { + echo "Terminating." | $LOG + exit 1 +} +trap term INT + +function backup() { + ORIG_DIR=$1 + MIRROR_DIR=$2 + echo "Sync $ORIG_DIR to $MIRROR_DIR" + $RSYNC -aXv --delete --force --progress $ORIG_DIR $MIRROR_DIR | $LOG +} + +function backupwd() { + ORIG_DIR=$1 + MIRROR_DIR=192.168.0.6:/DataVolume/$2 + backup $ORIG_DIR $MIRROR_DIR +} + +# +# Log Header +# +echo Starting $LOGFILE | $LOG +echo start `$DATE` | $LOG +# +# Sync folders +# +backupwd "/srv/gitlab/" "backup/gitlab" +backupwd "/srv/nextcloud/" "backup/nextcloud" +backupwd "/mnt/hdd/public/_captured_MY_VIDEO/" "public/_captured_MY_VIDEO" +backupwd "/mnt/hdd/public/pix/" "public/pix" +backupwd "/mnt/hdd/public/music/" "public/music" +backupwd "/mnt/hdd/public/books/" "public/books" +backupwd "/mnt/hdd/vahagn/" "backup/vahagn" + +backup "/srv/gitlab" "/mnt/hdd/backup/gitlab" +backup "/srv/nextcloud" "/mnt/hdd/backup/nextcloud" +# +# Log Footer +# +echo end `$DATE` | $LOG + From cd74b031a8b8ae04784ab8b475e2db8cd2910fc9 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 19 Sep 2018 07:34:55 +0100 Subject: [PATCH 02/14] Remove --progress from backup script. --- bin/backup.hdd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/backup.hdd.sh b/bin/backup.hdd.sh index 83549f6..d539ceb 100755 --- a/bin/backup.hdd.sh +++ b/bin/backup.hdd.sh @@ -1,7 +1,7 @@ #!/bin/bash DATE=/bin/date -RSYNC=/usr/bin/rsync +RSYNC=/usr/bin/rsync TIMESTAMP=`$DATE +%Y%m%d-%H:%M%z` LOGFILE=/mnt/hdd/backup/log/backup.mybook.public.$TIMESTAMP.log @@ -17,7 +17,7 @@ function backup() { ORIG_DIR=$1 MIRROR_DIR=$2 echo "Sync $ORIG_DIR to $MIRROR_DIR" - $RSYNC -aXv --delete --force --progress $ORIG_DIR $MIRROR_DIR | $LOG + $RSYNC -aXv --delete --force $ORIG_DIR $MIRROR_DIR | $LOG } function backupwd() { @@ -26,6 +26,7 @@ function backupwd() { backup $ORIG_DIR $MIRROR_DIR } + # # Log Header # @@ -48,4 +49,3 @@ backup "/srv/nextcloud" "/mnt/hdd/backup/nextcloud" # Log Footer # echo end `$DATE` | $LOG - From 19af30bdc8210006f22c59414c58bcec367ef0e8 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sun, 5 Apr 2020 23:02:54 +0100 Subject: [PATCH 03/14] bbvpn bashrc.local --- local/bb_local_dev/.bashrc.local | 93 ++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 local/bb_local_dev/.bashrc.local diff --git a/local/bb_local_dev/.bashrc.local b/local/bb_local_dev/.bashrc.local new file mode 100644 index 0000000..8fdc4f5 --- /dev/null +++ b/local/bb_local_dev/.bashrc.local @@ -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 " + 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 +} From 227c9d884b669ce80b7ac2271a8e52361cb30859 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 22 Jun 2020 10:22:34 -0400 Subject: [PATCH 04/14] Got golden hooks. --- config/.gitconfig | 5 +++- git/hooks/commit-msg | 42 ++++++++++++++++++++++++++++++++++ git/hooks/prepare-commit-msg | 44 ++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100755 git/hooks/commit-msg create mode 100755 git/hooks/prepare-commit-msg diff --git a/config/.gitconfig b/config/.gitconfig index 219816c..05d245b 100644 --- a/config/.gitconfig +++ b/config/.gitconfig @@ -13,7 +13,10 @@ br = branch co = checkout ci = commit - svnsync = "!f(){ git co master && git pull && ssh devgit svnsync $(git config --get remote.origin.url | cut -d : -f 2 );}; f" + upload = "!f(){ git push $@ origin $(git rev-parse --abbrev-ref HEAD); }; f" + faxm = "!f(){ git fetch upstream master && git checkout -b ENG1FAXM-$1 upstream/master; }; f" + drqs = "!f(){ git fetch upstream master && git checkout -b DRQS-$1 upstream/master; }; f" + install-hooks = "!f(){ GIT_HOOKS=\"$(git rev-parse --git-dir)/hooks/\"; GOLDEN_HOOKS=\"$HOME/devel/scripts/git/hooks\"; [ -d \"$GIT_HOOKS\" ] && [ -d \"$GOLDEN_HOOKS\" ] && cp -r \"$GOLDEN_HOOKS/.\" \"$GIT_HOOKS\"; }; f" [merge] tool = vimdiff conflictstyle = diff3 diff --git a/git/hooks/commit-msg b/git/hooks/commit-msg new file mode 100755 index 0000000..28e5f1f --- /dev/null +++ b/git/hooks/commit-msg @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +#test "" = "$(grep '^Signed-off-by: ' "$1" | +# sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { +# echo >&2 Duplicate Signed-off-by lines. +# exit 1 +#} + +# +# SPELL CHECK +# +# 1. Install hunspell +# 2. Download a dictionary +# $ open http://wiki.services.openoffice.org/wiki/Dictionaries +# 3. Move this file into your repository +# $ mv commit-msg /path/to/repo/.git/hooks +# $ chmod +x /path/to/repo/.git/hooks/commit-msg +# +CHECK=$(cat $1 | hunspell -d en_US -l) +if [ "${CHECK}" != "" ]; then + echo "Spell Check Error: ${CHECK}" + echo "Message: $(cat $1)" + exit 1 +fi + diff --git a/git/hooks/prepare-commit-msg b/git/hooks/prepare-commit-msg new file mode 100755 index 0000000..ea60dfb --- /dev/null +++ b/git/hooks/prepare-commit-msg @@ -0,0 +1,44 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# +# Extract ticket id from the branch name and Append to commit message. +# Pattern NAME-NUMBER. e.g. ERROR-234 +# +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +MESSAGE=$(cat $COMMIT_MSG_FILE) +TICKET=$(git rev-parse --abbrev-ref HEAD | grep -Eo '^(\w+/)?(\w+[-_])[0-9]+' | grep -Eo '(\w+[-])[0-9]+' | tr "[:lower:]" "[:upper:]"): + +if [[ $TICKET == ":" || "$MESSAGE" == "$TICKET"* ]];then + exit 0; +fi + +echo "$TICKET $MESSAGE" > $COMMIT_MSG_FILE + +#/opt/bb/bin/perl5.16 -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /opt/bb/bin/perl5.16 -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /opt/bb/bin/perl5.16 -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi From d945cea0c3bb0a1b0e89d8b03c3459962b7d94d6 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 22 Jun 2020 10:39:27 -0400 Subject: [PATCH 05/14] git: setup-upstream script and refresh-master. --- config/.gitconfig | 2 ++ git/setup-upstream.sh | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 git/setup-upstream.sh diff --git a/config/.gitconfig b/config/.gitconfig index 05d245b..887c5c3 100644 --- a/config/.gitconfig +++ b/config/.gitconfig @@ -17,6 +17,8 @@ faxm = "!f(){ git fetch upstream master && git checkout -b ENG1FAXM-$1 upstream/master; }; f" drqs = "!f(){ git fetch upstream master && git checkout -b DRQS-$1 upstream/master; }; f" install-hooks = "!f(){ GIT_HOOKS=\"$(git rev-parse --git-dir)/hooks/\"; GOLDEN_HOOKS=\"$HOME/devel/scripts/git/hooks\"; [ -d \"$GIT_HOOKS\" ] && [ -d \"$GOLDEN_HOOKS\" ] && cp -r \"$GOLDEN_HOOKS/.\" \"$GIT_HOOKS\"; }; f" + refresh-master = "!f(){ git fetch upstream master; git checkout upstream/master; git branch -D master; git checkout -b master; }; f" + setup-upstream = "!source $HOME/devel/scripts/git/setup-upstream.sh" [merge] tool = vimdiff conflictstyle = diff3 diff --git a/git/setup-upstream.sh b/git/setup-upstream.sh new file mode 100755 index 0000000..c7cd8f0 --- /dev/null +++ b/git/setup-upstream.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +git-setup-upstream(){ + + 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-setup-upstream + + From 4e09a246af505d70a3d8a5f5daaf3f025a4ed376 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 24 Jun 2020 07:15:55 -0400 Subject: [PATCH 06/14] Vundle update. --- vim/bundle/Vundle.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/bundle/Vundle.vim b/vim/bundle/Vundle.vim index b255382..9a38216 160000 --- a/vim/bundle/Vundle.vim +++ b/vim/bundle/Vundle.vim @@ -1 +1 @@ -Subproject commit b255382d6242d7ea3877bf059d2934125e0c4d95 +Subproject commit 9a38216a1c0c597f978d73547d37681fc689c90d From 268e368271b69fb5a246dc3622bec5a121439cb1 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 24 Jun 2020 07:17:37 -0400 Subject: [PATCH 07/14] Using aspell for spell checking. --- git/.aspell.en_US.per | 5 +++++ git/hooks/commit-msg | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 git/.aspell.en_US.per diff --git a/git/.aspell.en_US.per b/git/.aspell.en_US.per new file mode 100644 index 0000000..e714e3a --- /dev/null +++ b/git/.aspell.en_US.per @@ -0,0 +1,5 @@ +personal_ws-1.1 en 0 +FAXM +BLOT +Lakos +Vundle diff --git a/git/hooks/commit-msg b/git/hooks/commit-msg index 28e5f1f..afbff24 100755 --- a/git/hooks/commit-msg +++ b/git/hooks/commit-msg @@ -32,11 +32,13 @@ # 3. Move this file into your repository # $ mv commit-msg /path/to/repo/.git/hooks # $ chmod +x /path/to/repo/.git/hooks/commit-msg -# -CHECK=$(cat $1 | hunspell -d en_US -l) +CHECK=$(cat $1 | aspell --lang=en_US list --add-extra-dicts=$HOME/.aspell.en_US.per) +#CHECK=$(cat $1 | hunspell -s -d en_US,${HOME}/devel/scripts/git/my_dictionary -l) if [ "${CHECK}" != "" ]; then - echo "Spell Check Error: ${CHECK}" - echo "Message: $(cat $1)" + echo "Spell Check Error:" + #cat $1 | hunspell -a -d en_US,${HOME}/devel/scripts/git/my_dictionary -l + cat $1 | aspell -a --lang=en_US list --add-extra-dicts=$HOME/.aspell.en_US.per + echo "Use --no-verify if you want to commit." exit 1 fi From faf4b6d3ed0291a61fecfcfd96d52664efcf596d Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 24 Jun 2020 07:19:29 -0400 Subject: [PATCH 08/14] git install-hooks fix --- config/.gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/.gitconfig b/config/.gitconfig index 887c5c3..17c2688 100644 --- a/config/.gitconfig +++ b/config/.gitconfig @@ -16,7 +16,7 @@ upload = "!f(){ git push $@ origin $(git rev-parse --abbrev-ref HEAD); }; f" faxm = "!f(){ git fetch upstream master && git checkout -b ENG1FAXM-$1 upstream/master; }; f" drqs = "!f(){ git fetch upstream master && git checkout -b DRQS-$1 upstream/master; }; f" - install-hooks = "!f(){ GIT_HOOKS=\"$(git rev-parse --git-dir)/hooks/\"; GOLDEN_HOOKS=\"$HOME/devel/scripts/git/hooks\"; [ -d \"$GIT_HOOKS\" ] && [ -d \"$GOLDEN_HOOKS\" ] && cp -r \"$GOLDEN_HOOKS/.\" \"$GIT_HOOKS\"; }; f" + install-hooks = "!f(){ GIT_HOOKS=\"$(git rev-parse --git-dir)/hooks/\"; GOLDEN_HOOKS=\"$HOME/devel/scripts/git/hooks\"; [ -d \"$GIT_HOOKS\" ] && [ -d \"$GOLDEN_HOOKS\" ] && cp -rf \"$GOLDEN_HOOKS/.\" \"$GIT_HOOKS\"; }; f" refresh-master = "!f(){ git fetch upstream master; git checkout upstream/master; git branch -D master; git checkout -b master; }; f" setup-upstream = "!source $HOME/devel/scripts/git/setup-upstream.sh" [merge] From d2636a0f947ebc8006934b491610c204311496cc Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 24 Jun 2020 07:25:25 -0400 Subject: [PATCH 09/14] Don't show my user name and command prompt. --- config/.bashrc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/config/.bashrc b/config/.bashrc index c6b8084..23a7bf9 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -116,7 +116,8 @@ if [ -n "$PS1" ]; then # if [ $c_num -ge 256 ]; then c_reset="$(tput sgr0)" - c_user="$(tput setaf 112)" #Green + c_user="$(tput setaf 203)" #Some bright color + c_host="$(tput setaf 112)" #Green c_cwd="$(tput setaf 99)" c_time="$(tput setaf 33)" #Light blue c_branch="$(tput setaf 138)" @@ -124,7 +125,8 @@ if [ -n "$PS1" ]; then c_jobs="$(tput setaf 220)" #Yellow else c_reset="$(tput sgr0)" - c_user="$(tput setaf 2)" #Green + c_user="$(tput setaf 1)" # + c_host="$(tput setaf 2)" #Green c_cwd="$(tput setaf 7)" #White c_time="$(tput setaf 6)" #Cyan c_branch="$(tput setaf 6)" #Cyan @@ -144,7 +146,12 @@ if [ -n "$PS1" ]; then # local exit_code="$?" prompt_extra="" - PS1="\[$c_user\]\u@\h:" # username@host: + if [ "$USER" != "vkhachatrya5" -a "$USER" != "vahagn" ]; then + PS1="\[$c_user\]\u@" # username@ + else + PS1="" + fi + PS1+="\[$c_host\]\h:" # hostname PS1+="\[$c_time\]\t" # time PS1+=" \[$c_cwd\]\w" # working_dir # From cb27c91fc9610a3dfdd8a65c256237000b0fc6ec Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sun, 26 Jul 2020 03:17:20 +0400 Subject: [PATCH 10/14] upload.ready.deluge.sh --- bin/upload.ready.deluge.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/upload.ready.deluge.sh b/bin/upload.ready.deluge.sh index ccfdbe9..a761221 100755 --- a/bin/upload.ready.deluge.sh +++ b/bin/upload.ready.deluge.sh @@ -4,7 +4,7 @@ if [ ! -z "$*" ]; then /usr/bin/rsync -av --inplace --progress --append-verify "/mnt/ssd/deluge/done/$i" "hrat:tmp/tmp/done/" done else - echo "/usr/bin/rsync -av --inplace --append-verify /mnt/ssd/deluge/done hrat:tmp/tmp" + /usr/bin/rsync -av --inplace --append-verify /mnt/ssd/deluge/done hrat:tmp/tmp fi From d54ce5b3c2104aaa59021f8fe7d4d696e180a3fc Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 26 Jun 2020 04:21:10 -0400 Subject: [PATCH 11/14] local/bb/.bashrc.local --- local/bb/.bashrc.local | 76 +++++------------------------------------- 1 file changed, 9 insertions(+), 67 deletions(-) diff --git a/local/bb/.bashrc.local b/local/bb/.bashrc.local index a4c467b..7929f89 100755 --- a/local/bb/.bashrc.local +++ b/local/bb/.bashrc.local @@ -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 " - 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 " - 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 } # From 3cff4617993dce93a5edc17abfded81eb0a635e7 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 25 Sep 2020 04:59:50 -0400 Subject: [PATCH 12/14] Python venv added to .bashrc. --- config/.bashrc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/config/.bashrc b/config/.bashrc index 23a7bf9..698c45a 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -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 From 881fe061b968061f27bc82e9c4f8c47fdc68d3ce Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 28 Dec 2020 01:51:45 +0400 Subject: [PATCH 13/14] upload.ready.deluge.sh no-progress --- bin/upload.ready.deluge.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/upload.ready.deluge.sh b/bin/upload.ready.deluge.sh index a761221..8a17ca0 100755 --- a/bin/upload.ready.deluge.sh +++ b/bin/upload.ready.deluge.sh @@ -1,10 +1,16 @@ +#!/bin/bash set -x +if [ "$1" != "no-progress" ]; then + PROG=--progress +else + shift +fi if [ ! -z "$*" ]; then for i in "$@"; do /usr/bin/rsync -av --inplace --progress --append-verify "/mnt/ssd/deluge/done/$i" "hrat:tmp/tmp/done/" done else - /usr/bin/rsync -av --inplace --append-verify /mnt/ssd/deluge/done hrat:tmp/tmp + /usr/bin/rsync -av --inplace --append-verify $PROG /mnt/ssd/deluge/done hrat:tmp/tmp fi From 588a6ed9f4fb387475e5117442567e48185219bc Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sat, 16 Jan 2021 15:06:50 +0000 Subject: [PATCH 14/14] vim/spell --- vim/spell/en.utf-8.add | 1 + vim/spell/en.utf-8.add.spl | Bin 0 -> 29 bytes 2 files changed, 1 insertion(+) create mode 100644 vim/spell/en.utf-8.add create mode 100644 vim/spell/en.utf-8.add.spl diff --git a/vim/spell/en.utf-8.add b/vim/spell/en.utf-8.add new file mode 100644 index 0000000..4291d7f --- /dev/null +++ b/vim/spell/en.utf-8.add @@ -0,0 +1 @@ +mv diff --git a/vim/spell/en.utf-8.add.spl b/vim/spell/en.utf-8.add.spl new file mode 100644 index 0000000000000000000000000000000000000000..35cf351f144ab4ab0b1b2496c7e445bf36cf3610 GIT binary patch literal 29 dcmWIZ^erw(&B-zP&%nUI#+b`k#t39U0RV9m1u6gl literal 0 HcmV?d00001