Compare commits
75 Commits
010e1a64f1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d821633ecb | |||
| a8d89c343d | |||
| 313ef038ee | |||
| 99aa330fbc | |||
| b0761222e1 | |||
| 4b03ce1b3d | |||
| b5866c3ef0 | |||
| 34aaf2e37a | |||
| f3e4e0f3fe | |||
| 46685dd18e | |||
| fd800adfd7 | |||
| ea3717a930 | |||
| b2d188344e | |||
| ea10d5a0ad | |||
| 25fe63e4f9 | |||
| d8de2dd2d4 | |||
| 4758e6b2f2 | |||
| 094166bb4b | |||
| 3e6aba7331 | |||
| 3d0c46888d | |||
| 687999be1a | |||
| 4609a035af | |||
| 3cb73cb62c | |||
| 108ad9efd2 | |||
| e8cd6dfab5 | |||
| 4b4c601103 | |||
| 75ceaf0eaa | |||
| 934756ca7b | |||
|
|
23e9cd3444 | ||
|
|
2ce2aea94c | ||
| 5db2e777a4 | |||
| 7f99cc393a | |||
| 588a6ed9f4 | |||
| 6854f0f16b | |||
| aac319d451 | |||
| 881fe061b9 | |||
| ec152c590e | |||
| b25a9090e1 | |||
|
|
3cff461799 | ||
|
|
d54ce5b3c2 | ||
|
|
9447f29865 | ||
| cb27c91fc9 | |||
|
|
d2636a0f94 | ||
|
|
faf4b6d3ed | ||
|
|
268e368271 | ||
|
|
4e09a246af | ||
|
|
d945cea0c3 | ||
|
|
227c9d884b | ||
|
|
8122906e08 | ||
| 6d1f23bda5 | |||
| 716ef8d098 | |||
|
|
19af30bdc8 | ||
| 39c3b43ab7 | |||
|
|
11dfca106e | ||
| 98db749815 | |||
| e90b6dfede | |||
| 93fec3e4b4 | |||
| 6833f5b5c9 | |||
|
|
bd5b1623ea | ||
| 9eebd30038 | |||
| 6a676ba410 | |||
| d18052d793 | |||
| 52d2b83479 | |||
| f4463206d5 | |||
| 4e7dc264d6 | |||
| 35f225f9a4 | |||
| f3cc45cc57 | |||
|
|
5f8fe54a8f | ||
|
|
01e488783b | ||
|
|
519c9e802d | ||
|
|
55db114d1f | ||
|
|
243da630af | ||
|
|
fbd8aa8e74 | ||
|
|
2b4acf6e01 | ||
|
|
70dd0d162e |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
*.swp
|
||||
*.swo
|
||||
vim/bundle
|
||||
|
||||
config/.vim/autoload
|
||||
config/.vim/plugged
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
||||
[submodule "vim/bundle/Vundle.vim"]
|
||||
path = vim/bundle/Vundle.vim
|
||||
url = https://github.com/VundleVim/Vundle.vim.git
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
CD=cd
|
||||
DATE=/bin/date
|
||||
TAR=/bin/tar
|
||||
BZIP2=/bin/bzip2
|
||||
GIT=/usr/bin/git
|
||||
GPG=/usr/bin/gpg
|
||||
PASS=/home/vahagn/.gnupg/backup-passphrase
|
||||
SRC=/home/vahagn/git
|
||||
KEEP=5
|
||||
BACKUP_DIR=/home/vahagn/gdrive/backup
|
||||
|
||||
TIMESTAMP=`$DATE +%Y%m%d-%H:%M%z`
|
||||
LOG=/mnt/hdd/backup/backup.git.$TIMESTAMP.log
|
||||
BACKUP=$BACKUP_DIR/git.$TIMESTAMP.tar.bz2.gpg
|
||||
SIGNATURE=$BACKUP_DIR/git.$TIMESTAMP.tar.bz2.sig
|
||||
|
||||
#
|
||||
# debug
|
||||
#
|
||||
#LOG=/home/vahagn/devel/scripts/backup/log.log
|
||||
#BACKUP=/home/vahagn/devel/scripts/backup/git.tar.bz2.gpg
|
||||
#SRC=/home/vahagn/git/scripts.git
|
||||
|
||||
#
|
||||
# Header
|
||||
#
|
||||
echo Starting $LOG | tee -a $LOG
|
||||
echo start `$DATE` | tee -a $LOG
|
||||
#
|
||||
# Sync with BitBucket upstream repos.
|
||||
#
|
||||
$CD $SRC/scripts.git
|
||||
$GIT fetch
|
||||
$CD $SRC/test.git
|
||||
$GIT fetch
|
||||
#
|
||||
# cd to git directory and then bzip2 all content and crypt it.
|
||||
#
|
||||
$CD $SRC
|
||||
($TAR -cvp . | $BZIP2 -c | $GPG -c --passphrase-file $PASS --output $BACKUP --batch --quiet ) 2>&1| tee -a $LOG
|
||||
#
|
||||
# Remove old files
|
||||
#
|
||||
$CD $BACKUP_DIR
|
||||
i=0
|
||||
for FILE in `ls -t git.*.tar.bz2.gpg`; do
|
||||
if [ $i -ge $KEEP ]; then
|
||||
echo "$FILE is removed to meet keep number of backups $KEEP." | tee -a $LOG
|
||||
rm $FILE 2>&1| tee -a $LOG
|
||||
fi;
|
||||
i=$(($i+1))
|
||||
done
|
||||
i=0
|
||||
for FILE in `ls -t git.*.tar.bz2.sig`; do
|
||||
if [ $i -ge $KEEP ]; then
|
||||
echo "$FILE is removed to meet keep number of backups $KEEP." | tee -a $LOG
|
||||
rm $FILE 2>&1| tee -a $LOG
|
||||
fi;
|
||||
i=$(($i+1))
|
||||
done
|
||||
#
|
||||
# Footer
|
||||
#
|
||||
echo end `$DATE` | tee -a $LOG
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/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 $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
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
DATE=/bin/date
|
||||
SYNC="/usr/bin/rsync -auAX --delete"
|
||||
TIMESTAMP=`$DATE +%Y%m%d-%H:%M%z`
|
||||
|
||||
LOG=/mnt/hdd/backup/backup.mybook.vahagn.$TIMESTAMP.log
|
||||
echo Starting $LOG | tee -a $LOG
|
||||
echo start `$DATE` | tee -a $LOG
|
||||
$SYNC /mnt/mybook/vahagn /mnt/hdd/backup | tee -a $LOG
|
||||
echo end `$DATE` | tee -a $LOG
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
docker run \
|
||||
-d \
|
||||
--net=host \
|
||||
--name gerbera \
|
||||
--hostname gerbera \
|
||||
--restart always \
|
||||
--volume /srv/gerbera/config:/root/.config \
|
||||
--volume /srv/gerbera/music:/mnt/music \
|
||||
--volume /srv/gerbera/video:/mnt/video \
|
||||
--volume /mnt/hdd2/public/movies:/mnt/hdd_video \
|
||||
--volume /mnt/hdd/public/music:/mnt/hdd_music \
|
||||
gerbera/gerbera
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
sudo docker run --detach \
|
||||
--name gitlab \
|
||||
--hostname gitlab \
|
||||
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.vostan.org/'; gitlab_rails['lfs_enabled'] = true; gitlab_rails['gitlab_signin_enabled'] = false;" \
|
||||
--publish 8443:443 \
|
||||
--publish 8080:80 \
|
||||
--publish 8022:22 \
|
||||
--restart always \
|
||||
--volume /srv/gitlab/config:/etc/gitlab \
|
||||
--volume /srv/gitlab/logs:/var/log/gitlab \
|
||||
--volume /srv/gitlab/data:/var/opt/gitlab \
|
||||
gitlab/gitlab-ce:latest
|
||||
@@ -1,7 +0,0 @@
|
||||
sudo docker run \
|
||||
--name nextcloud \
|
||||
-d \
|
||||
--publish 8090:80 \
|
||||
--restart always \
|
||||
--volume /srv/nextcloud:/var/www/html \
|
||||
nextcloud
|
||||
62
config/.bash_profile.vahagn
Executable file
62
config/.bash_profile.vahagn
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Find out system details.
|
||||
#
|
||||
os=`uname` #GNU/Linux AIX Solaris
|
||||
cpu=`uname -p` #x86_64 powerpc sparc
|
||||
kernel=`uname -s` #Linux AIX SunOS
|
||||
kversion=`uname -v`
|
||||
krelease=`uname -r`
|
||||
hostnm=`hostname`
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Bash history
|
||||
#
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=5000
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# vi edit mode.
|
||||
set -o vi
|
||||
|
||||
export EDITOR=vim
|
||||
export LESS=-R
|
||||
|
||||
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
##
|
||||
## User specific environment and startup programs
|
||||
##
|
||||
|
||||
#if [ -e $HOME/bin ]; then
|
||||
# export PATH=$HOME/bin:$PATH
|
||||
#fi
|
||||
#export MYSCRIPTS=$HOME/devel/scripts
|
||||
#if [ -e $MYSCRIPTS/bin ]; then
|
||||
# export PATH=$MYSCRIPTS/bin:$PATH
|
||||
#fi
|
||||
#export MYCFG=${MYSCRIPTS}/config
|
||||
|
||||
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
## Set command prompt
|
||||
#[ -x ${MYCFG}/.profile.prompt ] && source ${MYCFG}/.profile.prompt
|
||||
#[ -x ${MYCFG}/.profile.dircolor ] && source ${MYCFG}/.profile.dircolor
|
||||
#[ -x ${MYCFG}/.profile.completion ] && source ${MYCFG}/.profile.completion
|
||||
#[ -x ${MYCFG}/.profile.dev ] && source ${MYCFG}/.profile.dev
|
||||
#[ -x ${MYCFG}/.profile.aliases ] && source ${MYCFG}/.profile.aliases
|
||||
|
||||
#
|
||||
# Clean error level.
|
||||
#
|
||||
[ 1 ]
|
||||
335
config/.bashrc
335
config/.bashrc
@@ -1,335 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ~/.bashrc skeleton
|
||||
# ~/.bashrc runs ONLY on non-login subshells! (different from ksh)
|
||||
# add lines here very carefully as this may execute when you don't i
|
||||
# expect them to
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#echo "BASHRC has run"
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Source global definitions
|
||||
#
|
||||
if [ -f /etc/bashrc ]; then
|
||||
. /etc/bashrc
|
||||
else
|
||||
if ! shopt -q login_shell ; then # We're not a login shell
|
||||
for i in /etc/profile.d/*.sh; do
|
||||
if [ -r "$i" ]; then
|
||||
if [ "$PS1" ]; then
|
||||
. $i
|
||||
else
|
||||
. $i &>/dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
fi
|
||||
fi
|
||||
|
||||
umask 002
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Find out system details.
|
||||
#
|
||||
os=`uname -o` #GNU/Linux AIX Solaris
|
||||
cpu=`uname -p` #x86_64 powerpc sparc
|
||||
kernel=`uname -s` #Linux AIX SunOS
|
||||
kversion=`uname -v`
|
||||
krelease=`uname -r`
|
||||
hostnm=`hostname`
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Bash history
|
||||
#
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=5000
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Terminal colors if interactive
|
||||
#
|
||||
if [ -n "$PS1" ]; then
|
||||
#
|
||||
# If there is no terminal info in the system for current terminal but there is
|
||||
# one in local terminfo then use it.
|
||||
#
|
||||
tput -T $TERM longname 2>/dev/null >/dev/null
|
||||
if [ "$?" -ne "0" ] && [ -f $HOME/.terminfo/$kernel/${TERM:0:1}/$TERM ]; then
|
||||
export TERMINFO=$HOME/.terminfo/$kernel;
|
||||
fi
|
||||
#
|
||||
# Number of colors and standard colors.
|
||||
#
|
||||
c_num=$(tput colors)
|
||||
# regular foreground
|
||||
c_red=$(tput setaf 1)
|
||||
c_green=$(tput setaf 2)
|
||||
c_orange=$(tput setaf 3)
|
||||
c_blue=$(tput setaf 4)
|
||||
c_pink=$(tput setaf 5)
|
||||
c_cyan=$(tput setaf 6)
|
||||
c_white=$(tput setaf 7)
|
||||
c_viol=$(tput setaf 12)
|
||||
# bold foreground
|
||||
#cbf_red=$(tput bold; tput setaf 1)
|
||||
#
|
||||
# Load better colors for ls.
|
||||
#
|
||||
if [ $c_num -ge 256 ] && [ -f ~/.dir_colors ]; then
|
||||
eval $(dircolors ~/.dir_colors)
|
||||
fi
|
||||
fi
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Prompt if interactive
|
||||
#
|
||||
if [ -n "$PS1" ]; then
|
||||
#
|
||||
# Set better colors if available.
|
||||
#
|
||||
if [ $c_num -ge 256 ]; then
|
||||
c_reset="$(tput sgr0)"
|
||||
c_user="$c_green"
|
||||
c_cwd="$c_viol"
|
||||
c_time="$c_pink"
|
||||
c_branch="$c_cyan"
|
||||
c_exit="$c_red"
|
||||
c_jobs="$c_orange"
|
||||
else
|
||||
c_reset="$(tput sgr0)"
|
||||
c_user="$c_green"
|
||||
c_cwd="$c_viol"
|
||||
c_time="$c_pink"
|
||||
c_branch="$c_cyan"
|
||||
c_exit="$c_red"
|
||||
c_jobs="$c_orange"
|
||||
fi
|
||||
|
||||
[ -n "$(which svn)" ] && prompt_check_svn=true
|
||||
[ -n "$(which git)" ] && prompt_check_git=true
|
||||
|
||||
#
|
||||
# Colors should be set here and surrounded with \[\]otherwise bash fails to
|
||||
# calculate prompt length. The text is set through PROMPT_COMMAND
|
||||
PS1="\[$c_user\]\u@\h:" # username@host:
|
||||
PS1+="\[$c_time\]\t" # time
|
||||
PS1+=" \[$c_cwd\]\w" # working_dir
|
||||
PS1+="\[$c_branch\]\$git_text" # git branch
|
||||
PS1+="\[$c_branch\]\$svn_text" # svn revision
|
||||
PS1+="\[$c_exit\]\$exit_text" # exit status of last command
|
||||
PS1+="\[$c_jobs\]\$jobs_text" # background/suspended jobs
|
||||
PS1+="\[$c_reset\]\$ " # reset colors and print $
|
||||
|
||||
export PROMPT_COMMAND="__prompt_command; $PROMPT_COMMAND"
|
||||
function __prompt_command()
|
||||
{
|
||||
#
|
||||
# get exit code before any command is run.
|
||||
# TODO: doesn't work on pi.
|
||||
#
|
||||
local exit_code="$?"
|
||||
prompt_extra=""
|
||||
#
|
||||
# git branch if exist
|
||||
#
|
||||
if [ -n "$prompt_check_git" ]; then
|
||||
local git_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | tr -d ' ')
|
||||
if [ -n "$git_branch" ]; then
|
||||
git_text="[$git_branch]"
|
||||
else
|
||||
git_text=""
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# svn branch if exist
|
||||
#
|
||||
if [ -n "$prompt_check_svn" ]; then
|
||||
local svn_rev=$(svn info . 2> /dev/null | awk -F ':' '/Revision:/ { print $2 }')
|
||||
if [ -n "$svn_rev" ]; then
|
||||
svn_text="[$svn_rev]"
|
||||
else
|
||||
svn_text=""
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# exit code if not zero
|
||||
#
|
||||
if [ "$exit_code" -ne "0" ]; then
|
||||
exit_text="[exit=$exit_code]"
|
||||
else
|
||||
exit_text=""
|
||||
fi
|
||||
#
|
||||
# Info about jobs.
|
||||
#
|
||||
local jobs_bg=$(jobs -r | wc -l | tr -d ' ')
|
||||
local jobs_stopped=$(jobs -s | wc -l | tr -d ' ')
|
||||
if [ $jobs_bg -gt 0 ] || [ $jobs_stopped -gt 0 ]; then
|
||||
jobs_text="[bg:$jobs_bg,stp:$jobs_stopped]"
|
||||
else
|
||||
jobs_text=""
|
||||
fi
|
||||
}
|
||||
# Turn on checkwinsize
|
||||
shopt -s checkwinsize
|
||||
fi
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# User specific environment and startup programs
|
||||
#
|
||||
|
||||
#
|
||||
# Set my paths.
|
||||
#
|
||||
if [ -e $HOME/local ]; then
|
||||
MYLOCAL=$HOME/local
|
||||
elif [ $kernel == Linux ] && [ -e $HOME/local-lnx ]; then
|
||||
MYLOCAL=$HOME/local-lnx
|
||||
elif [ $kernel == SunOS ] && [ -e $HOME/local-sun ]; then
|
||||
MYLOCAL=$HOME/local-sun
|
||||
fi
|
||||
if [ -e $MYLOCAL/bin ]; then
|
||||
export PATH=$MYLOCAL/bin:$PATH
|
||||
fi
|
||||
|
||||
MYSCRIPTS=$HOME/devel/scripts
|
||||
if [ -e $MYSCRIPTS/bin ]; then
|
||||
export PATH=$MYSCRIPTS/bin:$PATH
|
||||
fi
|
||||
|
||||
if [ -e $HOME/.local/bin ]; then
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
fi
|
||||
|
||||
#
|
||||
# VIM
|
||||
#
|
||||
export EDITOR=vim
|
||||
|
||||
#
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
#
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# GIT
|
||||
#
|
||||
[ -f $MYSCRIPTS/bash/git-completion.bash ] && . $MYSCRIPTSE/bash/git-completion.bash
|
||||
|
||||
#
|
||||
# colored GCC warnings and errors
|
||||
#
|
||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Aliases
|
||||
#
|
||||
if [ $kernel == AIX ]; then
|
||||
alias ls='ls -a'
|
||||
alias ll='ls -la'
|
||||
alias pd='pushd >/dev/null'
|
||||
alias bd='popd'
|
||||
else
|
||||
alias ls='ls -a --color=auto'
|
||||
alias ll='ls -la --color=auto'
|
||||
alias pd='pushd >/dev/null'
|
||||
alias bd='popd'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
function cgrep() {
|
||||
if [[ $# -eq 0 ]]
|
||||
then
|
||||
echo "Usage: codegrep <pattern> "
|
||||
else
|
||||
grep -nR --colour \
|
||||
--include=\*.cpp \
|
||||
--include=\*.c \
|
||||
--include=\*.hpp \
|
||||
--include=\*.h \
|
||||
--include=\*.inc \
|
||||
--include=\*.php \
|
||||
--include=\*.py \
|
||||
--include=\*.sh \
|
||||
--exclude-dir=.git \
|
||||
--exclude-dir=.svn \
|
||||
--exclude-dir=llcalc* \
|
||||
--exclude-dir=00* \
|
||||
"$1" .
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function create_tags() {
|
||||
#Bloomberg
|
||||
if [ -e /opt/swt/bin/ctags ]; then
|
||||
CTAGS=/opt/swt/bin/ctags
|
||||
else
|
||||
CTAGS=ctags
|
||||
fi
|
||||
CTAGS_OPT='--recurse=yes '
|
||||
CTAGS_OPT+='--verbose '
|
||||
CTAGS_OPT+='--totals=yes '
|
||||
CTAGS_OPT+='--tag-relative=yes '
|
||||
|
||||
CTAGS_DIR_CFG='.ctags_dir'
|
||||
CTAGS_ROOT="$PWD"
|
||||
if [ ! -f $PWD/$CTAGS_DIR_CFG ]; then
|
||||
GIT_ROOT=$(git top pwd)
|
||||
if [ -f $GIT_ROOT/$CTAGS_DIR_CFG ]; then
|
||||
CTAGS_ROOT="$GIT_ROOT"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f $CTAGS_ROOT/$CTAGS_DIR_CFG ]; then
|
||||
CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR"
|
||||
else
|
||||
CTAGS_SRC="$@"
|
||||
fi
|
||||
|
||||
cd $CTAGS_ROOT
|
||||
$CTAGS $CTAGS_OPT $CTAGS_SRC
|
||||
cd -
|
||||
}
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Run local settings.
|
||||
#
|
||||
[ -x $HOME/.bashrc.local ] && . $HOME/.bashrc.local
|
||||
|
||||
#
|
||||
# Clean error level.
|
||||
#
|
||||
[ 1 ]
|
||||
104
config/.bashrc.vahagn
Executable file
104
config/.bashrc.vahagn
Executable file
@@ -0,0 +1,104 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ~/.bashrc skeleton
|
||||
# ~/.bashrc runs ONLY on non-login subshells! (different from ksh)
|
||||
# add lines here very carefully as this may execute when you don't i
|
||||
# expect them to
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#echo "BASHRC has run"
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Source global definitions
|
||||
#
|
||||
if [ -f /etc/bashrc ]; then
|
||||
. /etc/bashrc
|
||||
else
|
||||
if ! shopt -q login_shell ; then # We're not a login shell
|
||||
for i in /etc/profile.d/*.sh; do
|
||||
if [ -r "$i" ]; then
|
||||
if [ "$PS1" ]; then
|
||||
. $i
|
||||
else
|
||||
. $i &>/dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
fi
|
||||
fi
|
||||
|
||||
umask 002
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Find out system details.
|
||||
#
|
||||
os=`uname` #GNU/Linux AIX Solaris
|
||||
cpu=`uname -p` #x86_64 powerpc sparc
|
||||
kernel=`uname -s` #Linux AIX SunOS
|
||||
kversion=`uname -v`
|
||||
krelease=`uname -r`
|
||||
hostnm=`hostname`
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Bash history
|
||||
#
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=5000
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# User specific environment and startup programs
|
||||
#
|
||||
|
||||
if [ -e $HOME/bin ]; then
|
||||
export PATH=$HOME/bin:$PATH
|
||||
fi
|
||||
export MYSCRIPTS=$HOME/devel/scripts
|
||||
if [ -e $MYSCRIPTS/bin ]; then
|
||||
export PATH=$MYSCRIPTS/bin:$PATH
|
||||
fi
|
||||
export MYCFG=${MYSCRIPTS}/config
|
||||
|
||||
#
|
||||
# VIM
|
||||
#
|
||||
export EDITOR=vim
|
||||
export LESS=-R
|
||||
set -o vi
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
# Set command prompt
|
||||
[ -f ${HOME}/.profile.prompt ] && source ${HOME}/.profile.prompt
|
||||
[ -f ${HOME}/.profile.dircolor ] && source ${HOME}/.profile.dircolor
|
||||
[ -f ${HOME}/.profile.completion ] && source ${HOME}/.profile.completion
|
||||
[ -f ${HOME}/.profile.dev ] && source ${HOME}/.profile.dev
|
||||
[ -f ${HOME}/.profile.aliases ] && source ${HOME}/.profile.aliases
|
||||
|
||||
# Haskell
|
||||
if [ -f $HOME/.ghcup/env ]; then
|
||||
export PATH=$HOME/.ghcup/env:$PATH
|
||||
fi
|
||||
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
#
|
||||
# Run local settings.
|
||||
#
|
||||
[ -x ${HOME}/.bashrc.local ] && . ${HOME}/.bashrc.local
|
||||
|
||||
#
|
||||
# Clean error level.
|
||||
#
|
||||
[ 1 ]
|
||||
@@ -1,3 +1,5 @@
|
||||
[include]
|
||||
path = ~/.gitconfig.local
|
||||
[user]
|
||||
name = Vahagn Khachatryan
|
||||
email = vahagn.khachatryan@gmail.com
|
||||
@@ -13,27 +15,26 @@
|
||||
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 -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]
|
||||
tool = vimdiff
|
||||
conflictstyle = diff3
|
||||
[mergetool]
|
||||
prompt = false
|
||||
[include]
|
||||
path = ~/.gitconfig.local
|
||||
[core]
|
||||
excludesfile = ~/.gitignore.global
|
||||
autocrlf = false
|
||||
pager = less -F -X
|
||||
[credentail]
|
||||
helper = cache
|
||||
|
||||
|
||||
[url "https://vishap@github.com/"]
|
||||
[pager]
|
||||
branch = false
|
||||
[url "git@github.com:"]
|
||||
insteadOf = github:
|
||||
|
||||
[url "https://gitlab.com/"]
|
||||
insteadOf = gitlab:
|
||||
|
||||
[url "http://192.168.0.4:8080/"]
|
||||
insteadOf = mylab:
|
||||
|
||||
[url "git@gitea:"]
|
||||
insteadOf = gitea:
|
||||
|
||||
25
config/.profile.aliases
Executable file
25
config/.profile.aliases
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Aliases
|
||||
#
|
||||
if [ $kernel == "Darwin" ]; then
|
||||
alias ls='ls -a'
|
||||
alias ll='ls -la'
|
||||
alias pd='pushd >/dev/null'
|
||||
alias bd='popd'
|
||||
else
|
||||
alias ls='ls -a --color=auto'
|
||||
alias ll='ls -la --color=auto'
|
||||
alias pd='pushd >/dev/null'
|
||||
alias bd='popd'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
29
config/.profile.completion
Executable file
29
config/.profile.completion
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
#
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# GIT
|
||||
#
|
||||
[ -f $MYSCRIPTS/bash/git-completion.bash ] && source $MYSCRIPTSE/bash/git-completion.bash
|
||||
|
||||
[ -f /opt/facebook/share/bash_completion ] && source /opt/facebook/share/bash_completion
|
||||
|
||||
#
|
||||
# Ondemand
|
||||
#
|
||||
complete -W "connect ineractive list release smartlog whoami help" ondemand
|
||||
complete -W "connect ineractive list release smartlog whoami help" dev
|
||||
|
||||
complete -W "dev hrat lusntag --help" ssh
|
||||
62
config/.profile.dev
Executable file
62
config/.profile.dev
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# colored GCC warnings and errors
|
||||
#
|
||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
function cgrep() {
|
||||
if [[ $# -eq 0 ]]
|
||||
then
|
||||
echo "Usage: cgrep <pattern> "
|
||||
else
|
||||
grep -nR --colour \
|
||||
--include=\*.cpp \
|
||||
--include=\*.c \
|
||||
--include=\*.hpp \
|
||||
--include=\*.h \
|
||||
--include=\*.inc \
|
||||
--include=\*.php \
|
||||
--include=\*.py \
|
||||
--include=\*.sh \
|
||||
--exclude-dir=.git \
|
||||
--exclude-dir=.svn \
|
||||
--exclude-dir=llcalc* \
|
||||
--exclude-dir=00* \
|
||||
"$1" .
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function create_tags() {
|
||||
#Bloomberg
|
||||
if [ -e /opt/swt/bin/ctags ]; then
|
||||
CTAGS=/opt/swt/bin/ctags
|
||||
else
|
||||
CTAGS=ctags
|
||||
fi
|
||||
CTAGS_OPT='--recurse=yes '
|
||||
CTAGS_OPT+='--verbose '
|
||||
CTAGS_OPT+='--totals=yes '
|
||||
CTAGS_OPT+='--tag-relative=yes '
|
||||
|
||||
CTAGS_DIR_CFG='.ctags_dir'
|
||||
CTAGS_ROOT="$PWD"
|
||||
if [ ! -f $PWD/$CTAGS_DIR_CFG ]; then
|
||||
GIT_ROOT=$(git top pwd)
|
||||
if [ -f $GIT_ROOT/$CTAGS_DIR_CFG ]; then
|
||||
CTAGS_ROOT="$GIT_ROOT"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f $CTAGS_ROOT/$CTAGS_DIR_CFG ]; then
|
||||
CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR"
|
||||
else
|
||||
CTAGS_SRC="$@"
|
||||
fi
|
||||
|
||||
cd $CTAGS_ROOT
|
||||
$CTAGS $CTAGS_OPT $CTAGS_SRC
|
||||
cd -
|
||||
}
|
||||
|
||||
14
config/.profile.dircolor
Executable file
14
config/.profile.dircolor
Executable file
@@ -0,0 +1,14 @@
|
||||
|
||||
if [ -n "$PS1" ]; then
|
||||
#
|
||||
# Number of colors and standard colors.
|
||||
#
|
||||
c_num=$(tput colors)
|
||||
#
|
||||
# Load better colors for ls.
|
||||
#
|
||||
if [ -x "$(which /bin/dircolors)" -a $c_num -ge 256 -a -f ~/.dir_colors ]; then
|
||||
eval $(dircolors ~/.dir_colors)
|
||||
fi
|
||||
fi
|
||||
|
||||
162
config/.profile.prompt
Executable file
162
config/.profile.prompt
Executable file
@@ -0,0 +1,162 @@
|
||||
if [ -n "$PS1" ]; then
|
||||
function term_colors(){
|
||||
for i in {0..15}; do
|
||||
for j in {0..15}; do
|
||||
c=$((i*16+j));
|
||||
printf " $(tput setab $c)%04d" $c;
|
||||
done;
|
||||
printf "$(tput sgr0)\n";
|
||||
done
|
||||
for i in {0..15}; do
|
||||
for j in {0..15}; do
|
||||
c=$((i*16+j));
|
||||
printf " $(tput setaf $c)%04d" $c;
|
||||
done;
|
||||
printf "$(tput sgr0)\n";
|
||||
done
|
||||
}
|
||||
fi
|
||||
|
||||
#
|
||||
# Prompt if interactive
|
||||
#
|
||||
if [ -n "$PS1" ]; then
|
||||
#
|
||||
# Number of colors and standard colors.
|
||||
#
|
||||
c_num=$(tput colors)
|
||||
|
||||
#
|
||||
# Set better colors if available.
|
||||
#
|
||||
if [ $c_num -ge 256 ]; then
|
||||
c_reset="$(tput sgr0)"
|
||||
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)"
|
||||
c_error="$(tput setaf 203)" #Red
|
||||
c_info="$(tput setaf 220)" #Yellow
|
||||
else
|
||||
c_reset="$(tput sgr0)"
|
||||
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
|
||||
c_error="$(tput setaf 1)" #Red
|
||||
c_info="$(tput setaf 3)" #Yellow
|
||||
fi
|
||||
|
||||
[ ! -z "$(which svn 2> /dev/null )" ] && prompt_check_svn=true
|
||||
[ ! -z "$(which git 2> /dev/null )" ] && prompt_check_git=true
|
||||
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
s_host="%m"
|
||||
s_user="%n"
|
||||
s_cwd="%/"
|
||||
s_time="%t"
|
||||
fi
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
export PROMPT_COMMAND="__prompt_command"
|
||||
s_host="\H"
|
||||
s_user="\u"
|
||||
s_cwd="\w"
|
||||
s_time="\t"
|
||||
# Turn on checkwinsize
|
||||
shopt -s checkwinsize
|
||||
fi
|
||||
# For hg from FB
|
||||
if [ -f /usr/share/scm/scm-prompt.sh ]; then
|
||||
source /usr/share/scm/scm-prompt.sh
|
||||
prompt_check_hg=true
|
||||
elif [ -f /opt/facebook/hg/share/scm-prompt ]; then
|
||||
source /opt/facebook/hg/share/scm-prompt
|
||||
prompt_check_hg=true
|
||||
fi
|
||||
|
||||
# zsh
|
||||
function precmd() {
|
||||
__prompt_command
|
||||
}
|
||||
|
||||
function __prompt_command() {
|
||||
#
|
||||
# get exit code before any command is run. TODO: doesn't work on pi.
|
||||
#
|
||||
local exit_code="$?"
|
||||
prompt_extra=""
|
||||
PS1=""
|
||||
if [ "$USER" != "vahagnk" -a "$USER" != "vahagn" ]; then
|
||||
PS1+="\[${c_user}\]${s_user}@" # username@
|
||||
fi
|
||||
PS1+="\[${c_host}\]${s_host}:" # hostname
|
||||
PS1+="\[${c_time}\]${s_time}" # time
|
||||
PS1+=" \[${c_cwd}\]${s_cwd}" # working_dir
|
||||
#
|
||||
# git branch if exist
|
||||
#
|
||||
if [ -n "$prompt_check_git" ]; then
|
||||
local git_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | tr -d ' ')
|
||||
if [ -n "$git_branch" ]; then
|
||||
PS1+="\[${c_branch}\]@${git_branch}"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# hg branch if exist
|
||||
#
|
||||
if [ -n "$prompt_check_hg" -a -z "$git_branch" ]; then
|
||||
local hg_branch=$(_scm_prompt %s)
|
||||
if [ -n "$hg_branch" ]; then
|
||||
PS1+="\[${c_branch}\]@${hg_branch}"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# svn branch if exist
|
||||
#
|
||||
if [ -n "$prompt_check_svn" ]; then
|
||||
local svn_rev=$(svn info . 2> /dev/null | awk -F ':' '/Revision:/ { print $2 }')
|
||||
if [ -n "$svn_rev" ]; then
|
||||
PS1+="\[${c_branch}\]@${svn_rev}" # svn revision
|
||||
fi
|
||||
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_info}\]bg=${jobs_bg}"
|
||||
fi
|
||||
local jobs_stopped=$(jobs -s | wc -l | tr -d ' ')
|
||||
if [ $jobs_stopped -gt 0 ]; then
|
||||
PS1+=",\[${c_info}\]stp=${jobs_stopped}"
|
||||
fi
|
||||
#
|
||||
# exit code if not zero
|
||||
#
|
||||
if [ "$exit_code" -ne "0" ]; then
|
||||
PS1+=",\[${c_error}\]rc=${exit_code}"
|
||||
fi
|
||||
|
||||
#
|
||||
# Colors should be set here and surrounded with \[\]otherwise bash fails to
|
||||
# calculate prompt length. The text is set through PROMPT_COMMAND
|
||||
PS1+="\[${c_reset}\]\$ " # reset colors and print $
|
||||
}
|
||||
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
# shopt -s checkwinsize
|
||||
export -f __prompt_command
|
||||
export -f term_colors
|
||||
fi
|
||||
fi
|
||||
|
||||
23
config/.ssh/config
Normal file
23
config/.ssh/config
Normal file
@@ -0,0 +1,23 @@
|
||||
Host lusntag
|
||||
HostName lusntag.vostan.org
|
||||
Port 8080
|
||||
User vahagn
|
||||
PreferredAuthentications publickey
|
||||
|
||||
Host yerevak
|
||||
HostName yerevak.vostan.org
|
||||
Port 24
|
||||
User vahagn
|
||||
PreferredAuthentications publickey
|
||||
|
||||
Host hrat
|
||||
HostName 192.168.0.4
|
||||
User vahagn
|
||||
PreferredAuthentications publickey
|
||||
|
||||
Host github.com
|
||||
User vishap
|
||||
Hostname github.com
|
||||
PreferredAuthentications publickey
|
||||
IdentityFile ~/.ssh/id_rsa
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# Ctrl-a is the prefix.
|
||||
#
|
||||
set -g prefix C-a
|
||||
bind C-a send-prefix
|
||||
unbind C-b
|
||||
# unbind C-b
|
||||
# set-option -g prefix C-a
|
||||
# bind-key C-a send-prefix
|
||||
|
||||
# Start windows from #1 (default #0)
|
||||
set -g base-index 1
|
||||
@@ -16,8 +16,9 @@ set -g status-position top
|
||||
set -g history-limit 100000
|
||||
|
||||
# 256color mode.
|
||||
set -g default-terminal "screen-256color"
|
||||
setw -g xterm-keys on
|
||||
#set -g default-terminal "tmux-256color"
|
||||
set -g default-terminal "xterm-256color"
|
||||
# setw -g xterm-keys on
|
||||
|
||||
# VI mode
|
||||
set -g status-keys vi
|
||||
@@ -30,22 +31,28 @@ setw -g mode-keys vi
|
||||
#bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
|
||||
|
||||
#bind p paste-buffer
|
||||
|
||||
bind -n C-1 select-pane -t 1
|
||||
bind -n C-2 select-pane -t 2
|
||||
bind -n C-3 select-pane -t 3
|
||||
bind -n C-4 select-pane -t 4
|
||||
bind -n C-5 select-pane -t 5
|
||||
bind -n C-6 select-pane -t 6
|
||||
bind -n C-7 select-pane -t 7
|
||||
bind -n C-8 select-pane -t 8
|
||||
bind -n C-9 select-pane -t 9
|
||||
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
#bind -r C-h resize-pane -L
|
||||
#bind -r C-j resize-pane -D
|
||||
#bind -r C-k resize-pane -U
|
||||
#bind -r C-l resize-pane -R
|
||||
|
||||
#No mouse
|
||||
#set -g mode-mouse off
|
||||
#set -g mouse-select-pane off
|
||||
#set -g mouse-resize-pane off
|
||||
#set -g mouse-select-window off
|
||||
bind -r M-h resize-pane -L
|
||||
bind -r M-j resize-pane -D
|
||||
bind -r M-k resize-pane -U
|
||||
bind -r M-l resize-pane -R
|
||||
|
||||
# Mouse on/off
|
||||
# bind m \
|
||||
# set -g mode-mouse on \;\
|
||||
# set -g mouse-resize=pane on \;\
|
||||
|
||||
2801
config/.vim/autoload/plug.vim
Normal file
2801
config/.vim/autoload/plug.vim
Normal file
File diff suppressed because it is too large
Load Diff
1
config/.vim/spell/en.utf-8.add
Normal file
1
config/.vim/spell/en.utf-8.add
Normal file
@@ -0,0 +1 @@
|
||||
mv
|
||||
BIN
config/.vim/spell/en.utf-8.add.spl
Normal file
BIN
config/.vim/spell/en.utf-8.add.spl
Normal file
Binary file not shown.
@@ -359,7 +359,7 @@ map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
|
||||
" Grep options affect GNU grep. The intend is that greps not supporting the
|
||||
" options will continue working without options.
|
||||
"
|
||||
let $GREP_OPTIONS.=' --exclude-dir=.git --exclude-dir=.svn'
|
||||
let $GREP_OPTIONS.=' --exclude-dir=.git --exclude-dir=.svn --exclude-dir=.hg'
|
||||
let $GREP_OPTIONS.=' --exclude=tags --exclude=*.o --exclude=*.log'
|
||||
let $GREP_OPTIONS.=' --exclude=*.swp'
|
||||
let $GREP_OPTIONS.=' --exclude-dir=llcalc* --exclude-dir=00*'
|
||||
@@ -388,48 +388,35 @@ noremap <Down> gj
|
||||
"
|
||||
" Working with tabs especially if using console version.
|
||||
"
|
||||
nnoremap th :tabfirst<CR>
|
||||
nnoremap tj :tabnext<CR>
|
||||
nnoremap tk :tabprev<CR>
|
||||
nnoremap tl :tablast<CR>
|
||||
nnoremap tm :tabm<Space>
|
||||
nnoremap td :tabclose<CR>
|
||||
" nnoremap th :tabfirst<CR>
|
||||
" nnoremap tj :tabnext<CR>
|
||||
" nnoremap tk :tabprev<CR>
|
||||
" nnoremap tl :tablast<CR>
|
||||
" nnoremap tm :tabm<Space>
|
||||
" nnoremap td :tabclose<CR>
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Plugins
|
||||
"
|
||||
|
||||
"
|
||||
" Detect Vundle
|
||||
"
|
||||
let s:vundle_path = '~/.vim/bundle/Vundle.vim'
|
||||
if filereadable(expand('C:/devel/scripts/vim/bundle/Vundle.vim/README.md'))
|
||||
let s:vundle_path = 'C:/devel/scripts/vim/bundle/Vundle.vim'
|
||||
endif
|
||||
|
||||
"
|
||||
" Vundle stuff here.
|
||||
"
|
||||
if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
filetype off
|
||||
let &rtp=&rtp.','.s:vundle_path
|
||||
call vundle#begin()
|
||||
Plugin 'VundleVim/Vundle.vim'
|
||||
if filereadable(expand("~/.vim/autoload/plug.vim"))
|
||||
" Specify a directory for plugins
|
||||
" - For Neovim: stdpath('data') . '/plugged'
|
||||
" - Avoid using standard Vim directory names like 'plugin'
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
"
|
||||
" Adds nice status and tabline.
|
||||
"
|
||||
Plugin 'vim-airline/vim-airline'
|
||||
"Plugin 'vim-airline/vim-airline-themes'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#tabline#left_sep = ' '
|
||||
let g:airline#extensions#tabline#left_alt_sep = '|'
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
|
||||
"
|
||||
"
|
||||
"
|
||||
Plugin 'scrooloose/nerdtree'
|
||||
Plug 'scrooloose/nerdtree'
|
||||
let g:NERDTreeQuitOnOpen = 1
|
||||
let g:NERDTreeDirArrows = 1
|
||||
let g:NERDTreeDirArrowExpandable = '+'
|
||||
@@ -440,7 +427,7 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
"
|
||||
" Commented out in favour of NERDTree
|
||||
"
|
||||
"Plugin 'eiginn/netrw'
|
||||
"Plug 'eiginn/netrw'
|
||||
"let g:netrw_altv = 1
|
||||
"let g:netrw_fastbrowse = 2
|
||||
"let g:netrw_keepdir = 0
|
||||
@@ -453,7 +440,7 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
"
|
||||
" Manipulation with buffers and tabs.
|
||||
"
|
||||
Plugin 'vim-scripts/Buffergator'
|
||||
Plug 'vim-scripts/Buffergator'
|
||||
let g:buffergator_autodismiss_on_select = 0
|
||||
let g:buffergator_autoupdate = 1
|
||||
let g:buffergator_suppress_keymaps = 1
|
||||
@@ -476,7 +463,7 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
" cursor (e.g. on <foo.h> switches to foo.cpp)
|
||||
" <Leader>ihn cycles through matches
|
||||
"
|
||||
Plugin 'vim-scripts/a.vim'
|
||||
Plug 'vim-scripts/a.vim'
|
||||
let g:alternateExtensions_h = "cpp,c"
|
||||
let g:alternateExtensions_cpp = "h"
|
||||
let g:alternateExtensions_c = "h"
|
||||
@@ -485,30 +472,31 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
"
|
||||
" Tmux integration.
|
||||
"
|
||||
Plugin 'benmills/vimux'
|
||||
Plug 'benmills/vimux'
|
||||
|
||||
"
|
||||
" Extends modeline to variables.
|
||||
" Needed by CF5 compile to read options right from file.
|
||||
"
|
||||
Plugin 'vim-scripts/let-modeline.vim'
|
||||
Plug 'vim-scripts/let-modeline.vim'
|
||||
"
|
||||
" CF5 compile.
|
||||
" Compiling cpp files without make file.
|
||||
"
|
||||
Plugin 'vishap/cf5-compile'
|
||||
Plug 'vishap/cf5-compile'
|
||||
map <silent> ac :call CF5CompileOnly()<CR>
|
||||
map <silent> ar :call CF5CompileAndRun()<CR>
|
||||
|
||||
"
|
||||
" Provide templates
|
||||
"
|
||||
Plugin 'aperezdc/vim-template'
|
||||
Plug 'aperezdc/vim-template'
|
||||
"let g:templates_no_autocmd = 1
|
||||
let g:templates_no_builtin_templates = 1
|
||||
"
|
||||
" Local vimrc
|
||||
"
|
||||
Plugin 'embear/vim-localvimrc'
|
||||
Plug 'embear/vim-localvimrc'
|
||||
let g:localvimrc_name = [ ".vimrc.local" ]
|
||||
let g:localvimrc_ask = 0
|
||||
|
||||
@@ -516,15 +504,17 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
" Comment code.
|
||||
" gc - visual mode - comment selection.
|
||||
"
|
||||
Plugin 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-surround'
|
||||
" Plug 'tpope/vim-repeat'
|
||||
nmap al <Plug>CommentaryLine
|
||||
vmap al <Plug>Commentary
|
||||
"
|
||||
" Git wrapper.
|
||||
"
|
||||
Plugin 'tpope/vim-fugitive'
|
||||
nmap git :Git
|
||||
nmap gst :Gstatus
|
||||
Plug 'tpope/vim-fugitive'
|
||||
" nmap git :Git
|
||||
" nmap gst :Gstatus
|
||||
"
|
||||
" Shows git diff.
|
||||
" [c - jump prev diff
|
||||
@@ -538,7 +528,7 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
" :GitGutterToggle
|
||||
" :GitGutterLineHighlightsToggle
|
||||
"
|
||||
Plugin 'airblade/vim-gitgutter'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
let g:gitgutter_map_keys = 0
|
||||
let g:gitgutter_realtime = 0
|
||||
let g:gitgutter_eager = 0
|
||||
@@ -547,7 +537,7 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
"
|
||||
" Check syntaxis on fly.
|
||||
"
|
||||
"Plugin 'scrooloose/syntastic'
|
||||
"Plug 'scrooloose/syntastic'
|
||||
"let g:syntastic_cpp_compiler_options = ' -std=c++1y'
|
||||
"let g:syntastic_mode_map = {
|
||||
" \ "mode": "active",
|
||||
@@ -559,29 +549,16 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
" Actual colorscheme is set outside as vundle resets it.
|
||||
"
|
||||
if &t_Co >= 256 || has('gui_running')
|
||||
Plugin 'nanotech/jellybeans.vim'
|
||||
Plug 'nanotech/jellybeans.vim'
|
||||
let g:jellybeans_use_lowcolor_black = 0
|
||||
let g:jellybeans_use_gui_italics = 0
|
||||
"colorscheme jellybeans
|
||||
endif
|
||||
if &t_Co >= 256 || has('gui_running')
|
||||
Plugin 'altercation/vim-colors-solarized.git'
|
||||
let g:solarized_termcolors=256
|
||||
"set backgroung=dark
|
||||
"set backgroung=light
|
||||
"colorscheme solarized
|
||||
endif
|
||||
if &t_Co >= 256 || has('gui_running')
|
||||
Plugin 'morhetz/gruvbox.git'
|
||||
"set backgroung=dark
|
||||
"set backgroung=light
|
||||
"colorscheme solarized
|
||||
endif
|
||||
|
||||
"
|
||||
" :set syntax=cpp.doxygen to highlight doxygen comments.
|
||||
"
|
||||
Plugin 'vim-scripts/DoxyGen-Syntax'
|
||||
Plug 'vim-scripts/DoxyGen-Syntax'
|
||||
"
|
||||
" In vim, place the cursor on the line and
|
||||
" :DoxLic - generates license comment.
|
||||
@@ -591,24 +568,47 @@ if filereadable(expand(s:vundle_path.'/README.md'))
|
||||
" DEBUG.
|
||||
" :DoxBlock -
|
||||
"
|
||||
Plugin 'vim-scripts/DoxygenToolkit.vim'
|
||||
Plug 'vim-scripts/DoxygenToolkit.vim'
|
||||
"
|
||||
" Color table and picker.
|
||||
" :XtermColorTable
|
||||
" press: # to yank, t to toggle, f to set text color
|
||||
"
|
||||
"Plugin 'xterm-color-table.vim'
|
||||
"Plug 'xterm-color-table.vim'
|
||||
|
||||
|
||||
" Promising GDB manager.
|
||||
"
|
||||
Plugin 'vim-scripts/gdbmgr'
|
||||
Plug 'vim-scripts/gdbmgr'
|
||||
|
||||
" Completion
|
||||
"
|
||||
call vundle#end()
|
||||
filetype plugin indent on
|
||||
filetype plugin on
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
" See configuration below
|
||||
Plug 'w0rp/ale'
|
||||
" Set up hack support through vim-hack and ale
|
||||
let g:ale_hack_hack_executable = 'hh'
|
||||
let g:ale_linters = { 'hack': ['hack', 'aurora'] }
|
||||
let g:ale_echo_msg_format = '[%linter%]% [code]% %s'
|
||||
" Set up haskell support though ale
|
||||
" Some suggestions oh how it works.
|
||||
" First start haxlsh with `haxlsh --lsp`
|
||||
" Then start `sigma_lsp` (proxy for the LSP client)
|
||||
" Load the module in haxlsh and voila
|
||||
" Some wiki: https://fburl.com/wiki/grt9tzi1
|
||||
let g:ale_haskell_hie_executable = 'sigma_lsp'
|
||||
" let g:ale_haskell_hie_executable = '/home/nedyalkop/nedy_sigma_lsp'
|
||||
let g:ale_haskell_hdevtools_options = ''
|
||||
" Set up IDE type bindings with ALE
|
||||
nnoremap <leader>K :ALEHover<CR>
|
||||
nnoremap <leader>. :ALEGoToDefinition<CR>
|
||||
nnoremap <leader>fr :ALEFindReferences<CR>
|
||||
|
||||
Plug 'hhvm/vim-hack'
|
||||
Plug 'raichoo/haskell-vim'
|
||||
|
||||
endif
|
||||
call plug#end()
|
||||
|
||||
"
|
||||
" Vundle resets this if set inside vundle section.
|
||||
@@ -621,21 +621,21 @@ endif
|
||||
|
||||
if exists("dddd")
|
||||
|
||||
"Plugin 'Rip-Rip/clang_complete'
|
||||
"Plugin 'flazz/vim-colorschemes'
|
||||
"Plugin 'Valloric/YouCompleteMe'
|
||||
"Plugin 'rhysd/vim-clang-format'
|
||||
Plugin 'vim-scripts/Mark'
|
||||
Plugin 'danro/rename.vim'
|
||||
Plugin 'kana/vim-operator-user'
|
||||
"Plug 'Rip-Rip/clang_complete'
|
||||
"Plug 'flazz/vim-colorschemes'
|
||||
"Plug 'Valloric/YouCompleteMe'
|
||||
"Plug 'rhysd/vim-clang-format'
|
||||
Plug 'vim-scripts/Mark'
|
||||
Plug 'danro/rename.vim'
|
||||
Plug 'kana/vim-operator-user'
|
||||
|
||||
Plugin 'kien/ctrlp.vim'
|
||||
Plug 'kien/ctrlp.vim'
|
||||
let g:ctrlp_root_markers = ['.ctrlp']
|
||||
let g:ctrlp_custom_ignore = {
|
||||
\ 'file': '\v\.(o|d|dd)$',
|
||||
\ }
|
||||
|
||||
Plugin 'majutsushi/tagbar'
|
||||
Plug 'majutsushi/tagbar'
|
||||
map <C-t> :TagbarToggle<CR>
|
||||
let g:tagbar_autoclose = 1
|
||||
let g:tagbar_autofocus = 1
|
||||
@@ -646,19 +646,19 @@ let g:tagbar_sort = 1
|
||||
let g:tagbar_width = 60
|
||||
let g:tagbar_ctags_bin = "/opt/swt/bin/ctags"
|
||||
|
||||
Plugin 'mattn/emmet-vim'
|
||||
Plugin 'tmhedberg/matchit'
|
||||
Plugin 'tpope/vim-dispatch'
|
||||
Plugin 'tpope/vim-unimpaired'
|
||||
Plugin 'vim-scripts/Align'
|
||||
Plugin 'vim-scripts/taglist.vim'
|
||||
Plugin 'vim-scripts/xml.vim'
|
||||
Plugin 'junegunn/vim-easy-align'
|
||||
Plugin 'ntpeters/vim-better-whitespace'
|
||||
Plug 'mattn/emmet-vim'
|
||||
Plug 'tmhedberg/matchit'
|
||||
Plug 'tpope/vim-dispatch'
|
||||
Plug 'tpope/vim-unimpaired'
|
||||
Plug 'vim-scripts/Align'
|
||||
Plug 'vim-scripts/taglist.vim'
|
||||
Plug 'vim-scripts/xml.vim'
|
||||
Plug 'junegunn/vim-easy-align'
|
||||
Plug 'ntpeters/vim-better-whitespace'
|
||||
let g:strip_whitespace_on_save = 1
|
||||
|
||||
"Plugin 'vim-scripts/TagHighlight'
|
||||
"Plugin 'gcmt/taboo.vim'
|
||||
"Plug 'vim-scripts/TagHighlight'
|
||||
"Plug 'gcmt/taboo.vim'
|
||||
"let g:taboo_tab_format = "[%m:%N:%W] %f"
|
||||
|
||||
" - - - - - - - - - - - - - -
|
||||
@@ -667,10 +667,137 @@ let g:strip_whitespace_on_save = 1
|
||||
let g:Powerline_symbols = "unicode"
|
||||
|
||||
" Ack
|
||||
Plugin 'mileszs/ack.vim'
|
||||
Plug 'mileszs/ack.vim'
|
||||
let g:ack_default_options = " --ignore-file=is:tags -s -H --nocolor --nogroup --column"
|
||||
let g:ack_highlight = 1
|
||||
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
||||
"------------------------------------------------------------
|
||||
" COC configuration
|
||||
"
|
||||
if 1
|
||||
" if hidden is not set, TextEdit might fail.
|
||||
" set hidden
|
||||
|
||||
" Some servers have issues with backup files, see #649
|
||||
" set nobackup
|
||||
" set nowritebackup
|
||||
|
||||
" Better display for messages
|
||||
" set cmdheight=2
|
||||
|
||||
" You will have bad experience for diagnostic messages when it's default 4000.
|
||||
set updatetime=300
|
||||
|
||||
" don't give |ins-completion-menu| messages.
|
||||
" set shortmess+=c
|
||||
|
||||
" always show signcolumns
|
||||
set signcolumn=yes
|
||||
" Use tab for trigger completion with characters ahead and navigate.
|
||||
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
|
||||
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
|
||||
" Coc only does snippet and additional edit on confirm.
|
||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
|
||||
" Use `[c` and `]c` to navigate diagnostics
|
||||
nmap <silent> [c <Plug>(coc-diagnostic-prev)
|
||||
nmap <silent> ]c <Plug>(coc-diagnostic-next)
|
||||
|
||||
" Remap keys for gotos
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
nmap <silent> gy <Plug>(coc-type-definition)
|
||||
nmap <silent> gi <Plug>(coc-implementation)
|
||||
nmap <silent> gr <Plug>(coc-references)
|
||||
|
||||
" Use K to show documentation in preview window
|
||||
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||
|
||||
function! s:show_documentation()
|
||||
if (index(['vim','help'], &filetype) >= 0)
|
||||
execute 'h '.expand('<cword>')
|
||||
else
|
||||
call CocAction('doHover')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Highlight symbol under cursor on CursorHold
|
||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||
|
||||
" Remap for rename current word
|
||||
nmap <leader>rn <Plug>(coc-rename)
|
||||
|
||||
" Remap for format selected region
|
||||
xmap <leader>f <Plug>(coc-format-selected)
|
||||
nmap <leader>f <Plug>(coc-format-selected)
|
||||
|
||||
augroup mygroup
|
||||
autocmd!
|
||||
" Setup formatexpr specified filetype(s).
|
||||
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
|
||||
" Update signature help on jump placeholder
|
||||
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
||||
augroup end
|
||||
|
||||
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
|
||||
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
|
||||
" Remap for do codeAction of current line
|
||||
nmap <leader>ac <Plug>(coc-codeaction)
|
||||
" Fix autofix problem of current line
|
||||
nmap <leader>qf <Plug>(coc-fix-current)
|
||||
|
||||
" Use <tab> for select selections ranges, needs server support, like: coc-tsserver, coc-python
|
||||
nmap <silent> <TAB> <Plug>(coc-range-select)
|
||||
xmap <silent> <TAB> <Plug>(coc-range-select)
|
||||
xmap <silent> <S-TAB> <Plug>(coc-range-select-backword)
|
||||
|
||||
" Use `:Format` to format current buffer
|
||||
command! -nargs=0 Format :call CocAction('format')
|
||||
|
||||
" Use `:Fold` to fold current buffer
|
||||
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
||||
|
||||
" use `:OR` for organize import of current buffer
|
||||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
||||
|
||||
" Add status line support, for integration with other plugin, checkout `:h coc-status`
|
||||
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
||||
|
||||
" Using CocList
|
||||
" Show all diagnostics
|
||||
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
||||
" Manage extensions
|
||||
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
||||
" Show commands
|
||||
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
||||
" Find symbol of current document
|
||||
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
||||
" Search workspace symbols
|
||||
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
||||
" Do default action for next item.
|
||||
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||||
" Do default action for previous item.
|
||||
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||||
" Resume latest coc list
|
||||
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
||||
endif
|
||||
5
git/.aspell.en_US.per
Normal file
5
git/.aspell.en_US.per
Normal file
@@ -0,0 +1,5 @@
|
||||
personal_ws-1.1 en 0
|
||||
FAXM
|
||||
BLOT
|
||||
Lakos
|
||||
Vundle
|
||||
44
git/hooks/commit-msg
Executable file
44
git/hooks/commit-msg
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/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 | head -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:"
|
||||
#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
|
||||
|
||||
44
git/hooks/prepare-commit-msg
Executable file
44
git/hooks/prepare-commit-msg
Executable file
@@ -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
|
||||
51
git/setup-upstream.sh
Executable file
51
git/setup-upstream.sh
Executable file
@@ -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
|
||||
|
||||
|
||||
27
install.sh
Executable file
27
install.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -z "$1" ]; then
|
||||
SCRIPTS=$1
|
||||
else
|
||||
SCRIPTS=${HOME}/devel/scripts
|
||||
fi
|
||||
|
||||
find ${SCRIPTS}/config -maxdepth 1 -name .\* -type f -exec ln -i \{\} . \;
|
||||
find ${SCRIPTS}/config -maxdepth 1 -name .\* -type d x ln -i -s \{\} . \;
|
||||
|
||||
#mkdir -p .vim/autoload .vim/bundle
|
||||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
# curl -LSso .vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
|
||||
# git clone https://github.com/VundleVim/Vundle.vim.git .vim/bundle/Vundle.vim
|
||||
|
||||
|
||||
#
|
||||
# Add .bashrc.vahagn to .bashrc
|
||||
#
|
||||
grep .bashrc.vahagn .bashrc
|
||||
if [ $? != 0 ]; then
|
||||
printf "# Load Vahagn's standard environment.\n"
|
||||
printf "[ -f ~/.bashrc.vahagn ] && source ~/.bashrc.vahagn\n" >> .bashrc
|
||||
printf "[ -f ~/.bashrc.local ] && source ~/.bashrc.local\n" >> .bashrc
|
||||
fi
|
||||
161
local/bb/.bashrc.local
Executable file
161
local/bb/.bashrc.local
Executable file
@@ -0,0 +1,161 @@
|
||||
#!/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
|
||||
|
||||
#export DEV_CINC=-I.
|
||||
#export DEV_CPPINC=-I.
|
||||
#export DEV_FINC=-I.
|
||||
|
||||
#I need this to run distributor locally.
|
||||
export PGPASSFILE=$HOME/.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/
|
||||
export PIP_INDEX_URL=https://artprod.dev.bloomberg.com/artifactory/api/pypi/bloomberg-pypi/simple
|
||||
|
||||
alias bb='cd $HOME/bb >/dev/null'
|
||||
complete -W "build clean build_all clean_all dpkg install default all" 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 trunk --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
|
||||
}
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
use-local-distro(){
|
||||
unset DPKG_ARCH
|
||||
unset DPKG_DISTRO_DIR
|
||||
}
|
||||
|
||||
#
|
||||
#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
|
||||
|
||||
|
||||
48
local/bb/.vimrc.lib
Executable file
48
local/bb/.vimrc.lib
Executable file
@@ -0,0 +1,48 @@
|
||||
let g:srcdir="/home/vkhachatrya5/devel/src"
|
||||
|
||||
"
|
||||
" STL
|
||||
"
|
||||
"let &path.=",".g:tbbinc
|
||||
|
||||
"
|
||||
" BOOST
|
||||
"
|
||||
let g:boostdir=g:srcdir."/boost"
|
||||
let g:boostinc=g:boostdir
|
||||
let g:boostlib=g:boostdir."/stage/lib"
|
||||
let g:boostbin=g:boostlib
|
||||
let g:Bboost=g:boostbin.":"
|
||||
let g:Iboost=" -I".g:boostinc
|
||||
let g:Lboost=" -L".g:boostlib
|
||||
let g:boost=g:Iboost.g:Lboost
|
||||
let &path.=",".g:boostinc
|
||||
"
|
||||
" Intel TBB
|
||||
"
|
||||
let g:tbbdir=g:srcdir."/tbb"
|
||||
let g:tbbinc=g:tbbdir."/include"
|
||||
let g:tbblib=g:tbbdir."/build/linux_intel64_gcc_cc4.8.2_libc2.5_kernel2.6.18_release"
|
||||
let g:tbbbin=g:tbblib
|
||||
let g:Itbb=" -I".g:tbbinc
|
||||
let g:Ltbb=" -L".g:tbblib." -ltbb"
|
||||
let g:tbbmalloc=" -ltbbmalloc"
|
||||
let g:tbbmproxy=" -ltbbmalloc_proxy"
|
||||
let g:tbb=g:Itbb.g:Ltbb
|
||||
let &path.=",".g:tbbinc
|
||||
"
|
||||
" Robo
|
||||
"
|
||||
let g:robodir="/bb/build/Linux-x86_64-64/release/robolibs/stage/dpkgroot/opt/bb/include"
|
||||
let g:roboinc=g:robodir."/include"
|
||||
let g:robolib=g:robodir."/lib64"
|
||||
let g:Ibb=" -I".g:roboinc
|
||||
let g:Lbb=" -L".g:robolib
|
||||
let g:bb=g:Ibb.g:Lbb
|
||||
let &path.=",".g:roboinc
|
||||
|
||||
|
||||
"
|
||||
" Append library paths to LD_LIBRARY_PATH
|
||||
"
|
||||
"let $LD_LIBRARY_PATH .= ':'.g:boostlib.':'.g:tbblib
|
||||
31
local/bb/.vimrc.local
Executable file
31
local/bb/.vimrc.local
Executable file
@@ -0,0 +1,31 @@
|
||||
set expandtab
|
||||
set visualbell
|
||||
" Uncomment below to make screen not flash on error
|
||||
set vb t_vb=""
|
||||
set wildignore+=*.o,*.obj,*.bak,*.exe,*.tsk,*.d,*.dd
|
||||
|
||||
"set path=.,/usr/include,/usr/include/c++/4.4.4,../,../../src,../src,./src
|
||||
set path=.,/usr/include,../../src,../src,./src
|
||||
set path+=/bb/build/SunOS-sparc-32/release/robolibs/stage/dpkgroot/opt/bb/include/stlport
|
||||
set path+=/bb/build/SunOS-sparc-32/release/robolibs/stage/opt/bb/include/
|
||||
set path+=/bb/build/SunOS-sparc-32/release/robolibs/stage/opt/bb/include/00depbuild
|
||||
set path+=/bb/build/SunOS-sparc-32/release/robolibs/stage/opt/bb/include/00deployed
|
||||
set path+=/bb/build/SunOS-sparc-32/release/robolibs/stage/opt/bb/include/00offlonly
|
||||
set path+=/bb/build/share/stp/include/00offlonly
|
||||
set path+=/bbsrc/thirdparty/bbit/include
|
||||
set path+=/bb/build/SunOS-sparc-32/release/robolibs/stage/dpkgroot/opt/bb/include/
|
||||
|
||||
set tags+=tags
|
||||
set tags+=./tags
|
||||
set tags+=../tags
|
||||
set tags+=../../tags
|
||||
"set tags+=../../../tags
|
||||
"set tags+=../../../../tags
|
||||
"set tags+=~/devel/bb/bbsrc/tags/all.tags
|
||||
|
||||
"for t in split(glob('~/devel/bb/bbsrc/tags/*.tags'), '\n')
|
||||
" exec "set tags+=".t
|
||||
"endfor
|
||||
|
||||
autocmd FileType make set noexpandtab
|
||||
|
||||
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
|
||||
}
|
||||
@@ -6,26 +6,15 @@
|
||||
insteadOf = https://bbgithub.dev.bloomberg.com
|
||||
|
||||
[http "https://github.com"]
|
||||
proxy = http://proxy.bloomberg.com:81
|
||||
sslCAinfo = /usr/local/share/ca-certificates/bloomberg-root-ca.crt
|
||||
|
||||
[url "https://github.com/"]
|
||||
insteadOf = github.com:
|
||||
[url "https://github.com/"]
|
||||
insteadOf = git@github.com:
|
||||
[url "https://github.com/"]
|
||||
insteadOf = ssh://git@github.com/
|
||||
proxy = socks5://127.0.0.1:1080
|
||||
#proxy = http://proxy.bloomberg.com:81
|
||||
#sslCAinfo = /usr/local/share/ca-certificates/bloomberg-root-ca.crt
|
||||
|
||||
[http "https://gitlab.com"]
|
||||
proxy = http://proxy.bloomberg.com:81
|
||||
sslCAinfo = /usr/local/share/ca-certificates/bloomberg-root-ca.crt
|
||||
|
||||
[url "https://gitlab.com/"]
|
||||
insteadOf = gitlab.com:
|
||||
[url "https://gitlab.com/"]
|
||||
insteadOf = git@gitlab.com:
|
||||
[url "https://gitlab.com/"]
|
||||
insteadOf = ssh://git@gitlab.com/
|
||||
proxy = socks5://127.0.0.1:1080
|
||||
#proxy = http://proxy.bloomberg.com:81
|
||||
#sslCAinfo = /usr/local/share/ca-certificates/bloomberg-root-ca.crt
|
||||
|
||||
[http "http://192.168.0.4:8080"]
|
||||
proxy = socks5://127.0.0.1:1080
|
||||
|
||||
|
||||
72
local/bb_local_dev/.ssh/config
Normal file
72
local/bb_local_dev/.ssh/config
Normal file
@@ -0,0 +1,72 @@
|
||||
# Note that value for 'User' must be 'git'.
|
||||
Host bbgithub bbgithub.dev.bloomberg.com
|
||||
HostName bbgithub.dev.bloomberg.com
|
||||
IdentityFile ~/.ssh/bbgithub
|
||||
User git
|
||||
UserKnownHostsFile /dev/null
|
||||
StrictHostKeyChecking no
|
||||
|
||||
Host github.com
|
||||
User vishap
|
||||
Hostname github.com
|
||||
PreferredAuthentications publickey
|
||||
IdentityFile ~/.ssh/id_rsa_home
|
||||
ProxyCommand=nc -X 5 -x localhost:1080 %h %p
|
||||
|
||||
|
||||
Host lusntag
|
||||
HostName lusntag.vostan.org
|
||||
Port 8080
|
||||
PreferredAuthentications publickey
|
||||
IdentityFile ~/.ssh/id_rsa_home
|
||||
User vahagn
|
||||
ProxyCommand=nc -X 5 -x localhost:1080 %h %p
|
||||
|
||||
Host yerevak
|
||||
HostName yerevak.vostan.org
|
||||
Port 24
|
||||
PreferredAuthentications publickey
|
||||
IdentityFile ~/.ssh/id_rsa_home
|
||||
User vahagn
|
||||
ProxyCommand=nc -X 5 -x localhost:1080 %h %p
|
||||
|
||||
|
||||
Host hrat
|
||||
HostName 192.168.0.4
|
||||
PreferredAuthentications publickey
|
||||
IdentityFile ~/.ssh/id_rsa_home
|
||||
User vahagn
|
||||
ProxyCommand=nc -X 5 -x localhost:1080 %h %p
|
||||
|
||||
Host gitlab
|
||||
HostName 192.168.0.4
|
||||
PreferredAuthentications publickey
|
||||
IdentityFile ~/.ssh/id_rsa_home
|
||||
User vahagn
|
||||
Port 8022
|
||||
|
||||
Host gitea
|
||||
HostName 192.168.0.4
|
||||
PreferredAuthentications publickey
|
||||
IdentityFile ~/.ssh/id_rsa_home
|
||||
User vahagn
|
||||
Port 222
|
||||
|
||||
Host *
|
||||
AddKeysToAgent yes
|
||||
IdentitiesOnly yes
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile /dev/null
|
||||
|
||||
Host v5dev v5devgateway.bdns.bloomberg.com
|
||||
ControlMaster auto
|
||||
ControlPersist 8h
|
||||
IdentityFile ~/.ssh/id_rsa.openssh
|
||||
ControlPath /tmp/%r@%h-%p
|
||||
Port 22
|
||||
|
||||
Host *.bloomberg.com !bbgithub.dev.bloomberg.com !v5prqsgateway.bdns.bloomberg.com
|
||||
ControlPath /tmp/%r@%h-%p
|
||||
ControlMaster auto
|
||||
ControlPersist 24h
|
||||
|
||||
4
local/fb_dev/.gitconfig.local
Normal file
4
local/fb_dev/.gitconfig.local
Normal file
@@ -0,0 +1,4 @@
|
||||
[http "https://github.com"]
|
||||
proxy = https://fwdproxy:8082
|
||||
proxySSLCert=/var/facebook/credentials/vahagnk/x509/vahagnk.pem
|
||||
proxySSLKey=/var/facebook/credentials/vahagnk/x509/vahagnk.pem
|
||||
7
local/fb_dev/ssh_config
Normal file
7
local/fb_dev/ssh_config
Normal file
@@ -0,0 +1,7 @@
|
||||
Host github.com
|
||||
HostName github.com
|
||||
User vishap
|
||||
IdentityFile ~/.ssh/id_rsa_github
|
||||
ProxyCommand=fwdproxy_ssh_proxy %h %p
|
||||
ServerAliveInterval 300
|
||||
PreferredAuthentications publickey
|
||||
@@ -1,3 +0,0 @@
|
||||
[user]
|
||||
email = vahagn.khachatryan@gmail.com
|
||||
name = Vahagn Khachatryan
|
||||
@@ -1,22 +0,0 @@
|
||||
# Automatically generated by systemd-sysv-generator
|
||||
|
||||
[Unit]
|
||||
#SourcePath=/etc/init.d/rpcbind
|
||||
Description=SSH SOCKS5 to yerevak.vostan.org
|
||||
#DefaultDependencies=no
|
||||
Before=shutdown.target
|
||||
After=network-online.target local-fs.target
|
||||
Wants=network-online.target
|
||||
Conflicts=shutdown.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=vahagn
|
||||
Group=vahagn
|
||||
Restart=always
|
||||
RestartSec=2s
|
||||
WorkingDirectory=/tmp
|
||||
ExecStart=/usr/bin/ssh -N -D 0.0.0.0:1080 -i /home/vahagn/.ssh/id_rsa vahagn@yerevak.vostan.org
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,20 +0,0 @@
|
||||
# Automatically generated by systemd-sysv-generator
|
||||
|
||||
[Unit]
|
||||
Description=tun0 to SOCKS5 tunel
|
||||
Before=shutdown.target
|
||||
After=network-online.target local-fs.target
|
||||
Wants=network-online.target ssh_socks5.service
|
||||
Conflicts=shutdown.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
GuessMainPID=no
|
||||
RemainAfterExit=yes
|
||||
WorkingDirectory=/tmp
|
||||
ExecStartPre=/usr/local/sbin/tun2socks_pre.sh
|
||||
ExecStart=/sbin/ip netns exec soghancq /usr/local/sbin/tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:1080 --udpgw-remote-server-addr 127.0.0.1:7300
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
NETNS=soghancq
|
||||
IP=/sbin/ip
|
||||
NS="$IP netns exec $NETNS"
|
||||
|
||||
#
|
||||
# Set ip forwarding.
|
||||
# Do it from /ete/sysctl.conf
|
||||
#sysctl -w net.ipv4.ip_forward=1
|
||||
|
||||
#
|
||||
# Create network namesapce.
|
||||
#
|
||||
$IP netns add $NETNS
|
||||
|
||||
#
|
||||
# Peer to peer to default namespace.
|
||||
#
|
||||
$IP link add veth0 type veth peer name veth1
|
||||
$IP addr add 10.1.1.1/30 dev veth0
|
||||
$IP link set veth0 up
|
||||
|
||||
$IP link set veth1 netns $NETNS
|
||||
$NS $IP addr add 10.1.1.2/30 dev veth1
|
||||
$NS $IP link set veth1 up
|
||||
$NS $IP route add 127.0.0.0/24 via 10.1.1.1 metric 5
|
||||
$NS $IP route add 192.168.0.0/24 via 10.1.1.1 metric 5
|
||||
#$NS $IP route add 8.8.8.8 via 10.1.1.1 metric 5
|
||||
|
||||
#
|
||||
# Configure tun0 which goes through socks5.
|
||||
#
|
||||
$NS $IP tuntap add dev tun0 mode tun user root
|
||||
$IP link set tun0 netns $NETNS
|
||||
$NS $IP addr add 10.0.0.1/24 dev tun0
|
||||
$NS $IP link set dev tun0 up
|
||||
$NS $IP route add default via 10.0.0.2 metric 6
|
||||
#$NS /usr/local/sbin/tun2socks \
|
||||
# --tundev tun0 \
|
||||
# --netif-ipaddr 10.0.0.2 \
|
||||
# --netif-netmask 255.255.255.0 \
|
||||
# --socks-server-addr 127.0.0.1:1080 \
|
||||
# --udpgw-remote-server-addr 127.0.0.1:7300 &
|
||||
|
||||
Submodule vim/bundle/Vundle.vim deleted from 9a38216a1c
Reference in New Issue
Block a user