39 Commits

Author SHA1 Message Date
David Tomaschik
b3eb8a8e44 Dmesg wrapper function 2021-03-24 13:28:45 -07:00
David Tomaschik
3afee0505b vimrc shift-tab notes 2021-03-19 10:52:03 -07:00
David Tomaschik
50b74fc06e Merge branch 'master' of https://github.com./Matir/skel 2021-03-19 10:29:20 -07:00
David Tomaschik
74bf253950 Disable completion based prediction 2021-03-18 23:40:47 -07:00
David Tomaschik
434120cc90 Support aliases.local 2021-03-11 16:40:28 -08:00
David Tomaschik
97e23b3669 Update config_bsidessf 2021-03-04 19:06:35 -08:00
David Tomaschik
f9f3dd05c8 Merge branch 'master' of https://github.com./Matir/skel 2021-03-01 23:09:58 -08:00
David Tomaschik
6e095d9fbc Update strategy 2021-03-01 23:09:40 -08:00
David Tomaschik
c25540a398 Add httpie 2021-02-20 20:35:05 -08:00
David Tomaschik
fae178e8ac Merge branch 'master' of https://github.com./Matir/skel 2021-02-19 20:27:27 -08:00
David Tomaschik
15ea12d54b Change autosuggest colors 2021-02-19 20:27:14 -08:00
David Tomaschik
291de7b2c1 Merge branch 'master' of https://github.com./Matir/skel 2021-02-17 23:52:54 -08:00
David Tomaschik
bbba28e166 Update config_bsidessf 2021-02-17 23:52:15 -08:00
David Tomaschik
27dc8fb22c Merge branch 'master' of https://github.com./Matir/skel 2021-02-17 23:47:39 -08:00
David Tomaschik
a5f55034fa Update htoprc 2021-02-17 23:47:11 -08:00
David Tomaschik
062da36145 Add zsh-autosuggestions 2021-02-17 23:46:25 -08:00
David Tomaschik
9e3b929a4b Default branch to main. 2021-02-06 16:12:05 -08:00
David Tomaschik
3170a41c4b Update rsync ignore 2021-02-05 15:55:59 -08:00
David Tomaschik
b37f95383c Wrap vmstat 2021-02-05 15:55:50 -08:00
David Tomaschik
e6e66b0d05 Handle Xauth in ssh/rc. 2021-01-21 22:37:36 -08:00
David Tomaschik
6e6b63cb28 Update package list 2021-01-17 17:49:32 -08:00
David Tomaschik
20bb942ac6 Update install script. 2020-11-28 14:49:14 -08:00
David Tomaschik
d256cdf12b add amass 2020-11-22 21:32:32 -08:00
David Tomaschik
c20739472f Add meld merge tool 2020-11-19 16:02:28 -08:00
David Tomaschik
66e6833623 Support OS X spelling of en_US.UTF-8 2020-11-10 20:56:36 -08:00
David Tomaschik
bc5f9a2741 Add vim-youcompleteme to packages. 2020-11-07 14:50:17 -08:00
David Tomaschik
04d4ab4d25 Improve remote SSH agent 2020-11-06 09:35:45 -08:00
David Tomaschik
ce1d4780b6 Update install_tool 2020-10-29 14:04:01 -07:00
David Tomaschik
8e79910857 dfh alias 2020-10-28 16:53:57 -07:00
David Tomaschik
999ef09790 Remove old unused keys. 2020-10-27 10:00:32 -07:00
David Tomaschik
2f9841e2ac Fix up tools 2020-10-25 20:13:50 -07:00
David Tomaschik
2879f63aff ffuf 2020-10-25 20:02:01 -07:00
David Tomaschik
79a3e1f46c Bump submodules. 2020-10-25 15:02:07 -07:00
David Tomaschik
62392e3712 Bump vim-go 2020-10-24 13:20:11 -07:00
David Tomaschik
9717fef420 Add gf support 2020-10-23 09:40:57 -07:00
David Tomaschik
3c83cb1761 Add multiple tool screenshotting capabilities. 2020-10-19 17:59:46 -07:00
David Tomaschik
2a71557663 Update backup.sh 2020-10-16 21:41:36 -07:00
David Tomaschik
b6a2b65704 Remove hashed SSH hosts from completion. 2020-10-13 14:40:17 -07:00
David Tomaschik
398e39b9eb Improve ipython loader 2020-10-11 10:49:15 -07:00
35 changed files with 190 additions and 37 deletions

