add more stuff
This commit is contained in:
parent
c877dfe2cf
commit
409473e6bd
4 changed files with 108 additions and 54 deletions
144
.bash_aliases
144
.bash_aliases
|
|
@ -12,7 +12,7 @@ alias pmm='python manage.py migrate'
|
||||||
alias pmmm='python manage.py makemigrations'
|
alias pmmm='python manage.py makemigrations'
|
||||||
|
|
||||||
# Start vim with system clipboard
|
# Start vim with system clipboard
|
||||||
#alias vim="vimx" # don't alias this - make symlink instead
|
alias vim="vimx" # don't alias this - make symlink instead
|
||||||
alias vi="vim"
|
alias vi="vim"
|
||||||
alias vimdiff="vim -d"
|
alias vimdiff="vim -d"
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ alias svali_papka=download_github_folder
|
||||||
alias omg="sudo systemctl restart NetworkManager"
|
alias omg="sudo systemctl restart NetworkManager"
|
||||||
alias omg1.1="sudo rmmod iwlmvm && sudo rmmod iwlwifi; sudo modprobe iwlwifi"
|
alias omg1.1="sudo rmmod iwlmvm && sudo rmmod iwlwifi; sudo modprobe iwlwifi"
|
||||||
alias zsh_fix="mv ~/.zsh_history ~/.zsh_history_bad; strings ~/.zsh_history_bad > ~/.zsh_history;fc -R ~/.zsh_history; rm ~/.zsh_history_bad"
|
alias zsh_fix="mv ~/.zsh_history ~/.zsh_history_bad; strings ~/.zsh_history_bad > ~/.zsh_history;fc -R ~/.zsh_history; rm ~/.zsh_history_bad"
|
||||||
alias myip="curl icanhazip.com"
|
alias myip="curl https://icanhazip.com"
|
||||||
alias rmswp="find ~/.vim/tmp/ -iname \"*swp\" -delete"
|
alias rmswp="find ~/.vim/tmp/ -iname \"*swp\" -delete"
|
||||||
alias root="sudo su -"
|
alias root="sudo su -"
|
||||||
|
|
||||||
|
|
@ -121,56 +121,56 @@ alias reinstall="sudo $pm reinstall"
|
||||||
# sudo openvpn --config viktor.ovpn &
|
# sudo openvpn --config viktor.ovpn &
|
||||||
# }
|
# }
|
||||||
|
|
||||||
function in(){
|
# function in(){
|
||||||
if [ $# -lt 2 ];
|
# if [ $# -lt 2 ];
|
||||||
then
|
# then
|
||||||
echo "Usage:"
|
# echo "Usage:"
|
||||||
echo "To start existing container:"
|
# echo "To start existing container:"
|
||||||
echo "in <os you want>"
|
# echo "in <os you want>"
|
||||||
echo
|
# echo
|
||||||
echo "To start new container:"
|
# echo "To start new container:"
|
||||||
echo "in new <os you want>"
|
# echo "in new <os you want>"
|
||||||
return
|
# return
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
if [ $# -eq 1 ]
|
# if [ $# -eq 1 ]
|
||||||
then
|
# then
|
||||||
container_name="${1/:/_}"
|
# container_name="${1/:/_}"
|
||||||
else
|
# else
|
||||||
container_name="${2/:/_}"
|
# container_name="${2/:/_}"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# Check if recreating a container or reuse existing
|
# # Check if recreating a container or reuse existing
|
||||||
if [ "$1" = "new" ]
|
# if [ "$1" = "new" ]
|
||||||
then
|
# then
|
||||||
image_name=$2
|
# image_name=$2
|
||||||
if [[ $(docker container ls -a | grep "$container_name") ]]
|
# if [[ $(docker container ls -a | grep "$container_name") ]]
|
||||||
then
|
# then
|
||||||
if [[ $(docker ps | grep $container_name) ]]
|
# if [[ $(docker ps | grep $container_name) ]]
|
||||||
then
|
# then
|
||||||
docker stop $container_name >> /dev/null
|
# docker stop $container_name >> /dev/null
|
||||||
fi
|
# fi
|
||||||
docker rm $container_name >> /dev/null
|
# docker rm $container_name >> /dev/null
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
if [ -z "$3" ]
|
# if [ -z "$3" ]
|
||||||
then
|
# then
|
||||||
cmd="/bin/bash"
|
# cmd="/bin/bash"
|
||||||
else
|
# else
|
||||||
cmd="$3"
|
# cmd="$3"
|
||||||
fi
|
# fi
|
||||||
echo "Running $cmd in $container_name"
|
# echo "Running $cmd in $container_name"
|
||||||
# docker run -it --name $container_name --publish-all=true $image_name "$cmd" && docker attach $container_name
|
# # docker run -it --name $container_name --publish-all=true $image_name "$cmd" && docker attach $container_name
|
||||||
|
|
||||||
xhost +local:root # allow gui apps
|
# xhost +local:root # allow gui apps
|
||||||
docker run -it --name $container_name -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix $image_name "$cmd"
|
# docker run -it --name $container_name -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix $image_name "$cmd"
|
||||||
xhost -local:root
|
# xhost -local:root
|
||||||
else
|
# else
|
||||||
xhost +local:root
|
# xhost +local:root
|
||||||
docker start $container_name >> /dev/null && docker attach $container_name
|
# docker start $container_name >> /dev/null && docker attach $container_name
|
||||||
xhost -local:root
|
# xhost -local:root
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
# stest(){
|
# stest(){
|
||||||
# snapshot_name="rootsnap"
|
# snapshot_name="rootsnap"
|
||||||
|
|
@ -397,7 +397,7 @@ avr-gcc -M $* | sed -e 's/[\\ ]/\n/g' | \
|
||||||
}
|
}
|
||||||
#alias server="python3 -m http.server --bind 0.0.0.0 8000"
|
#alias server="python3 -m http.server --bind 0.0.0.0 8000"
|
||||||
alias server="/opt/miniserve-linux"
|
alias server="/opt/miniserve-linux"
|
||||||
alias gr="go run"
|
alias gr="go run ."
|
||||||
alias hg="hugo -D server --bind 0.0.0.0"
|
alias hg="hugo -D server --bind 0.0.0.0"
|
||||||
alias logout="qdbus org.kde.ksmserver /KSMServer logout 0 0 0"
|
alias logout="qdbus org.kde.ksmserver /KSMServer logout 0 0 0"
|
||||||
alias sucss="cd ~/pentesting/sucss-19 && workon sucss-playground-webapp"
|
alias sucss="cd ~/pentesting/sucss-19 && workon sucss-playground-webapp"
|
||||||
|
|
@ -481,6 +481,7 @@ alias vmoff="sudo systemctl stop vmware"
|
||||||
alias dkon="sudo systemctl start docker"
|
alias dkon="sudo systemctl start docker"
|
||||||
alias dkoff="sudo systemctl stop docker"
|
alias dkoff="sudo systemctl stop docker"
|
||||||
alias tf="terraform"
|
alias tf="terraform"
|
||||||
|
alias tfa="tf apply"
|
||||||
function b64() {
|
function b64() {
|
||||||
echo $1 | base64 -d
|
echo $1 | base64 -d
|
||||||
}
|
}
|
||||||
|
|
@ -504,12 +505,51 @@ alias medieval="sh -c 'cd ~/.wine/drive_c/Program\ Files\ \(x86\)/SEGA/Medieval\
|
||||||
|
|
||||||
alias kb="kubectl"
|
alias kb="kubectl"
|
||||||
alias kbp="kubectl get pods"
|
alias kbp="kubectl get pods"
|
||||||
|
alias kbpo="kubectl get pods -o wide"
|
||||||
|
alias kbs="kubectl get svc"
|
||||||
|
alias kbn="kubectl get nodes -o wide"
|
||||||
|
alias kbd="kubectl describe pods"
|
||||||
|
alias kbf="kubectl logs --all-containers --max-log-requests 50 -f"
|
||||||
alias kn="kubens"
|
alias kn="kubens"
|
||||||
function cephpw() {
|
function cephpw() {
|
||||||
kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o yaml | grep "password:" | grep -v '{}'| awk '{print $2}' | base64 --decode
|
kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o yaml | grep "password:" | grep -v '{}'| awk '{print $2}' | base64 --decode
|
||||||
}
|
}
|
||||||
|
function kbop() {
|
||||||
|
kb -n rook-ceph delete pods $(kbp |grep opera | awk '{print $1}')
|
||||||
|
kb -n rook-ceph logs -f $(kbp |grep operator | awk '{print $1}')
|
||||||
|
}
|
||||||
|
|
||||||
alias k8srole="ansible-playbook -i hosts.yaml linux.yml -e host='10.0.20.100' -t "
|
alias k8srole="ansible-playbook -i hosts.yaml linux.yml -e host='10.0.20.100' -t "
|
||||||
alias wgon="wg-quick up ~/vpn-certs/viktor.conf"
|
function wgon(){
|
||||||
alias wgoff="wg-quick down ~/vpn-certs/viktor.conf"
|
wg-quick up ~/vpn-certs/viktor.conf
|
||||||
alias svm="et -c 'tmux new -A -s main' viktorbarzin.sb.facebook.com:8082"
|
# Add ipv4 precedence because vpn is v4 onyl for now
|
||||||
|
bash -c "grep -qxF 'precedence ::ffff:0:0/96 100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf"
|
||||||
|
# Add dns if missing
|
||||||
|
ns_str="nameserver 10.0.20.1 # Added by wgon function"
|
||||||
|
search_str="search viktorbarzin.lan # Added by wgon function"
|
||||||
|
resolv_conf="/etc/resolv.conf"
|
||||||
|
bash -c "grep -qxF '$search_str' $resolv_conf || echo '$search_str' | sudo tee -a $resolv_conf"
|
||||||
|
bash -c "grep -qxF '$ns_str' $resolv_conf || echo '$ns_str' | sudo sed -i -e '1i $ns_str' $resolv_conf"
|
||||||
|
}
|
||||||
|
function wgoff(){
|
||||||
|
wg-quick down ~/vpn-certs/viktor.conf
|
||||||
|
|
||||||
|
ns_str="nameserver 10.0.20.1 # Added by wgon function"
|
||||||
|
search_str="search viktorbarzin.lan # Added by wgon function"
|
||||||
|
resolv_conf="/etc/resolv.conf"
|
||||||
|
|
||||||
|
# Remove ipv4 precedence because vpn is v4 onyl for now
|
||||||
|
sudo sed -i '/precedence ::ffff:0:0\/96 100/d' /etc/gai.conf
|
||||||
|
|
||||||
|
sudo sed -i "/$search_str/d" $resolv_conf
|
||||||
|
sudo sed -i "/$ns_str/d" $resolv_conf
|
||||||
|
}
|
||||||
|
function wgs() {
|
||||||
|
kubectl scale -n wireguard deployment wireguard --replicas=$1
|
||||||
|
}
|
||||||
|
alias wg="sudo wg"
|
||||||
|
alias svm="et -c 'tmux new -A -s main' 10.0.10.104:2022"
|
||||||
|
alias calicoctl="kubectl exec -i -n kube-system calicoctl -- /calicoctl"
|
||||||
|
alias ipcalc="ipcalc --no-decorate"
|
||||||
|
alias ss-tunnel="snap run shadowsocks-libev.ss-tunnel"
|
||||||
|
alias ss-local="snap run shadowsocks-libev.ss-local"
|
||||||
|
|
|
||||||
|
|
@ -354,5 +354,7 @@ set -g @continuum-restore 'off'
|
||||||
|
|
||||||
set -g @plugin 'thewtex/tmux-mem-cpu-load'
|
set -g @plugin 'thewtex/tmux-mem-cpu-load'
|
||||||
|
|
||||||
|
set -g default-command "${SHELL}"
|
||||||
|
|
||||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||||
run -b '~/.tmux/plugins/tpm/tpm'
|
run -b '~/.tmux/plugins/tpm/tpm'
|
||||||
|
|
|
||||||
15
.vimrc
15
.vimrc
|
|
@ -55,7 +55,7 @@ let g:syntastic_check_on_wq = 0
|
||||||
let g:syntastic_loc_list_height=3
|
let g:syntastic_loc_list_height=3
|
||||||
nnoremap <F10> :SyntasticCheck mypy<CR>
|
nnoremap <F10> :SyntasticCheck mypy<CR>
|
||||||
" Set xptemplate trigger key to tab
|
" Set xptemplate trigger key to tab
|
||||||
let g:xptemplate_key = '<Tab>'
|
" let g:xptemplate_key = '<Tab>'
|
||||||
|
|
||||||
" Autocomplete with Tab
|
" Autocomplete with Tab
|
||||||
" inoremap <Tab> <C-x><Space><CR>
|
" inoremap <Tab> <C-x><Space><CR>
|
||||||
|
|
@ -292,7 +292,7 @@ set wildignore+=*/coverage/*
|
||||||
"" map <Leader>g :call RopeGotoDefinition()<CR>
|
"" map <Leader>g :call RopeGotoDefinition()<CR>
|
||||||
"" let ropevim_enable_shortcuts = 1
|
"" let ropevim_enable_shortcuts = 1
|
||||||
"" let g:pymode_rope_goto_def_newwin = "vnew"
|
"" let g:pymode_rope_goto_def_newwin = "vnew"
|
||||||
"" let g:pymode_rope_extended_complete = 1
|
" let g:pymode_rope_extended_complete = 1
|
||||||
"" let g:pymode_breakpoint = 0
|
"" let g:pymode_breakpoint = 0
|
||||||
"" let g:pymode_syntax = 1
|
"" let g:pymode_syntax = 1
|
||||||
"" let g:pymode_syntax_builtin_objs = 0
|
"" let g:pymode_syntax_builtin_objs = 0
|
||||||
|
|
@ -467,9 +467,20 @@ endfunction
|
||||||
|
|
||||||
autocmd VimLeave,BufWritePost * call SaveSess()
|
autocmd VimLeave,BufWritePost * call SaveSess()
|
||||||
" autocmd VimEnter * nested call RestoreSess()
|
" autocmd VimEnter * nested call RestoreSess()
|
||||||
|
nnoremap <leader>r :call RestoreSess()<CR>
|
||||||
|
|
||||||
set updatetime=100
|
set updatetime=100
|
||||||
|
|
||||||
" highlight GitGutterDelete guifg=#990000 ctermfg=1
|
" highlight GitGutterDelete guifg=#990000 ctermfg=1
|
||||||
" highlight GitGutterAdd guifg=#009900 ctermfg=2
|
" highlight GitGutterAdd guifg=#009900 ctermfg=2
|
||||||
" highlight GitGutterChange guifg=#997c00 ctermfg=3
|
" highlight GitGutterChange guifg=#997c00 ctermfg=3
|
||||||
|
|
||||||
|
" Move up and down in autocomplete with <c-j> and <c-k>
|
||||||
|
" inoremap <expr> <c-j> ("\<C-n>")
|
||||||
|
" inoremap <expr> <c-k> ("\<C-p>")
|
||||||
|
" inoremap <expr> <TAB> pumvisible() ? '<C-n>' : <TAB> " pumvisible is slow
|
||||||
|
" inoremap <expr> k pumvisible() ? '<C-p>' : 'k'
|
||||||
|
"
|
||||||
|
" inoremap <expr> <TAB> '<C-n>'
|
||||||
|
" inoremap <expr> <S-TAB> '<C-p>'
|
||||||
|
" let g:pymode=0
|
||||||
|
|
|
||||||
1
.zshrc
1
.zshrc
|
|
@ -1,3 +1,4 @@
|
||||||
|
zmodload zsh/zprof
|
||||||
#[[ $TERM != "screen" ]] && exec tmux
|
#[[ $TERM != "screen" ]] && exec tmux
|
||||||
# If you come from bash you might have to change your $PATH.
|
# If you come from bash you might have to change your $PATH.
|
||||||
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue