From a9d2788183bbd8b3d9ae019aa175c5741495ebc9 Mon Sep 17 00:00:00 2001 From: iMilad Date: Thu, 25 Jul 2019 09:32:45 +0200 Subject: [PATCH 1/5] Automated installation script --- .aliases.symlink | 299 ++++++++++++++++++++++++++++++++++++++++++++ .ideavimrc.symlink | 32 +++++ .vimrc.symlink | 264 ++++++++++++++++++++++++++++++++++++++ .zshenv.symlink | 1 + .zshrc.symlink | 43 +++++++ install-dotfiles.sh | 48 +++++++ 6 files changed, 687 insertions(+) create mode 100644 .aliases.symlink create mode 100644 .ideavimrc.symlink create mode 100644 .vimrc.symlink create mode 100644 .zshenv.symlink create mode 100644 .zshrc.symlink create mode 100644 install-dotfiles.sh diff --git a/.aliases.symlink b/.aliases.symlink new file mode 100644 index 0000000..e0fb988 --- /dev/null +++ b/.aliases.symlink @@ -0,0 +1,299 @@ +# unix +alias c='cat' +alias le='less -j4' +alias chex='chmod +x' +alias cpr='cp -r' +alias rr='rm -Rf' +alias mn='mv -vn' +alias txf='tar -xf' +alias v='vim' +ialias vi='vim' +alias uz='unzip' +alias uzl='unzip -l' +ialias tree='tree -a -I ".svn|.git|.hg|.idea"' +alias tree2='tree -L 2' +alias tree3='tree -L 3' +alias fn='find . -name "*' +alias ff='find . -name "*.' +alias h='hash -rf' +alias sz='source ~/.zshrc' +alias hx='hexdump -C' +alias k9='kill -9' +alias k15='kill -s 15' +alias w1='watch -n 1' + +# desktop +alias xauto='xrandr --auto' + +# executables +alias cs='create-script' +alias ij='start-intellij' +balias se='session-' +alias acd='asciidoctor' +alias ti='timer' +alias tmzs='timezones' +alias dea='direnv allow' +alias dee='direnv edit' +ialias curl='curl --silent --show-error' +balias clh='curl localhost:' +balias clh8='curl localhost:8080' +balias clh9='curl localhost:9080' +balias c100='curl 192.168.99.100:' +ialias cal='cal -y --monday' + +# network +alias wi='sudo wifi-menu' +alias p1='ping 1.1.1.1' +alias p192='ping 192.168.1.1' +alias p8='ping 8.8.8.8' +alias p9='ping 9.9.9.9' + +# system +alias tmz='sudo timedatectl set-timezone' + +# mvn +alias mvv='mvn -v' +alias mci='mvn clean install' +alias mciT='mvn clean install -DskipTests' +alias mcd='mvn clean deploy' +alias mcdT='mvn clean deploy -DskipTests' +alias mp='mvn package' +alias mpT='mvn package -DskipTests' +alias mcp='mvn clean package' +alias mcpT='mvn clean package -DskipTests' +alias mit='mvn test-compile failsafe:integration-test failsafe:verify' +alias mc='mvn clean' +alias mct='mvn clean test' +alias mgs='mvn generate-sources' +alias mrr='mvn release:prepare release:perform -DperformRelease=true -DignoreSnapshots=false' +alias mgat='mvn io.gatling:gatling-maven-plugin:execute' + +# git +alias gs='git show' +alias gt='git tag' +alias gupd='git update' +alias ggpusht='git push origin $(git_current_branch) --tags' +alias ggpushf='git push origin $(git_current_branch) --force' +alias ggpushtf='git push origin $(git_current_branch) --tags --force' +alias ggpushft='git push origin $(git_current_branch) --tags --force' +alias ggpull='git pull --rebase origin $(git_current_branch)' +alias ggpp='git pull --rebase origin $(git_current_branch) && git push origin $(git_current_branch)' +alias gg='git graph' +alias gsts='git stash save' +alias grget='git remote get-url origin' +alias gpr='hub pull-request' +alias gci='hub issue create' + +# svn +alias svu='svn update' +alias svs='svn status' +alias svi='svn info' + +# docker +alias dk='docker' +alias dkp='docker ps' +alias dkpa='docker ps -a' +alias dkpaq='docker ps -a -q' +alias dkb='docker build -t' +alias dkbnc='docker build --no-cache -t' +alias dkr='docker run --rm' +alias dkrti='docker run --rm -ti' +alias dkrd='docker run -d' +alias dkrp8='docker run --rm -p 8080:8080' +alias dkrp9='docker run --rm -p 9080:9080' +alias dks='docker start' +alias dkt='docker stop' +alias dktt='docker stop $(docker ps -q)' +alias dkk='docker kill' +alias dkrm='docker rm' +alias dkri='docker rmi' +alias dke='docker exec -ti' +alias dkl='docker logs -f' +alias dki='docker images' +alias dkpu='docker pull' +alias dkph='docker push' +alias dkin='docker inspect' +alias dkn='docker network' +alias dkc='docker-compose' +alias dkcu='docker-compose up' +alias dkclean='docker ps -q -a -f status=exited | xargs -r docker rm && docker images -q -f dangling=true | xargs -r docker rmi' + +# kubernetes +alias kc='kubectl' +alias kcg='kubectl get' +alias kcgn='kubectl get --namespace' +alias kcd='kubectl describe' +alias kcdn='kubectl describe --namespace' +alias kcdl='kubectl delete' +alias kcdln='kubectl delete --namespace' +alias kcdlp='kubectl-delete-pod' +alias kcgno='kubectl get nodes' +alias kcgp='kubectl get pods' +alias kcgpn='kubectl get pods --namespace' +alias kcgpp='kubectl get pods --all-namespaces' +alias kcgd='kubectl get deployments' +alias kcgdn='kubectl get deployments --namespace' +alias kcgdd='kubectl get deployments --all-namespaces' +alias kcgs='kubectl get services' +alias kcgsn='kubectl get services --namespace' +alias kcgss='kubectl get services --all-namespaces' +alias kcgi='kubectl get ingresses' +alias kcgin='kubectl get ingresses --namespace' +alias kcgii='kubectl get ingresses --all-namespaces' +alias kcgc='kubectl get configmaps' +alias kcgcn='kubectl get configmaps --namespace' +alias kcgcc='kubectl get configmaps --all-namespaces' +alias kcgv='kubectl get virtualservices' +alias kcgvn='kubectl get virtualservices --namespace' +alias kcgvv='kubectl get virtualservices --all-namespaces' +alias kcgdr='kubectl get destinationrules' +alias kcgdrn='kubectl get destinationrules --namespace' +alias kcgdrr='kubectl get destinationrules --all-namespaces' +alias kcgg='kubectl get gateways' +alias kcggn='kubectl get gateways --namespace' +alias kcggg='kubectl get gateways --all-namespaces' +alias kcgse='kubectl get serviceentries' +alias kcgsen='kubectl get serviceentries --namespace' +alias kcgsee='kubectl get serviceentries --all-namespaces' +alias kcgr='kubectl get routerules' +alias kcgrn='kubectl get routerules --namespace' +alias kcgrr='kubectl get routerules --all-namespaces' +alias kcgdp='kubectl get destinationpolicies' +alias kcgdpn='kubectl get destinationpolicies --namespace' +alias kcgdpp='kubectl get destinationpolicies --all-namespaces' +alias kcge='kubectl get events --sort-by=".lastTimestamp" --all-namespaces --watch' +alias kcc='kubectl create' +alias kccn='kubectl create --namespace' +alias kca='kubectl apply -f' +alias kcan='kubectl apply -f --namespace' +alias kce='kubectl exec -t -i' +alias kcen='kubectl exec -t -i --namespace' +alias kcl='kubectl logs -f' +alias kcll='kubectl-logs' +alias kcln='kubectl logs -f --namespace' +alias kcgx='kubectl config get-contexts' +alias kcux='kubectl config use-context' +alias kcxsn='kubectl config set-context $(kubectl config current-context) --namespace' +alias kcpf='kubectl port-forward' +alias kcpfg='kubectl-port-forward-grafana' +alias kcpfj='kubectl-port-forward-jaeger' +alias kcpfk='kubectl-port-forward-kiali' +alias kcpfp='kubectl-port-forward-prometheus' +alias kcpfz='kubectl-port-forward-zipkin' +alias kcdldr='kubectl-delete-default-resources' +alias kcii='kubectl-ingress-ip-address' +alias kcni='kubectl-nginx-ip-address' +alias kcigip='kubectl-istio-gateway-ip-address' +alias kcignp='kubectl-istio-gateway-http-nodeport' + +# istio +alias ic='istioctl' +alias icg='istioctl get' +alias icc='istioctl create -f' +alias icr='istioctl replace -f' +alias icdl='istioctl delete' +alias icij='istioctl kube-inject -f' + +# minikube +alias mks='minikube start' +alias mkt='minikube stop' + +# ibmcloud +# ib -> ibmcloud +# ik -> ibmcloud kubernetes (cs) +# ikr -> ibmcloud container registry (cr) +alias ib='ibmcloud' +alias ibl='ibmcloud login' +alias ibls='ibmcloud login --sso' +alias ik='ibmcloud cs' +alias ikc='ibmcloud cs cluster' +alias ikgc='ibmcloud cs clusters' +alias ikac='ibmcloud-add-cluster' +alias ikdlc='ibmcloud cs cluster-rm' +alias ikgw='ibmcloud cs workers' +alias ikgr='ibmcloud cs region' +alias iksr='ibmcloud cs region-set' +alias ir='ibmcloud cr' +alias irl='ibmcloud cr login' +alias irgi='ibmcloud cr images' +alias ikin='ibmcloud-install-nginx' +alias ikii='ibmcloud-install-istio' + +# global (to be chained with _ -> sudo, or expanded anywhere) + +# unix +alias -g md='mkdir -p' +alias -g wh='which' +alias -g wt='while true; do' +alias -g s1='sleep 1' +alias -g s2='sleep 2' +alias -g s01='sleep 0.1' +alias -g s05='sleep 0.5' +ialias -g grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' +alias -g A1="| awk '{print \$1}'" +alias -g L='| less' +alias -g H='| head' +alias -g H2='| head -n 20' +alias -g G='| grep' +alias -g Gi='| grep -i' +alias -g GH='| grep HTTP' +alias -g X='| xargs -I1' +alias -g C='| clipcopy' +alias -g Fj='| jq .' +alias -g Fy='| yq .' +alias -g Fx='| xmllint --format -' +alias -g V='| vim -' + +# executables +ialias -g l='exa -al' +ialias -g cat='bat --plain --wrap character' + +# arguments +alias -g cpjson="-XPOST -H 'Content-Type: application/json' -d '{}'" +alias -g cptext="-XPOST -H 'Content-Type: text/plain' -d" +alias -g On="--output name" +alias -g Oj="--output json" +alias -g Oy="--output yaml" +alias -g Ow="--output wide" +alias -g Ot="--template" + +# pacman +alias -g pcy='pacman -Syu' +alias -g pcs='pacman -S' +alias -g pcss='pacman -Ss' +alias -g pcqs='pacman -Qs' +alias -g pcr='pacman -R' +alias -g pcrs='pacman -Rs' +alias -g pcclean='pacman -Rsn $(pacman -Qqdt)' +alias -g pry='pacaur -Syu' +alias -g prs='pacaur -S' +alias -g prss='pacaur -Ss' + +# systemctl +alias -g scl='systemctl' +alias -g sclss='systemctl status' +alias -g scle='systemctl enable' +alias -g scld='systemctl disable' +alias -g sclr='systemctl restart' +alias -g scls='systemctl start' +alias -g sclt='systemctl stop' +alias -g scldr='systemctl daemon-reload' +alias -g jou='sudo journalctl -b -n 200 -f' + +# java +alias -g j='java' +alias -g jc='javac' +alias -g jj='java -jar' +alias -g jp='javap -v -l -p -c -s' + + +# suffix +alias -s {pdf,PDF}='background mupdf' +alias -s {jpg,JPG,png,PNG}='background gpicview' +alias -s {ods,ODS,odt,ODT,odp,ODP,doc,DOC,docx,DOCX,xls,XLS,xlsx,XLSX,xlsm,XLSM,ppt,PPT,pptx,PPTX,csv,CSV}='background libreoffice' +alias -s {html,HTML}='background chromium' +alias -s {mp4,MP4,mov,MOV,mkv,MKV}='background vlc' +alias -s {zip,ZIP,war,WAR}="unzip -l" +alias -s {jar,JAR}="java -jar" +alias -s gz="tar -tf" +alias -s {tgz,TGZ}="tar -tf" diff --git a/.ideavimrc.symlink b/.ideavimrc.symlink new file mode 100644 index 0000000..0cb038b --- /dev/null +++ b/.ideavimrc.symlink @@ -0,0 +1,32 @@ +let mapleader = " " + +noremap +nmap O +nmap o + +nnoremap :m +1 +nnoremap :m -2 +inoremap :m +1gi +inoremap :m -2gi + +set relativenumber + +" system clipboard +vmap y "+y +vmap d "+d +nmap y "+yy +nmap p "+p +nmap P "+P +vmap p "+p +vmap P "+P + +" scrolling +nmap d +nmap u +vmap d +vmap u + +nmap h :action PreviousTab +nmap l :action NextTab +nmap bd :action CloseEditor +nnoremap diff --git a/.vimrc.symlink b/.vimrc.symlink new file mode 100644 index 0000000..454ebda --- /dev/null +++ b/.vimrc.symlink @@ -0,0 +1,264 @@ +set encoding=utf-8 +set tabstop=2 +set shiftwidth=2 +set expandtab +set smarttab +set autoindent +set nowrap +set smartcase +set showmatch +set title +set ruler +set et +set relativenumber +set incsearch +set hlsearch +set autoread +set autowrite +set nobackup +set nowritebackup +set noswapfile +set nocompatible +" title required for i3 status checking, modified indicator at end +set titlestring=%(%F%)%a\ -\ VIM%(\ %M%) + +" allows buffers to be hidden if you modified a buffer +set hidden +filetype off +syntax on + +" removes possibility to define function keys that start with +" see if has implications +set noesckeys + + +" Vundle +"<<<<<<<<<<<<<<<<<<<< +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() + +" let Vundle manage Vundle, required +Plugin 'VundleVim/Vundle.vim' + +" UltiSnips for completion / templating +Plugin 'SirVer/ultisnips' + +" Snippets are separated from the engine. Add this if you want them: +Plugin 'sdaschner/vim-snippets' +Plugin 'ervandew/supertab' + +let g:SuperTabDefaultCompletionType = '' +let g:SuperTabCrMapping = 0 +let g:UltiSnipsExpandTrigger = '' +let g:UltiSnipsJumpForwardTrigger = '' +let g:UltiSnipsJumpBackwardTrigger = '' + + +" All of your Plugins must be added before the following line +call vundle#end() +filetype plugin indent on + +" something messes up this setting in the plugins +set expandtab + +inoremap +inoremap +inoremap +inoremap +noremap +noremap + +let mapleader = "\" + +nmap O +nmap o + +" presentation mode +noremap :silent bp :redraw! +noremap :silent bn :redraw! +nmap :set relativenumber! showmode! showcmd! hidden! ruler! +nmap :call DisplayPresentationBoundaries() + +" jump to slides +nmap :call JumpFirstBuffer() :redraw! +nmap :call JumpSecondToLastBuffer() :redraw! +nmap :call JumpLastBuffer() :redraw! + + +" move lines with Ctrl + (Shift) +J/K +nnoremap :m +1 +nnoremap :m -2 +inoremap :m +1gi +inoremap :m -2gi +vnoremap :m '>+1gvgv +vnoremap :m '<-2gvgv + +" opens a new empty buffer +nmap t :enew +" moves to the next buffer +nmap l :bnext +" moves to the previous buffer +nmap h :bprevious +" closes the current buffer, moves to the previous one +nmap bd :bd +" forces buffer close +nmap BD :bd! +" shows all open buffers and their status +nmap bl :ls +" toggles the paste mode +nmap :set paste! +" toggles word wrap +nmap :set wrap! linebreak +" toggles spell checking +nmap :set spell! spelllang=en_us +" opens the last buffer +nnoremap +" adds a line of < +nmap a :normal 20i< +" makes Ascii art font +nmap F :.!toilet -w 200 -f slant +nmap f :.!toilet -w 200 -f smslant +" makes Ascii border +nmap 1 :.!toilet -w 200 -f term -F border + +" system clipboard +vmap y "+y +vmap d "+d +nmap y "+yy +nmap p "+p +nmap P "+P +vmap p "+p +vmap P "+P + +nmap d +nmap u +vmap d +vmap u + +" file operations +nmap :w +nmap :q + +let &t_ti.="\e[1 q" +let &t_SI.="\e[5 q" +let &t_EI.="\e[1 q" +let &t_te.="\e[0 q" + +" search highlighting color +highlight Search ctermfg=grey ctermbg=red + +" removes search highlighting +nnoremap :nohl + +" AsciiDoc preview +nmap v :!asciidoc-view % + +" Transparent editing of gpg encrypted files. +" By Wouter Hanegraaff +augroup encrypted + au! + + " First make sure nothing is written to ~/.viminfo while editing + " an encrypted file. + autocmd BufReadPre,FileReadPre *.gpg set viminfo= + " We don't want a swap file, as it writes unencrypted data to disk + autocmd BufReadPre,FileReadPre *.gpg set noswapfile + + " Switch to binary mode to read the encrypted file + autocmd BufReadPre,FileReadPre *.gpg set bin + autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2 + " (If you use tcsh, you may need to alter this line.) + autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt 2> /dev/null + + " Switch to normal mode for editing + autocmd BufReadPost,FileReadPost *.gpg set nobin + autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save + autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r") + + " Convert all text to encrypted text before writing + " (If you use tcsh, you may need to alter this line.) + autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --default-recipient-self -ae 2>/dev/null + " Undo the encryption so we are back in the normal text, directly + " after the file has been written. + autocmd BufWritePost,FileWritePost *.gpg u +augroup END + +function! JumpFirstBuffer() + execute "buffer 1" +endfunction + +function! JumpSecondToLastBuffer() + execute "buffer " . (len(Buffers()) - 1) +endfunction + +function! JumpLastBuffer() + execute "buffer " . len(Buffers()) +endfunction + +function! Buffers() + let l:buffers = filter(range(1, bufnr('$')), 'bufexists(v:val)') + return l:buffers +endfunction + +" Automatically source an eponymous .vim or ..vim if it exists, as a bulked-up +" modeline and to provide file-specific customizations. +function! s:AutoSource() + let l:testedScripts = ['syntax.vim'] + if expand(':e') !=# 'vim' + " Don't source the edited Vimscript file itself. + call add(l:testedScripts, 'syntax.vim') + endif + + for l:filespec in l:testedScripts + if filereadable(l:filespec) + execute 'source' fnameescape(l:filespec) + endif + endfor +endfunction +augroup AutoSource + autocmd! BufNewFile,BufRead * call AutoSource() +augroup END + + +set foldtext=SimpleFoldText() +set fillchars=fold:\ +function SimpleFoldText() + let line = getline(v:foldstart) + let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g') + return sub . ' >>>>>>' +endfunction + +set foldlevelstart=20 +set foldmethod=expr +set foldexpr=ListFolds() + +function! ListFolds() + let thisline = getline(v:lnum) + if match(thisline, '^- ') >= 0 + return ">1" + elseif match(thisline, '^ - ') >= 0 + return ">2" + elseif match(thisline, '^ - ') >= 0 + return ">3" + elseif match(thisline, '^ - ') >= 0 + return ">4" + elseif match(thisline, '^ - ') >= 0 + return ">5" + endif + return "0" +endfunction + + +let g:presentationBoundsDisplayed = 0 +function! DisplayPresentationBoundaries() + if g:presentationBoundsDisplayed + match + set colorcolumn=0 + let g:presentationBoundsDisplayed = 0 + else + highlight lastoflines ctermbg=darkred guibg=darkred + match lastoflines /\%23l/ + set colorcolumn=80 + let g:presentationBoundsDisplayed = 1 + endif +endfunction diff --git a/.zshenv.symlink b/.zshenv.symlink new file mode 100644 index 0000000..84f6a45 --- /dev/null +++ b/.zshenv.symlink @@ -0,0 +1 @@ +export PATH=$HOME/bin:/usr/local/bin:$PATH diff --git a/.zshrc.symlink b/.zshrc.symlink new file mode 100644 index 0000000..ec2cd7f --- /dev/null +++ b/.zshrc.symlink @@ -0,0 +1,43 @@ +export ZSH=~/.oh-my-zsh + +ZSH_THEME="afowler" +plugins=(git vi-mode kubectl oc copybuffer) + +source $ZSH/oh-my-zsh.sh + + +# colors +echo -ne "\e]12;orange\007" +export LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:" +export EXA_COLORS="uu=38;5;255:gu=38;5;255:ur=38;5;255:uw=38;5;255:ue=38;5;255:wx=38;5;255:gr=38;5;250:gw=38;5;250:gx=38;5;250:tr=38;5;255:tw=38;5;255:tx=38;5;255:da=38;5;250:sn=32:sb=0:di=38;5;105" + + +# vim cursor +zle-line-finish zle-line-init zle-keymap-select () { + if [ $TERM != linux ]; then + if [ $KEYMAP = vicmd ]; then + echo -ne "\e[2 q" + else + echo -ne "\e[5 q" + fi + fi +} + + +# key bindings +bindkey '^R' history-incremental-search-backward +bindkey '^S' history-incremental-search-forward +# enable Ctrl + S / Q +stty start undef +stty stop undef +setopt noflowcontrol + +autoload zmv + + +# start ssh-agent w/ git ssh key +eval $(keychain --eval --quiet) + + +# direnv +eval "$(direnv hook zsh)" diff --git a/install-dotfiles.sh b/install-dotfiles.sh new file mode 100644 index 0000000..45f0472 --- /dev/null +++ b/install-dotfiles.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +DOTFILES_ROOT=$(pwd) + +#symlink dotfiles into home directory +install_dotfiles () { + + local overwrite_all=false backup_all=false skip_all=false + + for src in $(find "$DOTFILES_ROOT/" -maxdepth 2 -name '*.symlink') + do + dst="$HOME/$(basename "${src%.*}")" + ln -s "$src" "$dst" + done +} + +mkdir -p ~/.config # in case if there is not any custom config +mkdir -p ~/.vim # in case if there is not any .vim home folder +mkdir -p /opt/jenv/completions # in case if it is not existed + +git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + +install_dotfiles + +#setup oh-my-zsh +# git clone https://github.com/robbyrussell/oh-my-zsh ~/.oh-my-zsh +cd ~/.oh-my-zsh/custom/plugins + +git clone git://github.com/zsh-users/zsh-syntax-highlighting.git + +cd $DOTFILES_ROOT + +#setup submodules of this repository +git submodule init +git submodule update + +# symlink config folder +ln -s $DOTFILES_ROOT/.config/* ~/.config + +# symlink bin folder +mkdir ~/bin +ln -s $DOTFILES_ROOT/bin/* ~/bin + +# symlink .oh-my-zsh themes folder +ln -s $DOTFILES_ROOT/.oh-my-zsh/custom/themes/* ~/.oh-my-zsh/custom/themes + +# symlink custom zsh config +ln -s $DOTFILES_ROOT/.oh-my-zsh/custom/*.zsh ~/.oh-my-zsh/custom From 71d2c55e1ee4b238b5e1d74244e321eafd4c6cc3 Mon Sep 17 00:00:00 2001 From: iMilad Date: Thu, 25 Jul 2019 09:37:02 +0200 Subject: [PATCH 2/5] Removed unused files --- .aliases | 299 ----------------------------------------------------- .ideavimrc | 32 ------ .vimrc | 266 ----------------------------------------------- .zshrc | 43 -------- 4 files changed, 640 deletions(-) delete mode 100644 .aliases delete mode 100644 .ideavimrc delete mode 100644 .vimrc delete mode 100644 .zshrc diff --git a/.aliases b/.aliases deleted file mode 100644 index e0fb988..0000000 --- a/.aliases +++ /dev/null @@ -1,299 +0,0 @@ -# unix -alias c='cat' -alias le='less -j4' -alias chex='chmod +x' -alias cpr='cp -r' -alias rr='rm -Rf' -alias mn='mv -vn' -alias txf='tar -xf' -alias v='vim' -ialias vi='vim' -alias uz='unzip' -alias uzl='unzip -l' -ialias tree='tree -a -I ".svn|.git|.hg|.idea"' -alias tree2='tree -L 2' -alias tree3='tree -L 3' -alias fn='find . -name "*' -alias ff='find . -name "*.' -alias h='hash -rf' -alias sz='source ~/.zshrc' -alias hx='hexdump -C' -alias k9='kill -9' -alias k15='kill -s 15' -alias w1='watch -n 1' - -# desktop -alias xauto='xrandr --auto' - -# executables -alias cs='create-script' -alias ij='start-intellij' -balias se='session-' -alias acd='asciidoctor' -alias ti='timer' -alias tmzs='timezones' -alias dea='direnv allow' -alias dee='direnv edit' -ialias curl='curl --silent --show-error' -balias clh='curl localhost:' -balias clh8='curl localhost:8080' -balias clh9='curl localhost:9080' -balias c100='curl 192.168.99.100:' -ialias cal='cal -y --monday' - -# network -alias wi='sudo wifi-menu' -alias p1='ping 1.1.1.1' -alias p192='ping 192.168.1.1' -alias p8='ping 8.8.8.8' -alias p9='ping 9.9.9.9' - -# system -alias tmz='sudo timedatectl set-timezone' - -# mvn -alias mvv='mvn -v' -alias mci='mvn clean install' -alias mciT='mvn clean install -DskipTests' -alias mcd='mvn clean deploy' -alias mcdT='mvn clean deploy -DskipTests' -alias mp='mvn package' -alias mpT='mvn package -DskipTests' -alias mcp='mvn clean package' -alias mcpT='mvn clean package -DskipTests' -alias mit='mvn test-compile failsafe:integration-test failsafe:verify' -alias mc='mvn clean' -alias mct='mvn clean test' -alias mgs='mvn generate-sources' -alias mrr='mvn release:prepare release:perform -DperformRelease=true -DignoreSnapshots=false' -alias mgat='mvn io.gatling:gatling-maven-plugin:execute' - -# git -alias gs='git show' -alias gt='git tag' -alias gupd='git update' -alias ggpusht='git push origin $(git_current_branch) --tags' -alias ggpushf='git push origin $(git_current_branch) --force' -alias ggpushtf='git push origin $(git_current_branch) --tags --force' -alias ggpushft='git push origin $(git_current_branch) --tags --force' -alias ggpull='git pull --rebase origin $(git_current_branch)' -alias ggpp='git pull --rebase origin $(git_current_branch) && git push origin $(git_current_branch)' -alias gg='git graph' -alias gsts='git stash save' -alias grget='git remote get-url origin' -alias gpr='hub pull-request' -alias gci='hub issue create' - -# svn -alias svu='svn update' -alias svs='svn status' -alias svi='svn info' - -# docker -alias dk='docker' -alias dkp='docker ps' -alias dkpa='docker ps -a' -alias dkpaq='docker ps -a -q' -alias dkb='docker build -t' -alias dkbnc='docker build --no-cache -t' -alias dkr='docker run --rm' -alias dkrti='docker run --rm -ti' -alias dkrd='docker run -d' -alias dkrp8='docker run --rm -p 8080:8080' -alias dkrp9='docker run --rm -p 9080:9080' -alias dks='docker start' -alias dkt='docker stop' -alias dktt='docker stop $(docker ps -q)' -alias dkk='docker kill' -alias dkrm='docker rm' -alias dkri='docker rmi' -alias dke='docker exec -ti' -alias dkl='docker logs -f' -alias dki='docker images' -alias dkpu='docker pull' -alias dkph='docker push' -alias dkin='docker inspect' -alias dkn='docker network' -alias dkc='docker-compose' -alias dkcu='docker-compose up' -alias dkclean='docker ps -q -a -f status=exited | xargs -r docker rm && docker images -q -f dangling=true | xargs -r docker rmi' - -# kubernetes -alias kc='kubectl' -alias kcg='kubectl get' -alias kcgn='kubectl get --namespace' -alias kcd='kubectl describe' -alias kcdn='kubectl describe --namespace' -alias kcdl='kubectl delete' -alias kcdln='kubectl delete --namespace' -alias kcdlp='kubectl-delete-pod' -alias kcgno='kubectl get nodes' -alias kcgp='kubectl get pods' -alias kcgpn='kubectl get pods --namespace' -alias kcgpp='kubectl get pods --all-namespaces' -alias kcgd='kubectl get deployments' -alias kcgdn='kubectl get deployments --namespace' -alias kcgdd='kubectl get deployments --all-namespaces' -alias kcgs='kubectl get services' -alias kcgsn='kubectl get services --namespace' -alias kcgss='kubectl get services --all-namespaces' -alias kcgi='kubectl get ingresses' -alias kcgin='kubectl get ingresses --namespace' -alias kcgii='kubectl get ingresses --all-namespaces' -alias kcgc='kubectl get configmaps' -alias kcgcn='kubectl get configmaps --namespace' -alias kcgcc='kubectl get configmaps --all-namespaces' -alias kcgv='kubectl get virtualservices' -alias kcgvn='kubectl get virtualservices --namespace' -alias kcgvv='kubectl get virtualservices --all-namespaces' -alias kcgdr='kubectl get destinationrules' -alias kcgdrn='kubectl get destinationrules --namespace' -alias kcgdrr='kubectl get destinationrules --all-namespaces' -alias kcgg='kubectl get gateways' -alias kcggn='kubectl get gateways --namespace' -alias kcggg='kubectl get gateways --all-namespaces' -alias kcgse='kubectl get serviceentries' -alias kcgsen='kubectl get serviceentries --namespace' -alias kcgsee='kubectl get serviceentries --all-namespaces' -alias kcgr='kubectl get routerules' -alias kcgrn='kubectl get routerules --namespace' -alias kcgrr='kubectl get routerules --all-namespaces' -alias kcgdp='kubectl get destinationpolicies' -alias kcgdpn='kubectl get destinationpolicies --namespace' -alias kcgdpp='kubectl get destinationpolicies --all-namespaces' -alias kcge='kubectl get events --sort-by=".lastTimestamp" --all-namespaces --watch' -alias kcc='kubectl create' -alias kccn='kubectl create --namespace' -alias kca='kubectl apply -f' -alias kcan='kubectl apply -f --namespace' -alias kce='kubectl exec -t -i' -alias kcen='kubectl exec -t -i --namespace' -alias kcl='kubectl logs -f' -alias kcll='kubectl-logs' -alias kcln='kubectl logs -f --namespace' -alias kcgx='kubectl config get-contexts' -alias kcux='kubectl config use-context' -alias kcxsn='kubectl config set-context $(kubectl config current-context) --namespace' -alias kcpf='kubectl port-forward' -alias kcpfg='kubectl-port-forward-grafana' -alias kcpfj='kubectl-port-forward-jaeger' -alias kcpfk='kubectl-port-forward-kiali' -alias kcpfp='kubectl-port-forward-prometheus' -alias kcpfz='kubectl-port-forward-zipkin' -alias kcdldr='kubectl-delete-default-resources' -alias kcii='kubectl-ingress-ip-address' -alias kcni='kubectl-nginx-ip-address' -alias kcigip='kubectl-istio-gateway-ip-address' -alias kcignp='kubectl-istio-gateway-http-nodeport' - -# istio -alias ic='istioctl' -alias icg='istioctl get' -alias icc='istioctl create -f' -alias icr='istioctl replace -f' -alias icdl='istioctl delete' -alias icij='istioctl kube-inject -f' - -# minikube -alias mks='minikube start' -alias mkt='minikube stop' - -# ibmcloud -# ib -> ibmcloud -# ik -> ibmcloud kubernetes (cs) -# ikr -> ibmcloud container registry (cr) -alias ib='ibmcloud' -alias ibl='ibmcloud login' -alias ibls='ibmcloud login --sso' -alias ik='ibmcloud cs' -alias ikc='ibmcloud cs cluster' -alias ikgc='ibmcloud cs clusters' -alias ikac='ibmcloud-add-cluster' -alias ikdlc='ibmcloud cs cluster-rm' -alias ikgw='ibmcloud cs workers' -alias ikgr='ibmcloud cs region' -alias iksr='ibmcloud cs region-set' -alias ir='ibmcloud cr' -alias irl='ibmcloud cr login' -alias irgi='ibmcloud cr images' -alias ikin='ibmcloud-install-nginx' -alias ikii='ibmcloud-install-istio' - -# global (to be chained with _ -> sudo, or expanded anywhere) - -# unix -alias -g md='mkdir -p' -alias -g wh='which' -alias -g wt='while true; do' -alias -g s1='sleep 1' -alias -g s2='sleep 2' -alias -g s01='sleep 0.1' -alias -g s05='sleep 0.5' -ialias -g grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' -alias -g A1="| awk '{print \$1}'" -alias -g L='| less' -alias -g H='| head' -alias -g H2='| head -n 20' -alias -g G='| grep' -alias -g Gi='| grep -i' -alias -g GH='| grep HTTP' -alias -g X='| xargs -I1' -alias -g C='| clipcopy' -alias -g Fj='| jq .' -alias -g Fy='| yq .' -alias -g Fx='| xmllint --format -' -alias -g V='| vim -' - -# executables -ialias -g l='exa -al' -ialias -g cat='bat --plain --wrap character' - -# arguments -alias -g cpjson="-XPOST -H 'Content-Type: application/json' -d '{}'" -alias -g cptext="-XPOST -H 'Content-Type: text/plain' -d" -alias -g On="--output name" -alias -g Oj="--output json" -alias -g Oy="--output yaml" -alias -g Ow="--output wide" -alias -g Ot="--template" - -# pacman -alias -g pcy='pacman -Syu' -alias -g pcs='pacman -S' -alias -g pcss='pacman -Ss' -alias -g pcqs='pacman -Qs' -alias -g pcr='pacman -R' -alias -g pcrs='pacman -Rs' -alias -g pcclean='pacman -Rsn $(pacman -Qqdt)' -alias -g pry='pacaur -Syu' -alias -g prs='pacaur -S' -alias -g prss='pacaur -Ss' - -# systemctl -alias -g scl='systemctl' -alias -g sclss='systemctl status' -alias -g scle='systemctl enable' -alias -g scld='systemctl disable' -alias -g sclr='systemctl restart' -alias -g scls='systemctl start' -alias -g sclt='systemctl stop' -alias -g scldr='systemctl daemon-reload' -alias -g jou='sudo journalctl -b -n 200 -f' - -# java -alias -g j='java' -alias -g jc='javac' -alias -g jj='java -jar' -alias -g jp='javap -v -l -p -c -s' - - -# suffix -alias -s {pdf,PDF}='background mupdf' -alias -s {jpg,JPG,png,PNG}='background gpicview' -alias -s {ods,ODS,odt,ODT,odp,ODP,doc,DOC,docx,DOCX,xls,XLS,xlsx,XLSX,xlsm,XLSM,ppt,PPT,pptx,PPTX,csv,CSV}='background libreoffice' -alias -s {html,HTML}='background chromium' -alias -s {mp4,MP4,mov,MOV,mkv,MKV}='background vlc' -alias -s {zip,ZIP,war,WAR}="unzip -l" -alias -s {jar,JAR}="java -jar" -alias -s gz="tar -tf" -alias -s {tgz,TGZ}="tar -tf" diff --git a/.ideavimrc b/.ideavimrc deleted file mode 100644 index 0cb038b..0000000 --- a/.ideavimrc +++ /dev/null @@ -1,32 +0,0 @@ -let mapleader = " " - -noremap -nmap O -nmap o - -nnoremap :m +1 -nnoremap :m -2 -inoremap :m +1gi -inoremap :m -2gi - -set relativenumber - -" system clipboard -vmap y "+y -vmap d "+d -nmap y "+yy -nmap p "+p -nmap P "+P -vmap p "+p -vmap P "+P - -" scrolling -nmap d -nmap u -vmap d -vmap u - -nmap h :action PreviousTab -nmap l :action NextTab -nmap bd :action CloseEditor -nnoremap diff --git a/.vimrc b/.vimrc deleted file mode 100644 index 8c1a0a1..0000000 --- a/.vimrc +++ /dev/null @@ -1,266 +0,0 @@ -set encoding=utf-8 -set tabstop=2 -set shiftwidth=2 -set expandtab -set smarttab -set autoindent -set nowrap -set smartcase -set showmatch -set title -set ruler -set et -set relativenumber -set incsearch -set hlsearch -set autoread -set autowrite -set nobackup -set nowritebackup -set noswapfile -set nocompatible -" title required for i3 status checking, modified indicator at end -set titlestring=%(%F%)%a\ -\ VIM%(\ %M%) - -" allows buffers to be hidden if you modified a buffer -set hidden -filetype off -syntax on - -" removes possibility to define function keys that start with -" see if has implications -set noesckeys - - -" Vundle -"<<<<<<<<<<<<<<<<<<<< -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() - -" let Vundle manage Vundle, required -Plugin 'VundleVim/Vundle.vim' - -" UltiSnips for completion / templating -Plugin 'SirVer/ultisnips' - -" Snippets are separated from the engine. Add this if you want them: -Plugin 'sdaschner/vim-snippets' -Plugin 'ervandew/supertab' - -let g:SuperTabDefaultCompletionType = '' -let g:SuperTabCrMapping = 0 -let g:UltiSnipsExpandTrigger = '' -let g:UltiSnipsJumpForwardTrigger = '' -let g:UltiSnipsJumpBackwardTrigger = '' - - -" All of your Plugins must be added before the following line -call vundle#end() -filetype plugin indent on - -" something messes up this setting in the plugins -set expandtab - - - -let mapleader = "\" - -nmap O -nmap o - -inoremap -inoremap -inoremap -inoremap -noremap -noremap - -" presentation mode -noremap :silent bp :redraw! -noremap :silent bn :redraw! -nmap :set relativenumber! showmode! showcmd! hidden! ruler! -nmap :call DisplayPresentationBoundaries() - -" jump to slides -nmap :call JumpFirstBuffer() :redraw! -nmap :call JumpSecondToLastBuffer() :redraw! -nmap :call JumpLastBuffer() :redraw! - - -" move lines with Ctrl + (Shift) +J/K -nnoremap :m +1 -nnoremap :m -2 -inoremap :m +1gi -inoremap :m -2gi -vnoremap :m '>+1gvgv -vnoremap :m '<-2gvgv - -" opens a new empty buffer -nmap t :enew -" moves to the next buffer -nmap l :bnext -" moves to the previous buffer -nmap h :bprevious -" closes the current buffer, moves to the previous one -nmap bd :bd -" forces buffer close -nmap BD :bd! -" shows all open buffers and their status -nmap bl :ls -" toggles the paste mode -nmap :set paste! -" toggles word wrap -nmap :set wrap! linebreak -" toggles spell checking -nmap :set spell! spelllang=en_us -" opens the last buffer -nnoremap -" adds a line of < -nmap a :normal 20i< -" makes Ascii art font -nmap F :.!toilet -w 200 -f slant -nmap f :.!toilet -w 200 -f smslant -" makes Ascii border -nmap 1 :.!toilet -w 200 -f term -F border - -" system clipboard -vmap y "+y -vmap d "+d -nmap y "+yy -nmap p "+p -nmap P "+P -vmap p "+p -vmap P "+P - -nmap d -nmap u -vmap d -vmap u - -" file operations -nmap :w -nmap :q - -let &t_ti.="\e[1 q" -let &t_SI.="\e[5 q" -let &t_EI.="\e[1 q" -let &t_te.="\e[0 q" - -" search highlighting color -highlight Search ctermfg=grey ctermbg=red - -" removes search highlighting -nnoremap :nohl - -" AsciiDoc preview -nmap v :!asciidoc-view % - -" Transparent editing of gpg encrypted files. -" By Wouter Hanegraaff -augroup encrypted - au! - - " First make sure nothing is written to ~/.viminfo while editing - " an encrypted file. - autocmd BufReadPre,FileReadPre *.gpg set viminfo= - " We don't want a swap file, as it writes unencrypted data to disk - autocmd BufReadPre,FileReadPre *.gpg set noswapfile - - " Switch to binary mode to read the encrypted file - autocmd BufReadPre,FileReadPre *.gpg set bin - autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2 - " (If you use tcsh, you may need to alter this line.) - autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt 2> /dev/null - - " Switch to normal mode for editing - autocmd BufReadPost,FileReadPost *.gpg set nobin - autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save - autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r") - - " Convert all text to encrypted text before writing - " (If you use tcsh, you may need to alter this line.) - autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --default-recipient-self -ae 2>/dev/null - " Undo the encryption so we are back in the normal text, directly - " after the file has been written. - autocmd BufWritePost,FileWritePost *.gpg u -augroup END - -function! JumpFirstBuffer() - execute "buffer 1" -endfunction - -function! JumpSecondToLastBuffer() - execute "buffer " . (len(Buffers()) - 1) -endfunction - -function! JumpLastBuffer() - execute "buffer " . len(Buffers()) -endfunction - -function! Buffers() - let l:buffers = filter(range(1, bufnr('$')), 'bufexists(v:val)') - return l:buffers -endfunction - -" Automatically source an eponymous .vim or ..vim if it exists, as a bulked-up -" modeline and to provide file-specific customizations. -function! s:AutoSource() - let l:testedScripts = ['syntax.vim'] - if expand(':e') !=# 'vim' - " Don't source the edited Vimscript file itself. - call add(l:testedScripts, 'syntax.vim') - endif - - for l:filespec in l:testedScripts - if filereadable(l:filespec) - execute 'source' fnameescape(l:filespec) - endif - endfor -endfunction -augroup AutoSource - autocmd! BufNewFile,BufRead * call AutoSource() -augroup END - - -set foldtext=SimpleFoldText() -set fillchars=fold:\ -function SimpleFoldText() - let line = getline(v:foldstart) - let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g') - return sub . ' >>>>>>' -endfunction - -set foldlevelstart=20 -set foldmethod=expr -set foldexpr=ListFolds() - -function! ListFolds() - let thisline = getline(v:lnum) - if match(thisline, '^- ') >= 0 - return ">1" - elseif match(thisline, '^ - ') >= 0 - return ">2" - elseif match(thisline, '^ - ') >= 0 - return ">3" - elseif match(thisline, '^ - ') >= 0 - return ">4" - elseif match(thisline, '^ - ') >= 0 - return ">5" - endif - return "0" -endfunction - - -let g:presentationBoundsDisplayed = 0 -function! DisplayPresentationBoundaries() - if g:presentationBoundsDisplayed - match - set colorcolumn=0 - let g:presentationBoundsDisplayed = 0 - else - highlight lastoflines ctermbg=darkred guibg=darkred - match lastoflines /\%23l/ - set colorcolumn=80 - let g:presentationBoundsDisplayed = 1 - endif -endfunction diff --git a/.zshrc b/.zshrc deleted file mode 100644 index ec2cd7f..0000000 --- a/.zshrc +++ /dev/null @@ -1,43 +0,0 @@ -export ZSH=~/.oh-my-zsh - -ZSH_THEME="afowler" -plugins=(git vi-mode kubectl oc copybuffer) - -source $ZSH/oh-my-zsh.sh - - -# colors -echo -ne "\e]12;orange\007" -export LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:" -export EXA_COLORS="uu=38;5;255:gu=38;5;255:ur=38;5;255:uw=38;5;255:ue=38;5;255:wx=38;5;255:gr=38;5;250:gw=38;5;250:gx=38;5;250:tr=38;5;255:tw=38;5;255:tx=38;5;255:da=38;5;250:sn=32:sb=0:di=38;5;105" - - -# vim cursor -zle-line-finish zle-line-init zle-keymap-select () { - if [ $TERM != linux ]; then - if [ $KEYMAP = vicmd ]; then - echo -ne "\e[2 q" - else - echo -ne "\e[5 q" - fi - fi -} - - -# key bindings -bindkey '^R' history-incremental-search-backward -bindkey '^S' history-incremental-search-forward -# enable Ctrl + S / Q -stty start undef -stty stop undef -setopt noflowcontrol - -autoload zmv - - -# start ssh-agent w/ git ssh key -eval $(keychain --eval --quiet) - - -# direnv -eval "$(direnv hook zsh)" From 3b6e87882fdead85db4f7ea5be3676620be266b6 Mon Sep 17 00:00:00 2001 From: Milad Khakpour Date: Thu, 25 Jul 2019 09:40:56 +0200 Subject: [PATCH 3/5] uncomment oh-my-zsh installation --- install-dotfiles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-dotfiles.sh b/install-dotfiles.sh index 45f0472..f2efa54 100644 --- a/install-dotfiles.sh +++ b/install-dotfiles.sh @@ -23,7 +23,7 @@ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim install_dotfiles #setup oh-my-zsh -# git clone https://github.com/robbyrussell/oh-my-zsh ~/.oh-my-zsh +git clone https://github.com/robbyrussell/oh-my-zsh ~/.oh-my-zsh cd ~/.oh-my-zsh/custom/plugins git clone git://github.com/zsh-users/zsh-syntax-highlighting.git From f597f501e6f8900b37dea89daa2dbbba5bcd9b26 Mon Sep 17 00:00:00 2001 From: iMilad Date: Thu, 25 Jul 2019 11:13:28 +0200 Subject: [PATCH 4/5] load aliases --- .zshrc.symlink | 5 +++++ zsh-syntax-highlighting | 1 + 2 files changed, 6 insertions(+) create mode 160000 zsh-syntax-highlighting diff --git a/.zshrc.symlink b/.zshrc.symlink index ec2cd7f..930f5ae 100644 --- a/.zshrc.symlink +++ b/.zshrc.symlink @@ -41,3 +41,8 @@ eval $(keychain --eval --quiet) # direnv eval "$(direnv hook zsh)" + +# load aliases +if [ -f ~/.aliases ]; then + . ~/.aliases +fi diff --git a/zsh-syntax-highlighting b/zsh-syntax-highlighting new file mode 160000 index 0000000..b55832c --- /dev/null +++ b/zsh-syntax-highlighting @@ -0,0 +1 @@ +Subproject commit b55832c5f849b2416c83ce3a665cf4bef2dc4d48 From efde57271c7473b83e4869a15887b53eb64622cd Mon Sep 17 00:00:00 2001 From: iMilad Date: Thu, 25 Jul 2019 11:15:37 +0200 Subject: [PATCH 5/5] removed zsh-syntax-hl package from repo --- zsh-syntax-highlighting | 1 - 1 file changed, 1 deletion(-) delete mode 160000 zsh-syntax-highlighting diff --git a/zsh-syntax-highlighting b/zsh-syntax-highlighting deleted file mode 160000 index b55832c..0000000 --- a/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b55832c5f849b2416c83ce3a665cf4bef2dc4d48