diff --git a/config/.config/i3/config b/config/.config/i3/config index df522c1..7459255 100644 --- a/config/.config/i3/config +++ b/config/.config/i3/config @@ -147,9 +147,16 @@ bindsym $mod+p exec firefox --private-window https://mos4.de bindsym $mod+e exec urxvtc -e ranger bindsym $mod+m exec thunderbird -bindsym Print exec --no-startup-id maim -f png ~/Pictures/Screenshots/$(date +%G-%m)/$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png -bindsym control+Shift+Print --release exec --no-startup-id maim -u -s -f png ~/Pictures/Screenshots/$(date +%G-%m)/$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png -bindsym Shift+Print --release exec --no-startup-id maim -u -i $(xdotool getactivewindow) -f png ~/Pictures/Screenshots/$(date +%G-%m)/$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png +# Whole Screen +bindsym Control+Print exec --no-startup-id ~/.scripts/screenshot.sh screen + +# Window +bindsym Mod1+Print --release exec --no-startup-id ~/.scripts/screenshot.sh window + +# Area +bindsym Print --release exec --no-startup-id ~/.scripts/screenshot.sh area + +# Kill Window bindsym $mod+Ctrl+x --release exec --no-startup-id xkill # change focus diff --git a/config/.config/ranger/rc.conf b/config/.config/ranger/rc.conf index 26f2d67..595421f 100644 --- a/config/.config/ranger/rc.conf +++ b/config/.config/ranger/rc.conf @@ -9,4 +9,4 @@ map nrg shell cp ~/Templates/LaTeX/Invoice/elektro_invoice.tex Gefeba_Elektr map nrb shell cp ~/Templates/LaTeX/Invoice/engineering_invoice.tex Gefeba_Engineering_-_Rechnung_$(date +%g-%m)_-Engineering.tex; ~/Templates/LaTeX/Invoice/InvNum.sh map nu shell touch L_$(basename %f .pdf)\.md map ntu shell cp ~/Templates/LaTeX/UniversityAssignmets/assignment.tex . -map nw shell sed "s/# $/# $(pwd | rev | cut -d/ -f1 | rev)/" ~/Templates/writeup.md > ./writeup.md +map nw shell sed "s/# $/# $(pwd | rev | cut -d/ -f1 | rev)/" ~/.vim/templates/writeup.md > ./writeup.md diff --git a/config/.local/share/ranger/bookmarks b/config/.local/share/ranger/bookmarks index c90e9cb..1ca5744 100644 --- a/config/.local/share/ranger/bookmarks +++ b/config/.local/share/ranger/bookmarks @@ -4,9 +4,10 @@ o:/home/tuan/.dotfiles/config m:/run/media/tuan a:/home/tuan/Documents/Arbeit l:/home/tuan/Local -c:/home/tuan/Documents/CTF/picoCTF +c:/home/tuan/Documents/CTF t:/home/tuan/Templates w:/home/tuan/workspace_l/Projects -k:/home/tuan +k:/home/tuan/Documents/CTF/TryHackMe/VulnUniversity q:/home/tuan/.nextcloud/Quick Drop -':/home/tuan/.vim +':/usr/share/byobu/keybindings +e:/home/tuan/Documents/CTF/TryHackMe/Ice/2_Recon diff --git a/config/.scripts/screenshot.sh b/config/.scripts/screenshot.sh new file mode 100755 index 0000000..a7a3789 --- /dev/null +++ b/config/.scripts/screenshot.sh @@ -0,0 +1,22 @@ +#!/bin/sh + + +d=$HOME/Pictures/Screenshots/$(date +%G-%m); +case $1 in + "screen"*) + filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png; + maim -f png $d/$filename; + dunstify -r 2 "Saved screenshot of screen in $d/$filename"; + ;; + "window"*) + filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png + maim -u -i $(xdotool getactivewindow) -f png $d/$filename; + dunstify -r 2 "Saved screenshot of window in $d/$filename"; + ;; + "area"*) + dunstify -r 2 'Taking screenshot from area.'; + filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png; + maim -u -s -f png $d/$filename; + dunstify -r 2 "Saved in $d/$filename."; + ;; +esac diff --git a/config/.scripts/sound.sh b/config/.scripts/sound.sh index 1f4e724..5c1bbcb 100755 --- a/config/.scripts/sound.sh +++ b/config/.scripts/sound.sh @@ -1,15 +1,15 @@ #!/bin/sh -defaultsink=$(pactl info | grep 'Default Sink' | cut -d' ' -f3); +defaultSink=$(pactl info | grep 'Default Sink' | cut -d' ' -f3); curVolume=$(amixer get Master | grep -o \[0-9\]\\+% -m 1); case $1 in "up"*) - pactl set-sink-volume $defaultsink +5%; + pactl set-sink-volume $defaultSink +5%; dunstify -r 2 'sound up'\ \($curVolume\); ;; "down"*) - pactl set-sink-volume $defaultsink -5%; + pactl set-sink-volume $defaultSink -5%; dunstify -r 2 'sound up'\ \($curVolume\); ;; "toggle"*) @@ -17,7 +17,7 @@ case $1 in if amixer get Master | grep -q off; then msg='unmuted'; fi - pactl set-sink-mute $defaultsink toggle; + pactl set-sink-mute $defaultSink toggle; dunstify -r 2 'sound'\ $msg; echo $msg ;; diff --git a/config/.ssh/config b/config/.ssh/config index 9899761..b619e76 100644 --- a/config/.ssh/config +++ b/config/.ssh/config @@ -63,3 +63,9 @@ Host picoCTF Port 22 User mos4 IdentityFile "/home/tuan/Documents/CTF/picoCTF/2018/30 - ssh-keyz/picoCTF" + +Host CentOS + HostName 3.125.43.27 + Port 22 + User centos + IdentityFile /mnt/veracrypt1/mos4.de diff --git a/vim/.vim/ftplugin/go.vim b/vim/.vim/ftplugin/go.vim index 1373edb..9dcc718 100644 --- a/vim/.vim/ftplugin/go.vim +++ b/vim/.vim/ftplugin/go.vim @@ -3,14 +3,17 @@ set autoindent noexpandtab tabstop=4 shiftwidth=4 " Shortcuts abbrev funct func Test(t *testing.T) {}kwwi abbrev trun t.Run("", func(t *testing.T) {})%la -abbrev terr t.Errorf("got %d, want %d", got, want) -abbrev fori for i := 0; i < ; i++{}k2f;i +abbrev terr t.Errorf("got %v, want %v", got, want)02f,lcaw +abbrev thelp func(t *testing.T) {t.Helper()}ko +abbrev fori for i := 0; i <; i++{}k2f;i +abbrev fore for i, c := range{}kf{i " Compiling nnoremap :GoFmt nnoremap :!clear:GoRun nnoremap :GoBuild nnoremap :GoTest +nnoremap :GoImports nnoremap :GoDebugStart nnoremap gd :GoDef nnoremap :GoDoc diff --git a/vim/.vim/plugin/basics.vim b/vim/.vim/plugin/basics.vim index 6b940e6..b8e1425 100644 --- a/vim/.vim/plugin/basics.vim +++ b/vim/.vim/plugin/basics.vim @@ -3,7 +3,6 @@ syntax on filetype indent plugin on set background=light set encoding=utf-8 -set autowrite set smartcase set incsearch set hlsearch diff --git a/vim/.vim/plugin/filetype.vim b/vim/.vim/plugin/filetype.vim new file mode 100644 index 0000000..889b755 --- /dev/null +++ b/vim/.vim/plugin/filetype.vim @@ -0,0 +1,2 @@ +autocmd BufNewFile,BufRead *.razor setf html + diff --git a/vim/.vim/plugin/functions.vim b/vim/.vim/plugin/functions.vim deleted file mode 100644 index 8b3b085..0000000 --- a/vim/.vim/plugin/functions.vim +++ /dev/null @@ -1,33 +0,0 @@ -" This callback will be executed when the entire command is completed -function! BackgroundCommandClose(channel) - " Read the output from the command into the quickfix window - unlet g:backgroundCommandOutput -endfunction - -function! RunBackgroundCommand(command) - " Make sure we're running VIM version 8 or higher. - if v:version < 800 - echoerr 'RunBackgroundCommand requires VIM version 8 or higher' - return - endif - if exists('g:backgroundCommandOutput') - echo 'Already running task in background' - else - echo 'Running task in background' - " Launch the job. - " Notice that we're only capturing out, and not err here. This is because, for some reason, the callback - " will not actually get hit if we write err out to the same file. Not sure if I'm doing this wrong or? - let g:backgroundCommandOutput = tempname() - call job_start(a:command, {'close_cb': 'BackgroundCommandClose', 'out_io': 'file', 'out_name': g:backgroundCommandOutput}) - endif -endfunction - -" So we can use :BackgroundCommand to call our function. -command! -nargs=+ -complete=shellcmd RunBackgroundCommand call RunBackgroundCommand() - -function! GetCWD() - let l:cwd = system('pwd | rev |cut -d- -f1 | rev | xargs | sed "s/[[:space:]]/\\\\&/g\"') - echo l:cwd - call setline('.', l:cwd) - unlet l:cwd -endfunction diff --git a/vim/.vim/plugin/plugins.vim b/vim/.vim/plugin/plugins.vim index 950e681..692e931 100644 --- a/vim/.vim/plugin/plugins.vim +++ b/vim/.vim/plugin/plugins.vim @@ -14,3 +14,4 @@ let g:polyglot_disabled = ['latex'] let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" + diff --git a/vim/.vim/templates/skeleton.md b/vim/.vim/templates/skeleton.md index 9431d5f..3581a0d 100644 --- a/vim/.vim/templates/skeleton.md +++ b/vim/.vim/templates/skeleton.md @@ -3,3 +3,5 @@ author: Tuan-Dat Tran date: [:VIM_EVAL:]strftime('%Y-%m-%d')[:END_EVAL:] ... + +# [:VIM_EVAL:]system ("basename $(pwd)")[:END_EVAL:] diff --git a/zsh/.zshrc b/zsh/.zshrc index 152c076..02c1a9c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,13 +1,15 @@ # Paths -export ZSH="/home/tuan/.oh-my-zsh" +export ZSH="$HOME/.oh-my-zsh" export PATH="$PATH:$HOME/.go/bin:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools" export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_ROOT=/opt/dotnet +export SecList=$HOME/Local/PenTesting/SecLists/ + # Alias alias q="exit" alias ranger='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"' alias xsel='xsel -ib' +alias msfconsole="msfconsole -x \"db_connect metasploit@msf\"" # Theme ZSH_THEME="agnoster"