From f13e6c0788c81078e0491d54e45e92f4be35dcac Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 4 Apr 2023 10:32:58 -0400 Subject: [PATCH 1/3] usmidsap01 current state --- .bashrc | 26 ++++++++++++++++++++++++-- .gitconfig | 5 ++++- .psqlrc | 1 + .tmux.conf | 3 +++ .vimrc | 24 ++++++++++++++++++++---- 5 files changed, 52 insertions(+), 7 deletions(-) diff --git a/.bashrc b/.bashrc index a9a41cd..5469be0 100644 --- a/.bashrc +++ b/.bashrc @@ -91,6 +91,8 @@ fi alias ll='ls -alFh' alias la='ls -A' alias l='ls -CF' +#alias lb='lsblk -o+FSTYPE,FSAVAIL,FSUSED,FSUSE%,MODEL,UUID' +alias lb='lsblk -o+FSTYPE,FSAVAIL,FSUSED,FSUSE%,MODEL' # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert @@ -119,8 +121,7 @@ fi EDITOR=/usr/bin/vim.basic PAGER="less" LESS="-S" -export PG="psql -U ptrowbridge -d ubm -p 54329 -h hptrow.me" -export PGD="psql -U ptrowbridge -d ubm -p 54339 -h hptrow.me" +export PG="psql -U ptrowbridge -d ubm -p 5432 -h 10.56.60.254" export PSQL_PAGER="pspg" # GOPATH=$HOME/go @@ -130,4 +131,25 @@ export PSQL_PAGER="pspg" # if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then # PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" # fi +if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then + GIT_PROMPT_ONLY_IN_REPO=1 + source $HOME/.bash-git-prompt/gitprompt.sh +fi +export JAVA_HOME=/opt/jdk-19.0.1 +export PATH=$PATH:$JAVA_HOME/bin +export PATH=$PATH:/opt/gradle/gradle-7.6/bin +export RUNNER_PATH=/opt/runner/ +export DB2PW=qqqx53@048 +export PGPW=qqqx53!030 + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +alias opg="lsof +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g'" +#alias opg="lsof +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r realpath" +alias osw="lsof +D . | awk '\$NF ~ /swp$/ {print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g'" +alias xpg="lsof +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f" +alias xsw="lsof +D . | grep '.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f" +alias gl="git log --graph" diff --git a/.gitconfig b/.gitconfig index 9bd7790..3eb4851 100644 --- a/.gitconfig +++ b/.gitconfig @@ -2,7 +2,7 @@ email = paul@hptrow.me name = Paul Trowbridge [core] - autocrlf = false + autocrlf = true editor = vim [push] default = simple @@ -14,3 +14,6 @@ pretty = format:'%C(yellow)%h %Cred%ad %Cblue%an %Cgreen%d %Creset%s' [diff] tool = vimdiff +[safe] + directory = /opt/forecast_api/ + directory = /opt/forecast_api diff --git a/.psqlrc b/.psqlrc index 12d875d..666c846 100644 --- a/.psqlrc +++ b/.psqlrc @@ -1,3 +1,4 @@ -- Switch pagers with :x and :xx commands \set x '\\setenv PAGER ''less -S''' \set xx '\\setenv PAGER \'pspg -bX --no-mouse\'' +\timing on diff --git a/.tmux.conf b/.tmux.conf index ed27168..4d3ea83 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -9,6 +9,9 @@ set -g mouse on #plugin manager for install tmux-resurrect set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'jimeh/tmux-themepack' +set -g @tmux-themepack 'powerline/default/cyan' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' + diff --git a/.vimrc b/.vimrc index 9ba8895..765325d 100644 --- a/.vimrc +++ b/.vimrc @@ -24,7 +24,8 @@ map h map l let NERDTreeShowHidden=1 set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab -colorscheme desert +"colorscheme ron +colorscheme pablo syntax on set splitright set splitbelow @@ -37,9 +38,9 @@ let g:netrw_altv = 1 let g:netrw_winsize = 25 "----airline tabs for buffers------- let g:airline#extensions#tabline#enabled = 1 -let g:airline_theme = 'dark' -let g:tmuxline_powerline_separators = 0 -let g:airline_powerline_fonts = 0 +let g:airline_theme = 'sierra' +let g:tmuxline_powerline_separators = 1 +let g:airline_powerline_fonts = 1 let mapleader = ";" set showcmd map a :bn @@ -59,9 +60,24 @@ set mouse=a set visualbell set t_vb= nnoremap \\ :noh " Clear higlighting +set nowrap "nnoremap :noh " Resize windows nnoremap 5+ nnoremap 5- nnoremap 10> nnoremap 10< +"----------funcion to comment out every line except current--------------- +function! CommentOutUnselectedLines() + let l:highlighted_lines = sort(getpos("'<")[1], getpos("'>")[1]) + let l:line_count = line("$") + let l:comment_char = "--" + + for l:line_number in range(1, l:line_count) + if index(l:highlighted_lines, l:line_number) == -1 + execute l:line_number . "s/^/" . l:comment_char . "/" + endif + endfor +endfunction + +nnoremap cc :call CommentOutUnselectedLines() From 7e1380cee3e8952bb1edf0001593c927b56bc3be Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 10 Apr 2023 09:13:21 -0400 Subject: [PATCH 2/3] dont pipe to paper --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 313e2fc..95ecb16 100644 --- a/.bashrc +++ b/.bashrc @@ -98,7 +98,7 @@ alias osw="lsof 2>/dev/null +D . | awk '\$NF ~ /swp$/ {print \$9}' | sed 's/\.sw alias xpg="lsof 2>/dev/null +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f" alias xsw="lsof 2>/dev/null +D . | grep '.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f" alias ons='lsof +D ~/.local/state/nvim/swap/ | grep -o "/swap/.*" | cut -c 7- | tr "%" "/" | sed "s/\\.swp$//" | grep "$(pwd)"' -alias xns='lsof +D ~/.local/state/nvim/swap/ | grep -o "/swap/.*" | cut -c 7- | tr "%" "/" | sed "s/\\.swp$//" | grep "$(pwd)" | fzf | xargs -I % $PG -f % | pspg' +alias xns='lsof +D ~/.local/state/nvim/swap/ | grep -o "/swap/.*" | cut -c 7- | tr "%" "/" | sed "s/\\.swp$//" | grep "$(pwd)" | fzf | xargs -I % $PG -f %' alias mns='fzf | xargs -I {} sqlcmd.exe -S usmidsql01 -i {}' alias nv='~/nvim-linux64/bin/nvim' alias gs='git status' From 94c6854b3fcf87030f01a6ec7a8346a17c82a956 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 11 Apr 2023 11:15:18 -0400 Subject: [PATCH 3/3] create local template --- .bashrc_local_example | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .bashrc_local_example diff --git a/.bashrc_local_example b/.bashrc_local_example new file mode 100644 index 0000000..58d870c --- /dev/null +++ b/.bashrc_local_example @@ -0,0 +1,9 @@ +#export IPTOKEN= +#export PG="psql -U ptrowbridge -d ubm -p 5432 -h usmidsap01" +#export MS="sqlcmd.exe -S mid-sql02 -i" +#export JAVA_HOME=/opt/jdk-19.0.1 +#export PATH=$PATH:$JAVA_HOME/bin +#export PATH=$PATH:/opt/gradle/gradle-7.6/bin +#export RUNNER_PATH=/opt/runner/ +#export DB2PW= +#export PGPW=