View File

@@ -26,5 +26,8 @@ function verify_dest {
verify_dest "$DEST" verify_dest "$DEST"
exec nice rsync -Hax --delete --exclude-from="$HOME/.rsync_ignore" \ time nice rsync -Hax --delete --exclude-from="$HOME/.rsync_ignore" \
--delete-excluded "${HOME}/" "$DEST" --delete-excluded "${HOME}/" "$DEST"
echo "Backup completed..."
time sync
echo "Run finished, safe to unmount."

View File

@@ -184,6 +184,7 @@ case ${TOOL} in
rm /tmp/mitmproxy.tar.gz rm /tmp/mitmproxy.tar.gz
add_bin_symlink mitmproxy add_bin_symlink mitmproxy
add_bin_symlink mitmweb add_bin_symlink mitmweb
add_bin_symlink mitmdump
;; ;;
esp) esp)
makedest_or_die makedest_or_die
@@ -340,6 +341,21 @@ EOF
chmod +x ${DESTDIR}/tmpmail chmod +x ${DESTDIR}/tmpmail
add_bin_symlink tmpmail add_bin_symlink tmpmail
;; ;;
gf)
install_pkgs golang-go silversearcher-ag
go get -u github.com/tomnomnom/gf
mkdir -p ${HOME}/.config
git clone https://github.com/Matir/gf-patterns.git ${HOME}/.config/gf
;;
ffuf)
go get -u github.com/ffuf/ffuf
;;
gobuster)
go get -u github.com/OJ/gobuster
;;
amass)
go get -u github.com/OWASP/Amass/cmd/amass
;;
*) *)
echo "Unknown tool: ${TOOL}" >/dev/stderr echo "Unknown tool: ${TOOL}" >/dev/stderr
echo "Options:" >/dev/stderr echo "Options:" >/dev/stderr

62
bin/screenshot.sh Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
# Screenshot tool to try a few different tools
set -ue
TOOLS="flameshot scrot"
SCREENDIR=${SCREENDIR:-${HOME}/Pictures/Screenshots}
SCROT_FORMAT="%F-%T.png"
function default_screenshot_command {
for tool in ${TOOLS} ; do
if which "${tool}" >/dev/null 2>&1 ; then
echo "${tool}"
return 0
fi
done
exit 1
}
TOOL=${SHOT:-$(default_screenshot_command)}
CMD=${1:-region}
function flameshot_gui_capture {
flameshot gui -p "${SCREENDIR}"
}
function flameshot_region_capture {
flameshot_gui_capture
}
function flameshot_window_capture {
flameshot_gui_capture
}
function flameshot_full_capture {
flameshot full -p "${SCREENDIR}"
}
function scrot_region_capture {
scrot -s "${SCREENDIR}/${SCROT_FORMAT}"
}
function scrot_window_capture {
scrot -u "${SCREENDIR}/${SCROT_FORMAT}"
}
function scrot_full_capture {
scrot "${SCREENDIR}/${SCROT_FORMAT}"
}
case "${CMD}" in
region|window|full)
mkdir -p "${SCREENDIR}"
${TOOL}_${CMD}_capture
exit $?
;;
*)
echo "Usage: $0 [region|window|full]" >/dev/stderr
exit 1
;;
esac

View File

@@ -50,3 +50,6 @@ alias ipy="ipython3"
# Skip the header on bc # Skip the header on bc
alias bc="command bc -q" alias bc="command bc -q"
# Get a decently readable df
alias dfh="df -h -x tmpfs -x devtmpfs"

View File

@@ -1,9 +1,10 @@
# Beware! This file is rewritten by htop when settings are changed in the interface. # Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly. # The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1 fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=47 sort_key=46
sort_direction=1 sort_direction=-1
hide_threads=0 tree_sort_key=0
tree_sort_direction=1
hide_kernel_threads=1 hide_kernel_threads=1
hide_userland_threads=1 hide_userland_threads=1
shadow_other_users=0 shadow_other_users=0
@@ -12,15 +13,27 @@ show_program_path=1
highlight_base_name=0 highlight_base_name=0
highlight_megabytes=1 highlight_megabytes=1
highlight_threads=1 highlight_threads=1
highlight_changes=0
highlight_changes_delay_secs=5
find_comm_in_cmdline=1
strip_exe_from_cmdline=1
show_merged_command=0
tree_view=0 tree_view=0
tree_view_always_by_pid=0
header_margin=1 header_margin=1
detailed_cpu_time=0 detailed_cpu_time=0
cpu_count_from_zero=0 cpu_count_from_one=1
show_cpu_usage=1
show_cpu_frequency=0
show_cpu_temperature=0
degree_fahrenheit=0
update_process_names=0 update_process_names=0
account_guest_in_cpu_meter=0 account_guest_in_cpu_meter=0
color_scheme=6 color_scheme=6
enable_mouse=1
delay=15 delay=15
left_meters=AllCPUs Memory Swap left_meters=AllCPUs Memory Swap
left_meter_modes=1 1 1 left_meter_modes=1 1 1
right_meters=Tasks LoadAverage Uptime right_meters=Tasks LoadAverage Uptime
right_meter_modes=2 2 2 right_meter_modes=2 2 2
hide_function_bar=0

View File

@@ -158,20 +158,15 @@ bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10 bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10
# screenshots # screenshots
set $scrotformat %F-%T.png # region/selection
set $screendir ~/Pictures/Screenshots
# whole screen
bindsym --release Print exec --no-startup-id \ bindsym --release Print exec --no-startup-id \
mkdir -p $screendir && \ ~/bin/screenshot.sh region
/usr/bin/scrot $screendir/$scrotformat # full screen
# current window
bindsym --release Shift+Print exec --no-startup-id \ bindsym --release Shift+Print exec --no-startup-id \
mkdir -p $screendir && \ ~/bin/screenshot.sh full
/usr/bin/scrot -u $screendir/$scrotformat # single window
# selection
bindsym --release $alt+Sys_Req exec --no-startup-id \ bindsym --release $alt+Sys_Req exec --no-startup-id \
mkdir -p $screendir && \ ~/bin/screenshot.sh window
/usr/bin/scrot -s $screendir/$scrotformat
# useful utilities # useful utilities
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets

View File

@@ -46,7 +46,7 @@ export GPG_ID=7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B
# Setup locale # Setup locale
if test -x /usr/bin/locale ; then if test -x /usr/bin/locale ; then
for l in en_US.utf8 C.UTF-8 C ; do for l in en_US.utf8 en_US.UTF-8 C.UTF-8 C ; do
if /usr/bin/locale -a | grep -q "${l}" ; then if /usr/bin/locale -a | grep -q "${l}" ; then
export LC_CTYPE=${l} export LC_CTYPE=${l}
export LC_NUMERIC=${l} export LC_NUMERIC=${l}

View File

@@ -69,3 +69,5 @@
path = ~/.gitconfig.local path = ~/.gitconfig.local
[pull] [pull]
rebase = false rebase = false
[init]
defaultBranch = main

View File

@@ -5,11 +5,14 @@
.arduino* .arduino*
.bundle .bundle
.cache .cache
.dropbox-dist
.gradle .gradle
.histfile .histfile
.local/share/Steam .local/share/Steam
.local/share/Trash .local/share/Trash
.local/lib
.rvm* .rvm*
.sliver
.sqlite_history .sqlite_history
.thumbnails .thumbnails
.wine .wine

View File

@@ -1,7 +1,27 @@
#!/bin/sh #!/bin/sh
REMOTE_LINK="${HOME}/.ssh/remote_agent.sock" # Roughly based on this article:
# https://werat.github.io/2017/02/04/tmux-ssh-agent-forwarding.html
if test \! -e "${REMOTE_LINK}" -a -n "${SSH_AUTH_SOCK}" ; then REMOTE_LINK="${HOME}/.ssh/ssh_auth_sock"
if [ "${1:-}" = "force" ] && [ -S "${SSH_AUTH_SOCK}" ] ; then
ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}"
exit 0
fi
if test \! -S "${REMOTE_LINK}" -a -S "${SSH_AUTH_SOCK}" ; then
ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}" ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}"
fi fi
# Handle X forwarding, per sshd(8)
if read proto cookie && [ -n "$DISPLAY" ]; then
if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then
# X11UseLocalhost=yes
echo add unix:`echo $DISPLAY |
cut -c11-` $proto $cookie
else
# X11UseLocalhost=no
echo add $DISPLAY $proto $cookie
fi | xauth -q -
fi

View File

@@ -1,6 +1,9 @@
# Update environment on reconnect # Update environment on reconnect
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION" set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION"
# Use symlink socket
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
# Custom binds # Custom binds
bind K confirm kill-server bind K confirm kill-server
bind X confirm kill-window bind X confirm kill-window

View File

@@ -23,7 +23,8 @@ set expandtab
set shiftround set shiftround
set backspace=indent,eol,start set backspace=indent,eol,start
" Shift-tab to go backwards in insert mode " Shift-tab to go backwards in insert mode
imap <S-Tab> <Esc><<A " Does not work with YCM
inoremap <S-Tab> <C-d>
" Line numbering, ruler " Line numbering, ruler
set number set number

View File

@@ -89,6 +89,7 @@ bindkey "^[[3~" delete-char
# Source extras and aliases if interactive # Source extras and aliases if interactive
if [[ $- == *i* ]] ; then if [[ $- == *i* ]] ; then
if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi
if [[ -e $HOME/.aliases.local ]] ; then source $HOME/.aliases.local ; fi
# zsh-only-ism to avoid error if glob doesn't expand # zsh-only-ism to avoid error if glob doesn't expand
for file in $HOME/.zshrc.d/[a-zA-Z0-9]*.zsh(N) ; do for file in $HOME/.zshrc.d/[a-zA-Z0-9]*.zsh(N) ; do
source "$file" source "$file"
@@ -119,6 +120,14 @@ if [[ $- == *i* ]] ; then
bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down bindkey -M vicmd 'j' history-substring-search-down
fi fi
# Suggestions
if test -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ; then
# Works well for solarized
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=10"
# Strategy -- note that 'completion' is slow AF
ZSH_AUTOSUGGEST_STRATEGY=(history)
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fi
fi # End interactive-only block fi # End interactive-only block
# In case ack is named ack-grep # In case ack is named ack-grep

View File

@@ -0,0 +1,5 @@
#compdef gf
function _gf {
_arguments "1: :($(gf -list))"
}

View File

@@ -0,0 +1,9 @@
function dmesg {
if [ $(id -u) -eq 0 ] ; then
command dmesg "$@"
elif id | grep -q '(sudo)' ; then
sudo dmesg "$@"
else
command dmesg "$@"
fi
}

View File

@@ -1,3 +1,3 @@
if which ipython >/dev/null 2>/dev/null ; then if command -v ipython >/dev/null || command -v ipython3 >/dev/null ; then
export PYTHONSTARTUP="${HOME}/.ipython.py" export PYTHONSTARTUP="${HOME}/.ipython.py"
fi fi

View File

@@ -10,8 +10,8 @@ zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns '<->.<->.<->.<-
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->' zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns adm bin daemon halt lp named shutdown sync zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns adm bin daemon halt lp named shutdown sync
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=( zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \ ${=${${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
/dev/null)"}%%[# ]*}//,/ } /dev/null)"}%%[# ]*}##\|*}//,/ }
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*} ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}} ${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
)' )'

View File

@@ -0,0 +1,7 @@
function vmstat {
local _extra_args
if [ "$(tput cols)" -gt 80 ] ; then
_extra_args="-w"
fi
command vmstat ${_extra_args} "$@"
}

View File

@@ -181,7 +181,7 @@ install_gpg_keys() {
return 0 return 0
local key local key
for key in ${BASEDIR}/keys/gpg/* ; do for key in ${BASEDIR}/keys/gpg/* ; do
gpg --import < ${key} >/dev/null gpg --import < ${key} >/dev/null 2>&1
done done
} }
@@ -433,3 +433,5 @@ case $OPERATION in
exit 1 exit 1
;; ;;
esac esac
echo "OK"

View File

@@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClvMvarQvGaFYhUazA+GN0C2XaU4vHmsvD3G99PJqmd9SGrzSvWw2ZuJwYWQCag4Ft5Zy/A3NZ0/a4ohPbWFF4iX9LnAqSKgMDPv3R3VokW04bFm5uDhXF0lJDOWb8aJuFl56SP2lnbWyP8P8d+3MaFCcuw3F23CS/0ZO5w7CsPsHkvWkmykCB6z/Ju/kqvXK5qYKjAVkZ80LMDNppjN5zZhFZs721zuuMmpFevcfG5c43KujcR/yDfB+t3yfWmaWi21KDapdHXk5lQoxsg6OZe6Wuj7jQq+Zol+ElxD+gn7z2LWXq8a3wyyvGSoKyBfHBjrwzEuUEFbvn5iatPJVX davidtomaschik@davidtomaschik-glaptop2

View File

@@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXvqt73qAqS8C597u1wjz0Cvfo1IpiQFE4OKxTBR0mUhhi9UsGXkjZd/EYnqfWQRLcKaQSqN9QcXW7zHrfXtdmcjr3dDZrwXGgCiJnvLTeLecLqYwgaIMMNTmgaTQ3OFB74VCeD496pMbnhmlsN2+WaxNjIxoX+Qadsq/iHtBBt+tSOm5E1x0/ynEGmvO1W0L+8FyV/xnZWQIbBHTrJ931Gt8RDKtt7Y24XYMm5REye40adbxeS4kBwexvp2nTKwkr8sC26dmOz/RgJG3Km1194r0RXsH7iCYYlUBT23f4KOcmVxUlxkSu5d0u2viEID++cN6LT/4rHPdgqMZaVhaB root@uber

View File

@@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ5FLvZsfIfNV8NcUK6+wJ8pDapgu8QAZMX5zuz+fYxsf3KeHlDS0nPojmDLCXaAdd4TUO7KlRyo8BhpsWP8yUwpxUeRgvtYjjWfDgSxXCsGpQzbmTABu8eIaSya00Fao/WeIV1k+2p6S80knmllrBVideGW9ws4zrVQnhOcgKVXskuFBEs3IOQczNPMfI+OnO+qca0rjUh1Z6k3tD6tN6pxh//5CZBgqYf4G1DLnCLIep7tDkTuYjgqH237r6v4WHH87sLRy21yFRzfMWUGPesJvuc8X4Ol822BuQWTCDYy+QYZ9qGDWPcLOLCg7MLP9IVKzIJOrAdOYyp6p2brzj davidtomaschik@uber.g

View File

@@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3CLK0KLup0y8nb1l5X9LTVsvJG1scc7qbLJZIdGC0TlFeAbzUwXmxxJUY/dl/2JKGj9Ai3h393WzxH//tMY4jYLhMLqV487YvteVF+2yVS+q0YtO4RgM6TVOvdp1b4Fgj4EB5hTaO0hB51PxTqnVAK0ZMAuUxQRygpARnB+xwhLU2l0K07RHgpMirWODzzlgD3Y9I+3WIpmAwzubaoS1/R0Frf81ZWQmgvwac6PKsPwvGLygS1ounOwD2PJScP+sE/t2MEYjtqmmAytqsp5kLVkb82fJSkdj1DuHblgZr4aX9r04bVV1ju19CN57VyhbZtf+fBqQQW1lnjMYm9Kjn matir_pvj

View File

@@ -6,6 +6,7 @@ fonts-inconsolata
fonts-powerline fonts-powerline
gimp gimp
keepassx keepassx
meld
network-manager-openvpn-gnome network-manager-openvpn-gnome
solaar solaar
vim-gtk vim-gtk

View File

@@ -4,6 +4,7 @@ cryptsetup
dsniff dsniff
ecryptfs-utils ecryptfs-utils
exuberant-ctags exuberant-ctags
httpie
iftop iftop
iptraf iptraf
ipython ipython
@@ -34,10 +35,12 @@ python3-scapy
python3-pip python3-pip
python3-virtualenv python3-virtualenv
radare2 radare2
ripgrep
scapy scapy
scdaemon scdaemon
socat socat
source-highlight source-highlight
sqlite3 sqlite3
ufw ugrep
vim-youcompleteme
zsh-syntax-highlighting zsh-syntax-highlighting