429 Commits

Author SHA1 Message Date
David Tomaschik
2ab9bd3452 Update bsidessf config 2022-05-08 17:23:21 -07:00
David Tomaschik
b68c1e2c65 Update gitignore 2022-05-08 17:23:12 -07:00
David Tomaschik
3c8d8ca5e1 Starship support. 2022-05-08 16:01:23 -07:00
David Tomaschik
f6e6c42b26 kubeconform install_tool 2022-05-05 21:14:35 -07:00
David Tomaschik
7165e7c93f Revert "Add kubeval to install_tool."
This reverts commit dea863ee35.
2022-05-05 21:11:29 -07:00
David Tomaschik
63f401c84b Fix gitconfig 2022-05-05 21:11:09 -07:00
David Tomaschik
dea863ee35 Add kubeval to install_tool. 2022-05-05 18:38:28 -07:00
David Tomaschik
d01a320de7 ropper recipe 2022-05-01 16:40:44 -07:00
David Tomaschik
0564dbbb3d Bump config_bsidessf 2022-04-30 11:33:50 -07:00
David Tomaschik
1efa61a9f4 Add duf to packages.cli 2022-03-19 16:33:27 -07:00
David Tomaschik
77a01d2fda Enable delta line-numbers 2022-03-19 15:55:36 -07:00
David Tomaschik
71711a5cc0 Use delta when available 2022-03-19 15:53:34 -07:00
David Tomaschik
a49474fe60 Add more tools 2022-03-19 15:23:50 -07:00
David Tomaschik
2217cfb47b batcat -> bat alias 2022-03-19 14:21:00 -07:00
David Tomaschik
75b0c5db9e Update tools 2022-03-17 18:23:27 -07:00
David Tomaschik
50174a4f72 Add misc functions 2022-03-11 12:36:02 -08:00
David Tomaschik
04470627c6 Add more to rsync_ignore 2022-03-11 12:31:33 -08:00
David Tomaschik
e6318c4cc1 Packages bump for jc 2022-02-27 12:32:41 -08:00
David Tomaschik
15b575c34d install_tool: tldr 2022-02-06 12:44:07 -08:00
David Tomaschik
2db123c772 HashKnownHosts no 2022-02-05 15:38:04 -08:00
David Tomaschik
2de511f5f3 Add docker-compose to install_tool 2022-02-01 21:10:26 -08:00
David Tomaschik
890a24ec07 Remove rvm 2022-01-18 19:44:25 -08:00
David Tomaschik
a3aaed6c0c Add nvim to package list 2022-01-14 22:22:44 -08:00
David Tomaschik
9f4fbfb06a split package names 2022-01-14 20:57:33 -08:00
David Tomaschik
273d6b495f Ctrl-H is backspace 2022-01-06 22:02:59 -08:00
David Tomaschik
d41703820d nvim compatibility 2022-01-06 21:59:34 -08:00
David Tomaschik
5748d014f1 Add arch path for zsh-syntax-highlighting. 2021-11-19 22:33:14 -08:00
David Tomaschik
2779322b24 Fix ls colors 2021-11-15 10:36:20 -08:00
David Tomaschik
50948acee4 Fix profile syntax errors 2021-11-15 10:24:45 -08:00
David Tomaschik
670cf5c8dc Add LIBVIRT_DEFAULT_URI to profile. 2021-11-14 15:22:40 -08:00
David Tomaschik
d213b3b234 Fix find command 2021-11-07 20:57:19 -08:00
David Tomaschik
37d606cc49 Move setup scripts 2021-11-07 18:48:32 -08:00
David Tomaschik
8f57fad78c Shellcheck cleanups in install.sh 2021-11-07 16:41:41 -08:00
David Tomaschik
f8ddb56b02 Switch out which for command -v in install.sh 2021-11-07 15:49:09 -08:00
David Tomaschik
1f59627da9 Remove ctrlp 2021-11-01 19:12:31 -07:00
David Tomaschik
2c88a59188 Move syntastic/vim-go to matir-extra 2021-10-31 10:30:24 -07:00
David Tomaschik
9ec67f4c1c XFCE4 configs 2021-10-22 14:48:54 -07:00
David Tomaschik
db3193e0bc Update telemetry 2021-10-21 14:08:20 -07:00
David Tomaschik
9c83b8fc40 Bump fugitive version 2021-10-14 19:38:34 -07:00
David Tomaschik
3da887ffad Add fish vars 2021-10-14 12:07:18 -07:00
David Tomaschik
f56b7d0b7b Merge branch 'main' of https://github.com./Matir/skel 2021-10-14 12:07:10 -07:00
David Tomaschik
e18e66391b Update age path. 2021-10-14 12:07:04 -07:00
David Tomaschik
8b66586fe8 install_tool: include list of tools in usage 2021-10-06 11:31:53 -07:00
David Tomaschik
ac4109cee6 Merge branch 'main' of https://github.com./Matir/skel 2021-09-16 11:08:10 -07:00
David Tomaschik
99af2287c5 Add bracketed paste mode to vimrc. 2021-09-16 11:07:56 -07:00
David Tomaschik
6adaaffabd Disable syntastic active mode in readonly mode. 2021-08-20 18:39:18 -07:00
David Tomaschik
c6f217d47c Merge branch 'main' of https://github.com./Matir/skel 2021-08-20 15:13:49 -07:00
David Tomaschik
733093ee7a Add SJCA pem 2021-08-20 15:13:23 -07:00
David Tomaschik
441a533e2a Update install_tool 2021-08-17 16:39:43 -07:00
David Tomaschik
8d30879224 Update install_tool 2021-08-15 21:49:25 -07:00
David Tomaschik
f94a4dc67c Fix gf patterns in install_tool. 2021-08-14 12:38:34 -07:00
David Tomaschik
0bb950b053 Remove deleted key. 2021-07-12 20:18:09 -07:00
David Tomaschik
4ec8f22ab8 Don't load YCM in a virtualenv. 2021-07-04 21:39:25 -07:00
David Tomaschik
ba0c734b06 Merge branch 'main' of https://github.com./Matir/skel 2021-06-27 18:50:21 -07:00
David Tomaschik
f24e3ebb24 Bump tools zip 2021-06-27 18:50:10 -07:00
David Tomaschik
4af40de24b Add age to install_tool 2021-06-08 11:23:14 -07:00
David Tomaschik
351b136cbc Support disabling gpg-agent. 2021-06-06 22:08:45 -07:00
David Tomaschik
a5b0677903 Updates 2021-05-27 19:44:42 -07:00
David Tomaschik
ebf5c1cd22 Update ssh keys 2021-05-25 20:53:51 -07:00
David Tomaschik
94abfa2fe2 Add gh/config.yml 2021-05-13 14:32:05 -07:00
David Tomaschik
15f5f91e2a Change default pager to less. 2021-05-13 12:53:34 -07:00
David Tomaschik
2b6229acc3 Improve prune-broken-symlinks 2021-05-12 11:46:29 -07:00
David Tomaschik
e05a6aa473 Correctly pick first browser choice. 2021-05-11 15:06:10 -07:00
David Tomaschik
673fca3c05 Scratchpad keybinds 2021-04-20 21:18:48 -07:00
David Tomaschik
f6a7b372b7 Install tool: cht.sh 2021-04-19 12:10:48 -07:00
David Tomaschik
685fb22dd3 Merge branch 'main' of https://github.com./Matir/skel 2021-04-17 13:50:47 -07:00
David Tomaschik
e788dedf69 Support pip path 2021-04-16 20:23:48 -07:00
David Tomaschik
a482092fdb More install_tool 2021-04-10 21:01:59 -07:00
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
David Tomaschik
f6b5cd90fc Update packages 2020-10-11 08:49:01 -07:00
David Tomaschik
1d14f294eb Add powerline fonts 2020-10-11 06:42:43 -07:00
David Tomaschik
f3cb3607db Support agnoster prompt 2020-10-11 06:42:29 -07:00
David Tomaschik
d117ee6b2e Don't jump to a position within git commits in vim. 2020-10-09 16:34:59 -07:00
David Tomaschik
7e249843a6 Fix ls output redirection 2020-10-03 15:22:05 -07:00
David Tomaschik
465bfd37f1 Use only posix find in prune-broken-symlinks 2020-10-03 15:18:57 -07:00
David Tomaschik
5ad1ad4616 Fix shell grouping. 2020-10-03 15:17:59 -07:00
David Tomaschik
e82cad68e1 Update chrome path. 2020-09-20 19:43:54 -07:00
David Tomaschik
5e372e2b35 Update scripts and backups. 2020-09-19 19:16:57 -07:00
David Tomaschik
9e392af7d1 Add tmpmail script. 2020-09-16 13:16:59 -07:00
David Tomaschik
68bcf536cb Add command-not-found support 2020-09-07 21:51:47 -07:00
David Tomaschik
698f2defa9 Add htoprc 2020-09-05 14:03:45 -07:00
David Tomaschik
a42128f5c9 Add bc alias 2020-08-27 15:09:09 -07:00
David Tomaschik
6559acbf90 Merge branch 'master' of https://github.com./Matir/skel into master 2020-08-23 19:50:14 -07:00
David Tomaschik
a654a7747c Fix duf 2020-08-23 19:49:25 -07:00
David Tomaschik
d158a0a373 Usage util duf. 2020-08-23 19:46:13 -07:00
David Tomaschik
229d5353e3 Merge branch 'master' of https://github.com./Matir/skel 2020-08-11 17:07:54 -07:00
David Tomaschik
20389cba90 Setup gitconfig.local during install. 2020-08-11 17:07:44 -07:00
David Tomaschik
aaf56b794d Add AWS CLI to install_tool 2020-08-07 11:50:21 -07:00
David Tomaschik
827665279a Add qdisc_span script. 2020-08-02 21:55:19 -07:00
David Tomaschik
8467bfce20 Add solaar for mouse stuff 2020-07-27 12:54:46 -07:00
David Tomaschik
116ae13896 Add logid.conf 2020-07-24 16:36:42 -07:00
David Tomaschik
0f08f9710a Add logiops to install_tool 2020-07-22 13:07:54 -07:00
David Tomaschik
9c147af8c1 Allow configuring locktime by environment variable. 2020-07-18 15:53:03 -07:00
David Tomaschik
5e498f9bcd Change test 2020-07-13 16:26:21 -07:00
David Tomaschik
1cab41bfd5 Avoid error working in .git directory 2020-07-12 18:05:30 -07:00
David Tomaschik
3e225ae2ab Fix env for GOPATH 2020-07-12 18:05:09 -07:00
David Tomaschik
cc15b17e28 Tool to hold nvidia packages. 2020-07-12 18:04:46 -07:00
David Tomaschik
7aa9e57a59 Update sourcing for gcloud completions. 2020-07-08 15:00:07 -07:00
David Tomaschik
530b205b3d More history functions. 2020-07-08 14:57:47 -07:00
David Tomaschik
0bed0a80a3 Add firacode to package list. 2020-07-07 14:30:52 -07:00
David Tomaschik
244c5da0e7 Update clone script. 2020-07-05 12:37:38 -07:00
David Tomaschik
e885afbff9 Local t box 2020-06-29 21:34:07 -07:00
David Tomaschik
8a0e4cd774 Enable trim on via USB-SATA via udev. 2020-06-29 21:34:07 -07:00
David Tomaschik
5cf313140c Add nmap-parse-output to install_tool. 2020-06-29 12:53:18 -07:00
David Tomaschik
f0c3ab8753 Add i3 sleep keybind. 2020-06-24 08:00:20 -07:00
David Tomaschik
8cd3682a23 Also bind F13 to Mic Mute 2020-06-13 18:22:14 -07:00
David Tomaschik
ee83a40686 Update how we set SSH_AUTH_SOCK. 2020-06-13 18:22:14 -07:00
David Tomaschik
7f9a3774ae Change where path is set. 2020-06-07 11:33:06 -07:00
David Tomaschik
8d7c76b227 Support cargo/rust. 2020-05-23 17:57:14 -07:00
David Tomaschik
0a92dd0ed7 Add rr to install_tool. 2020-05-13 12:36:51 -07:00
David Tomaschik
eae69fe414 Fix Cura install 2020-05-04 12:05:36 -07:00
David Tomaschik
dcef7445b2 Use pactl_helper for i3 keybindings. 2020-04-21 09:02:29 -07:00
David Tomaschik
11d1086a68 Stop adjusting extension in wget. 2020-04-20 14:53:04 -07:00
David Tomaschik
a88d120b3c Add a pulseaudio helper. 2020-04-20 14:53:04 -07:00
David Tomaschik
15479f3829 Add ipy alias. 2020-04-18 20:07:29 -07:00
David Tomaschik
9178794de5 python2->python3 fixes in install_tool 2020-04-16 20:48:03 -07:00
David Tomaschik
fc120b66fe Add cura to install_tool. 2020-04-16 20:48:03 -07:00
David Tomaschik
57b181bd74 Bindkey fix for delete key. 2020-04-13 11:51:10 -07:00
David Tomaschik
aa6a2e806d Add ssh alias for non-checking ssh. 2020-04-05 23:17:48 -07:00
David Tomaschik
eec3c9ba7a Improve google-chrome-burp script. 2020-04-05 23:17:48 -07:00
David Tomaschik
d67b18f2ea Disable xmllint checkers. 2020-04-01 12:48:59 -07:00
David Tomaschik
72b82ff2e3 Setup searchsploit_rc. 2020-03-31 10:20:50 -07:00
David Tomaschik
6492beb726 Add exploitdb to install_tool. 2020-03-31 10:06:06 -07:00
David Tomaschik
08142409f8 Set git pull to merge, not rebase. 2020-03-31 09:58:45 -07:00
David Tomaschik
8225785dcc Only FF when running pull from install script. 2020-03-30 15:49:03 -07:00
David Tomaschik
c7c97b84c5 Enhanced zshrc logging. 2020-03-27 20:54:17 -07:00
David Tomaschik
f9ce8b3df8 Use "bundle exec" to wrap jekyll commands. 2020-03-21 20:21:53 -07:00
David Tomaschik
69c1184b58 Add userns.conf. 2020-03-12 23:09:15 -07:00
David Tomaschik
7e432287ac llvm too. 2020-03-12 20:36:00 -07:00
David Tomaschik
50cb109c99 Add clang dependencies for afl++. 2020-03-12 20:26:18 -07:00
David Tomaschik
c915b20450 Merge branch 'master' of https://github.com./Matir/skel 2020-03-11 14:55:17 -07:00
David Tomaschik
f3ea935dd5 AFLplusplus in tools. 2020-03-11 14:55:04 -07:00
David Tomaschik
a6414425b7 Add srcless alias. 2020-03-07 18:48:29 -08:00
David Tomaschik
ad73f12103 Fix gitroot alias. 2020-02-21 18:29:06 -08:00
David Tomaschik
7d35ace5bb Vimrc: remember position and return to it. 2020-02-21 17:18:08 -08:00
David Tomaschik
e4f2cc94b5 Disable ControlMaster for cloud shell. 2020-02-02 13:36:19 -08:00
David Tomaschik
fcbe2e781b Add 1 git-crypt collaborator
New collaborators:

	5DEA789B David Tomaschik <david@systemoverlord.com>
2020-01-26 18:23:28 -08:00
David Tomaschik
7a5abd73cb Fix symlinks for submodules.
This fixes the creation of symlinks for submodules when
run from outside the repo.

Fixes #7.
2020-01-26 17:57:15 -08:00
David Tomaschik
07926d6673 Fix virtualenv formatting of prompt.
Fixes #11.
2020-01-26 16:10:27 -08:00
David Tomaschik
24690e8399 Bump gcloud sdk to 277. 2020-01-25 16:39:36 -08:00
David Tomaschik
2232dce811 Add a gitconfig.local file. 2020-01-19 19:18:41 -08:00
David Tomaschik
f6de62700a Add a gitroot alias. 2020-01-19 19:14:40 -08:00
David Tomaschik
01272f4474 Configure XDG user dirs. 2020-01-19 18:58:08 -08:00
David Tomaschik
e176b0c136 Add gcloud configurations. 2020-01-19 18:52:55 -08:00
David Tomaschik
67fad831e5 Update luksFormat alias. 2019-12-18 19:16:50 -08:00
David Tomaschik
048d7fb1ba Lazy load of kubectl. 2019-12-07 22:46:31 -08:00
David Tomaschik
24c1c8edfb Update pubkey. 2019-11-23 22:42:26 -08:00
David Tomaschik
614adeed08 Deprecate grc. 2019-11-16 12:11:23 -08:00
David Tomaschik
12a92703f0 Re-fix grc ls options. 2019-11-14 22:23:00 -08:00
David Tomaschik
288a9c3a7e Cleanup command substitution styles. 2019-11-12 17:19:10 -08:00
David Tomaschik
2419693164 Simplify preference variables. 2019-11-12 16:54:12 -08:00
David Tomaschik
b8607f4bdc No need to pass -C to ls. 2019-11-01 18:11:38 -07:00
David Tomaschik
5c2289e283 Basic script to clone and install. 2019-10-29 17:45:50 -07:00
David Tomaschik
deb8b62c12 Make install git pull before installing. 2019-10-29 17:39:13 -07:00
David Tomaschik
8e984d3c3b Add grc conf.mount 2019-10-19 12:52:36 -07:00
David Tomaschik
eb0206575a Add skelify function. 2019-10-19 12:47:14 -07:00
David Tomaschik
44d273dd7c Add werdlists to install_tool. 2019-10-11 10:57:29 -07:00
David Tomaschik
8029afc15a Update coloring. 2019-10-10 22:38:48 -07:00
David Tomaschik
f5766e7661 Customize df output with grc. 2019-10-10 20:51:04 -07:00
David Tomaschik
88c096cd95 Clean up shellcheck warnings in install_tool. 2019-10-10 13:25:49 -07:00
David Tomaschik
3005abff34 Update git aliases. 2019-10-08 16:29:06 -07:00
David Tomaschik
8b9c9581e4 Merge pull request #10 from Matir/doc
Cleanup README.
2019-10-02 21:58:54 -07:00
David Tomaschik
9d85ae77fa Cleanup README. 2019-10-02 21:58:29 -07:00
David Tomaschik
693b349024 Merge pull request #9 from Matir/jekyll_esc
Fix escaping of Jekyll titles.
2019-10-02 21:43:41 -07:00
David Tomaschik
a82e0cdb37 Fix escaping of Jekyll titles. 2019-10-02 21:43:01 -07:00
David Tomaschik
80d0b2844e Merge pull request #8 from Matir/zshopt
Reformat zsh options as upper case.
2019-10-02 21:14:52 -07:00
David Tomaschik
7f40245bb0 Reformat zsh options as upper case. 2019-10-02 21:13:03 -07:00
David Tomaschik
157fa34915 Fix up keymap display on line init. 2019-09-30 22:04:24 -07:00
David Tomaschik
2a359f1a02 ACPI Temperature alias. 2019-09-29 19:18:17 -07:00
David Tomaschik
c3f41435da Quieter gpg-agent. 2019-09-27 19:24:44 -07:00
David Tomaschik
aa3a1e0237 Remove prezto entirely. 2019-09-27 16:51:26 -07:00
David Tomaschik
68e53c426b More cleanup. 2019-09-27 16:42:58 -07:00
David Tomaschik
fcb04c0ae7 More cleanup. 2019-09-27 15:56:36 -07:00
David Tomaschik
b096fd2a24 Drop more prezto deps. 2019-09-27 13:16:39 -07:00
David Tomaschik
cc94650bad Even fewer deps. 2019-09-27 00:03:56 -07:00
David Tomaschik
1b2f75ca47 Reduce prezto deps. 2019-09-26 23:43:31 -07:00
David Tomaschik
55064a548d Really fix package installation. 2019-09-26 22:49:54 -07:00
David Tomaschik
cb051b8686 Fix testing for packages. 2019-09-26 22:30:58 -07:00
David Tomaschik
fae0e69619 Bump submodules. 2019-09-26 22:06:34 -07:00
David Tomaschik
d21e21ebf6 Merge branch 'master' of https://github.com./Matir/skel 2019-09-26 22:03:50 -07:00
David Tomaschik
ff14dcaf56 Prune package list better. 2019-09-26 22:03:39 -07:00
David Tomaschik
83645e39ee Bump submodules. 2019-09-26 10:44:18 -07:00
David Tomaschik
73f4cdfb20 Bump submodules. 2019-09-26 00:00:54 -07:00
David Tomaschik
ec06c2fcb2 Merge branch 'master' of https://github.com./Matir/skel 2019-09-25 23:59:18 -07:00
David Tomaschik
6c49de9512 Remove shallow clones, they cause trouble. 2019-09-25 23:59:08 -07:00
David Tomaschik
ef16b33fd8 Improve gef support. 2019-09-23 13:31:03 -07:00
David Tomaschik
ba56fb89b3 Merge branch 'master' of https://github.com./Matir/skel 2019-09-23 10:09:49 -07:00
David Tomaschik
395297e08b Update benchmark for variable size. 2019-09-22 19:34:05 -07:00
David Tomaschik
a20636347c Switch to trap for benchmark cleanup. 2019-09-22 19:24:29 -07:00
David Tomaschik
170c3f0e9f Add disk benchmark script. 2019-09-22 19:22:49 -07:00
David Tomaschik
b45f977de9 Use vimdiff. 2019-09-22 19:22:34 -07:00
David Tomaschik
df4e87fdf2 Update submodules. 2019-09-17 15:10:51 -07:00
David Tomaschik
40fa505146 Update metasploit.sh 2019-09-10 21:46:36 -07:00
David Tomaschik
9076b9f07e Bump submodules. 2019-09-10 21:00:01 -07:00
David Tomaschik
ac2b8650b8 Add support for gef. 2019-09-02 21:30:11 -07:00
David Tomaschik
5353336b9d Bump submodules. 2019-09-02 21:30:01 -07:00
David Tomaschik
78a9dc5835 Bump submodules. 2019-08-30 20:08:15 -07:00
David Tomaschik
57fff46dd8 Merge branch 'master' of https://github.com./Matir/skel 2019-08-30 20:07:39 -07:00
David Tomaschik
59cc1e6ed9 Update tmux styles for 2.9. 2019-08-30 20:05:04 -07:00
David Tomaschik
748b113fe9 Fixup locale. 2019-08-25 22:24:15 -07:00
David Tomaschik
b920e94cc5 Bump solarized8. 2019-08-23 20:13:46 -07:00
David Tomaschik
ea63773f4f Add rvmrc. 2019-08-23 10:53:17 -07:00
David Tomaschik
4bea5020b1 Merge branch 'master' of https://github.com./Matir/skel 2019-08-19 19:19:56 -07:00
David Tomaschik
0c5a5e6fc9 Bump zprezto. 2019-08-19 19:06:44 -07:00
David Tomaschik
6b659ac9a9 Bump vim plugins. 2019-08-19 19:05:24 -07:00
David Tomaschik
b30b40f259 Bump fugitive. 2019-08-19 19:04:34 -07:00
David Tomaschik
43680df2e2 Merge branch 'master' of https://github.com./Matir/skel 2019-08-19 14:54:09 -07:00
David Tomaschik
dc621af59d Avoid error if nothing exists in zshrc.d. 2019-08-19 14:53:40 -07:00
David Tomaschik
5ea16b8ace Update john.conf. 2019-08-13 14:35:23 -07:00
David Tomaschik
b800b624ae Suspend after 10 mins. 2019-07-30 13:53:57 -07:00
David Tomaschik
9364e70986 Add word splitting for xss-lock. 2019-07-30 13:53:12 -07:00
David Tomaschik
4b03c7d9e0 Fix ls alias with grc. 2019-07-29 13:27:27 -07:00
David Tomaschik
937328a833 Disable unused git aliases. 2019-07-25 10:48:55 -07:00
David Tomaschik
699fc2ac66 Add grc 2019-07-25 10:43:24 -07:00
David Tomaschik
803712f0db Merge branch 'master' of https://github.com./Matir/skel 2019-07-24 13:06:29 -07:00
David Tomaschik
2dbc8f33ea Comment things that should not be used anymore. 2019-07-24 13:06:11 -07:00
David Tomaschik
e2361baa37 Merge branch 'master' of https://github.com./Matir/skel 2019-07-13 11:46:12 -07:00
David Tomaschik
1ec5aa8056 Add fonts packages. 2019-07-13 11:45:46 -07:00
David Tomaschik
863e985bc6 Merge branch 'master' of https://github.com./Matir/skel 2019-07-13 11:15:19 -07:00
David Tomaschik
b40cbc1811 Add scar key. 2019-07-12 18:51:42 -07:00
David Tomaschik
5913bbb4c7 Add some package renames. 2019-07-10 19:46:42 -07:00
David Tomaschik
fc621bb31a Changes to Keyserver configuration.
See https://gist.github.com/rjhansen/67ab921ffb4084c865b3618d6955275f
for rationale.
2019-06-29 10:20:53 -07:00
David Tomaschik
d620566562 Add libnotify-bin to i3 install. 2019-06-23 13:22:09 -07:00
David Tomaschik
4d2d8c89f6 i3status: Use default route for ethernet address first. 2019-06-07 16:15:46 -07:00
David Tomaschik
e325cc3b93 Merge branch 'master' of https://github.com./Matir/skel 2019-06-07 14:04:23 -07:00
David Tomaschik
a5dc656656 Add a symlink for SSH_AUTH_SOCK remotely. 2019-06-07 10:42:10 -07:00
David Tomaschik
b1799197fe Set nomodeline. 2019-06-05 10:32:14 -07:00
David Tomaschik
4b37169735 Fix git submodule call to use BASEDIR. 2019-06-04 08:32:15 -07:00
David Tomaschik
2531595828 Add ipython_config. 2019-05-27 14:59:13 -07:00
David Tomaschik
9394758ff9 vimrc updates. 2019-05-25 12:03:01 -07:00
David Tomaschik
713e59fb32 Fix s/set/let/. 2019-05-22 17:10:23 -07:00
David Tomaschik
f0641f4113 Close preview window on exiting insert mode. 2019-05-22 17:08:47 -07:00
David Tomaschik
7739339515 Bump vim-go. 2019-05-22 17:08:03 -07:00
David Tomaschik
af556f0a75 Bump vim-go. 2019-05-21 07:11:49 -07:00
David Tomaschik
90a87e0e93 Merge branch 'master' of github.com:Matir/skel 2019-05-16 21:15:53 -07:00
David Tomaschik
ccb6bcb616 Support the vim-youcompleteme package on Debian. 2019-05-16 21:15:40 -07:00
David Tomaschik
460163089b Merge branch 'master' of https://github.com./Matir/skel 2019-05-04 13:05:11 -07:00
David Tomaschik
448b7a6c4d Disable tracker-store service. 2019-05-04 13:03:32 -07:00
David Tomaschik
24c7171a73 Rearrange vimrc. 2019-04-30 16:36:08 -07:00
David Tomaschik
379ab1c375 Fix install on bash. 2019-04-29 18:27:19 -07:00
David Tomaschik
968c9529c8 Merge branch 'master' of github.com:Matir/skel 2019-04-29 18:06:35 -07:00
David Tomaschik
f96ad7773f Fix xiwibg. 2019-04-29 18:06:14 -07:00
David Tomaschik
03a12e509e Add a bash/zsh compatibility option. 2019-04-29 16:33:17 -07:00
David Tomaschik
19d78117cb Symlink submodules as a whole instead of each file. Fixes #6. 2019-04-29 15:59:58 -07:00
David Tomaschik
1a592beaea Merge branch 'master' of https://github.com./Matir/skel 2019-04-29 15:19:43 -07:00
David Tomaschik
05c2ef7848 Fix double equals in posix shell comparison. 2019-04-29 13:09:39 -07:00
David Tomaschik
17c2767de5 Add syntastic for vim. 2019-04-29 12:58:44 -07:00
David Tomaschik
006188e07d Add xiwibg function. 2019-04-28 18:54:07 -07:00
David Tomaschik
322358b0f0 Add env var to disable zprezto. 2019-04-27 20:28:28 -07:00
David Tomaschik
3db0742889 Add sqliterc. 2019-04-27 20:17:04 -07:00
David Tomaschik
d2849bfe9e Fix comparison operator. 2019-04-27 13:16:44 -07:00
David Tomaschik
ac8fae69c6 Add google public key. 2019-04-26 11:20:28 -07:00
David Tomaschik
1881916c8e Fix darwin LSCOLORS. 2019-04-26 11:07:07 -07:00
David Tomaschik
08952e7f22 LSCOLORS on Darwin. 2019-04-26 11:03:45 -07:00
David Tomaschik
eb0d0ebfc1 Only use dircolors when available. 2019-04-26 10:55:25 -07:00
David Tomaschik
33d9e53327 Add tmux-logging. 2019-04-24 21:49:28 -07:00
David Tomaschik
53fa86ba4a Always recurse modules. 2019-04-24 12:55:13 -07:00
David Tomaschik
b135ee423b Bump vim-go to v1.20 2019-04-23 20:02:41 -07:00
David Tomaschik
25fb3cc6a0 Add hterm prefs. 2019-04-21 13:20:05 -07:00
David Tomaschik
b073e7d61c Not so shallow checkouts. 2019-04-18 19:28:02 -07:00
David Tomaschik
781142e8f2 Only run git if we have it. 2019-04-17 12:00:41 -07:00
David Tomaschik
3e87044901 Do shallow copies. 2019-04-17 10:28:31 -07:00
David Tomaschik
cb01867ba6 Use submodule for zprezto. 2019-04-16 23:36:57 -07:00
David Tomaschik
1fcdb910a2 Improvements. 2019-04-16 23:07:57 -07:00
David Tomaschik
cb5df8e7e6 Merge branch 'master' of github.com:Matir/skel 2019-04-16 23:01:46 -07:00
David Tomaschik
815cf0a6e4 Move pwndbg to tools from dotfile status. 2019-04-16 23:01:40 -07:00
David Tomaschik
72914aa6e1 Remove vundle as I no longer use it. 2019-04-16 22:45:31 -07:00
David Tomaschik
404c9592ec Add histmode on/off commands. 2019-04-15 15:04:30 +02:00
David Tomaschik
c2371d29a6 Bump font sizes. 2019-04-11 16:01:03 +02:00
David Tomaschik
25c03b677a Use solarized palette for LS_COLORS. 2019-04-11 15:56:55 +02:00
David Tomaschik
b9c2e6afb9 Fix solarized foreground from base00 to base0. 2019-04-11 15:34:38 +02:00
David Tomaschik
3f29a03ba4 Support both urlLauncher and url-launcher for URxvt. 2019-04-11 14:57:44 +02:00
David Tomaschik
b4db394761 Export BROWSER as well. 2019-04-11 14:54:47 +02:00
David Tomaschik
a85a9c52be Update some urxvt resources. 2019-04-09 18:18:42 +02:00
David Tomaschik
6be3fde55c Update some urxvt resources. 2019-04-09 18:10:02 +02:00
David Tomaschik
161028537c Fix hinting in xft.
This fixes the weird font issues I had with i3 that I "fixed" by
starting cinnamon-settings-daemon.
2019-04-09 15:53:33 +02:00
David Tomaschik
426fdbd7ee Fixup some startup scripts. 2019-04-09 15:33:53 +02:00
David Tomaschik
90060a290e Use Monospace as backup for Inconsolata. 2019-04-09 13:50:37 +02:00
David Tomaschik
b4c462a66c Set colors properly on urxvt. 2019-04-09 10:53:26 +02:00
David Tomaschik
18d5697827 Add a comment about xterm-256color. 2019-04-08 10:29:28 +02:00
David Tomaschik
75d0943548 Merge branch 'master' of https://github.com./Matir/skel 2019-04-08 10:22:16 +02:00
David Tomaschik
78b9efc04b Add gocode path to GOPATH. 2019-04-08 10:22:13 +02:00
David Tomaschik
6c2bb3ded8 Add vim-go. 2019-04-04 23:24:32 -07:00
David Tomaschik
312036587e Add vim-go. 2019-04-03 14:07:34 -07:00
David Tomaschik
0f97610473 Add id_ecdsa_chromebook.pub to trusted set. 2019-03-31 15:58:10 -07:00
David Tomaschik
c825c6af28 Add more editing tools. 2019-03-29 21:24:59 -07:00
David Tomaschik
394eb7996c Conditionally start ipython. 2019-03-27 22:46:06 -07:00
David Tomaschik
c7619f93dc Support submodules in install. 2019-03-25 21:03:42 -07:00
David Tomaschik
ee67442965 Fix aliases file. 2019-03-21 15:25:05 -07:00
David Tomaschik
f70488eab7 Better support on FreeBSD. 2019-03-21 14:15:09 -07:00
David Tomaschik
4cb51c3bba Add fugitive. 2019-03-21 14:10:17 -07:00
David Tomaschik
d77d76f184 Add more vim plugins. 2019-03-19 21:19:38 -07:00
David Tomaschik
b3224e9ad3 Begin migrating from Vundle to Vim8 packages. 2019-03-19 20:23:54 -07:00
David Tomaschik
6bd457700e Merge branch 'master' of https://github.com./Matir/skel 2019-03-06 13:14:41 -08:00
David Tomaschik
4b189b73dd Only autocomplete root and current user. 2019-03-06 11:24:06 -08:00
David Tomaschik
c86050bc3b Use ipython when available. 2019-03-04 07:40:08 -08:00
David Tomaschik
10cd949696 Add editorconfig VIM plugin. 2019-02-21 22:53:13 -06:00
David Tomaschik
81d4dbbdba Merge branch 'master' of https://github.com./Matir/skel 2018-12-20 13:38:42 -08:00
David Tomaschik
14197fe6c0 Add pwgen. 2018-11-07 10:10:53 -08:00
David Tomaschik
5cda2fc25b Update packages. 2018-11-02 20:48:57 -05:00
David Tomaschik
8b0c4dd29a Update packages. 2018-11-02 12:34:38 -07:00
David Tomaschik
2ab99dd2b4 Add gibson key. 2018-11-02 11:16:18 -07:00
David Tomaschik
3f69a044d3 Fix install_tool for new installs. 2018-11-02 11:12:48 -07:00
David Tomaschik
76d0078497 Add symlink for john. 2018-10-23 00:33:51 -05:00
David Tomaschik
523f272c58 Update john.conf to bleeding edge. 2018-10-23 00:32:57 -05:00
David Tomaschik
475e347fe6 Remove noglob scp workaround. 2018-10-17 15:55:28 -07:00
David Tomaschik
2bd6d63fe4 Merge pull request #5 from Matir/noutility
Stop including prezto alias module.
2018-10-17 11:28:32 -07:00
David Tomaschik
db14ac6e06 Stop including prezto alias module. 2018-10-17 11:27:48 -07:00
David Tomaschik
584678d67e Merge pull request #4 from Matir/workupdates
Add msitools.
2018-10-11 20:22:20 -07:00
David Tomaschik
503bba6516 Add msitools. 2018-10-11 11:31:21 -05:00
David Tomaschik
815dc47846 Merge pull request #3 from Matir/ptffix
PTF fix
2018-10-03 05:46:06 -07:00
David Tomaschik
e52cf7ae00 Add ptf to install_tool. 2018-10-03 05:45:07 -07:00
David Tomaschik
eb2d6e776f Remove ptf from default install script. 2018-10-03 05:39:42 -07:00
David Tomaschik
af85d6f81f Add seclists tool. 2018-10-03 05:38:57 -07:00
David Tomaschik
d84ee23039 Merge branch 'master' of https://github.com./Matir/skel 2018-09-10 16:04:17 -07:00
David Tomaschik
ea1d3f669b Rework overrides for ssh config. 2018-09-10 16:04:15 -07:00
David Tomaschik
47b4248de2 Git ignore kicad-bak files. 2018-09-01 12:49:52 -07:00
David Tomaschik
33e9188612 Add apktool to install_tool. 2018-09-01 12:49:36 -07:00
David Tomaschik
2f6c9c8c0a No special highlighting for root. 2018-09-01 12:49:18 -07:00
David Tomaschik
7128789d48 Merge branch 'master' of https://github.com./Matir/skel 2018-08-18 16:15:10 -07:00
David Tomaschik
19068da3f8 Fix _install_apt_proxy.sh 2018-08-18 16:15:00 -07:00
David Tomaschik
10851db1a9 Improve package installation. 2018-08-03 22:37:06 -07:00
David Tomaschik
1b8d6b85db Merge branch 'master' of https://github.com./Matir/skel 2018-08-02 16:51:49 -07:00
David Tomaschik
653fa39cf7 Remove cursorline from vimrc.
It makes things very slow when enabled on complex files.
See this github issue for context:

https://github.com/vim/vim/issues/2584
2018-08-02 16:51:17 -07:00
David Tomaschik
7b0713675c Add psmisc to packages.cli. 2018-08-01 20:32:53 -07:00
David Tomaschik
52ed3913c8 Symlinks in tools. 2018-07-30 20:20:56 -07:00
David Tomaschik
6d23e72bd7 Set default key for GnuPG. 2018-07-29 19:49:10 -07:00
David Tomaschik
da545f0de7 Support restoring dconf. 2018-07-08 13:56:37 -07:00
David Tomaschik
8d9cf14608 Add a minimal inputrc. 2018-07-06 15:52:20 +02:00
David Tomaschik
bdc1551122 Prevent hiding cursor when moving with arrows. 2018-07-05 14:35:49 +02:00
David Tomaschik
ba497cd5bf Enable syntax highlighting in zsh. 2018-07-04 11:12:37 +02:00
David Tomaschik
ca63946c5e Merge remote-tracking branch 'gh/master' 2018-06-25 20:47:36 +02:00
David Tomaschik
0b6fa6b0fa Install dex with i3. 2018-06-25 20:46:10 +02:00
David Tomaschik
12247790a6 Use dex for desktop files. 2018-06-25 20:45:34 +02:00
David Tomaschik
4d245198a8 Add SSH canonicalization settings. 2018-06-25 20:45:14 +02:00
David Tomaschik
8f4e4fe77b I don't like noglob scp. 2018-06-18 09:25:48 -07:00
David Tomaschik
1cafe1cf7a Don't always send a fake user agent. 2018-06-13 14:26:44 -07:00
David Tomaschik
ba546d478e Add tmux copy/pasta. 2018-06-11 21:55:00 -07:00
David Tomaschik
08d9567bdf Update zsh. 2018-06-11 21:29:50 -07:00
David Tomaschik
a460ee3bb4 More convenience keybindings. 2018-06-10 12:57:38 -07:00
David Tomaschik
f005bae9e6 Move SSH config to include-based. 2018-06-02 21:18:26 -07:00
David Tomaschik
3279d52505 Change locale detection. 2018-05-25 21:03:08 -07:00
David Tomaschik
939c604381 Fix env syntax. 2018-05-24 20:09:45 -07:00
David Tomaschik
d2061e29ef Make .env POSIX compliant. 2018-05-20 21:41:24 -07:00
David Tomaschik
de62342054 Merge branch 'master' of https://github.com/Matir/skel 2018-05-20 21:39:24 -07:00
David Tomaschik
2cf2aa4e78 Merge branch 'master' of https://github.com./Matir/skel 2018-05-16 17:05:55 -07:00
David Tomaschik
672767d758 Add PICKit3 udev rules. 2018-05-16 17:05:06 -07:00
David Tomaschik
96c2c37eb8 Merge branch 'master' of https://github.com./Matir/skel 2018-05-12 15:57:30 -07:00
David Tomaschik
ffb5d753cd Always try sudo if needed. 2018-05-12 15:57:23 -07:00
David Tomaschik
7a7340ef1d Add chromebook key. 2018-05-12 15:57:23 -07:00
David Tomaschik
b1bea45a48 Update skel to handle minimal environments. 2018-05-12 15:57:23 -07:00
David Tomaschik
01432d1f41 Roll back removing titles for groupings. 2018-05-12 15:57:17 -07:00
David Tomaschik
d6800370de Always try sudo if needed. 2018-05-12 12:50:16 -07:00
David Tomaschik
8f547abf93 Add chromebook key. 2018-05-12 12:45:25 -07:00
David Tomaschik
a02825fb1f Update skel to handle minimal environments. 2018-05-07 22:25:17 -07:00
David Tomaschik
5e3d133f8b Switch to vim keybindings. 2018-05-02 22:13:42 -07:00
David Tomaschik
48477290f0 Fix zshrc compinstall path 2018-05-02 14:43:34 -07:00
David Tomaschik
6bf68dfb2e Merge branch 'master' of https://github.com./Matir/skel 2018-04-23 22:12:14 -07:00
David Tomaschik
590a1a2fa0 Script to setup APT proxy. 2018-04-23 22:12:05 -07:00
David Tomaschik
697db6ca24 Merge branch 'master' of https://github.com./Matir/skel 2018-04-18 16:08:35 -07:00
David Tomaschik
f028c2f320 Fix SSH to github when ndots=2. 2018-04-18 16:07:50 -07:00
David Tomaschik
32a1c18c5d Add compose key. 2018-04-18 16:07:34 -07:00
David Tomaschik
4ec3fa1e22 Fix tab completion of usernames. 2018-04-18 16:07:15 -07:00
David Tomaschik
26685dfadb Add jekyll dev command. 2018-04-16 11:59:39 -07:00
David Tomaschik
0b327577e7 Fixing completion. 2018-04-15 17:45:02 -07:00
David Tomaschik
373f6c31c6 Merge branch 'master' of https://github.com./Matir/skel 2018-04-15 09:10:27 -07:00
David Tomaschik
4f7d98930d More improvements in slugs. 2018-04-11 16:09:29 +02:00
David Tomaschik
1aa256252f Note untracked files. 2018-04-07 20:05:47 +02:00
David Tomaschik
5705cb59c8 Use $EDITOR for editing. 2018-04-07 14:46:27 +02:00
David Tomaschik
c8b33e39c7 Avoid leading and trailing dashes in blog post slugs. 2018-04-07 13:58:02 +02:00
David Tomaschik
a9012bebea Add docker tab completion. 2018-04-07 12:26:54 +02:00
David Tomaschik
6100557a2b Add nasm to packages.cli. 2018-03-22 14:11:23 -07:00
David Tomaschik
5709d8fbb0 Setup locale in .env. 2018-03-18 17:55:27 -07:00
David Tomaschik
5dc84926be Add zlogin to build zcompdump.zwc. 2018-03-18 15:52:15 -07:00
David Tomaschik
b303c1b5c5 virtualenv info in prompt 2018-03-17 21:34:38 -07:00
David Tomaschik
dfd2b48b94 Merge branch 'master' of https://github.com./Matir/skel 2018-03-17 21:24:25 -07:00
David Tomaschik
0e1370a93f Initialize virtualenv. 2018-03-17 21:24:20 -07:00
David Tomaschik
4ebf519af7 Add Zeal documentation browser. 2018-03-17 21:03:45 -07:00
David Tomaschik
1386dc49d0 Rename installed-prefs to .installed-prefs. 2018-03-17 16:59:37 -07:00
David Tomaschik
360aa1c8ec Update zpretorc. 2018-03-16 22:45:02 -07:00
David Tomaschik
8e8d220539 Update rsync_ignore. 2018-03-16 21:03:24 -07:00
David Tomaschik
9b7561ce8f Merge branch 'master' of https://github.com./Matir/skel 2018-03-16 21:03:02 -07:00
David Tomaschik
c9c65e10d7 Install latest mitmproxy. 2018-03-14 22:15:52 -07:00
David Tomaschik
61b4dbe963 Do cyberchef install_tool style. 2018-03-14 13:44:40 -07:00
David Tomaschik
20a8db806c Make HISTFILE zprezto compatible. 2018-03-13 11:26:25 -07:00
David Tomaschik
be1bca8dbe Fix up prompt for vicmd mode. 2018-03-11 17:15:45 -07:00
David Tomaschik
9c3ad64036 Fix up GREP_COLORS. 2018-03-11 16:21:43 -07:00
David Tomaschik
d392eb8dfc Optimize backup. 2018-03-11 16:21:32 -07:00
David Tomaschik
6f15f7096a Fix prompt for git. 2018-03-11 12:44:41 -07:00
David Tomaschik
c7e40f1321 Fix rvm changes. 2018-03-10 23:14:16 -08:00
David Tomaschik
376fbb9f73 Merge branch 'prezto' 2018-03-10 23:13:03 -08:00
131 changed files with 9119 additions and 3452 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
installed-prefs installed-prefs
.installed-prefs
*.swp *.swp
*~ *~
*.bak *.bak

24
.gitmodules vendored Normal file
View File

@@ -0,0 +1,24 @@
[submodule "dotfiles/vim/pack/matir/opt/solarized8"]
path = dotfiles/vim/pack/matir/opt/solarized8
url = https://github.com/lifepillar/vim-solarized8.git
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/surround"]
path = dotfiles/vim/pack/matir/start/surround
url = https://github.com/tpope/vim-surround.git
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/editorconfig"]
path = dotfiles/vim/pack/matir/start/editorconfig
url = https://github.com/editorconfig/editorconfig-vim.git
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/fugitive"]
path = dotfiles/vim/pack/matir/start/fugitive
url = https://github.com/tpope/vim-fugitive
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/ctrlp"]
path = dotfiles/vim/pack/matir/start/ctrlp
url = https://github.com/ctrlpvim/ctrlp.vim.git
fetchRecurseSubmodules = true
[submodule "dotfiles/tmux/tmux-logging"]
path = dotfiles/tmux/tmux-logging
url = https://github.com/tmux-plugins/tmux-logging.git
fetchRecurseSubmodules = true

View File

@@ -1,5 +1,5 @@
### About ### ### About ###
This is a repository of configuration files that I like to have on all the This is a repository of configuration files that I like to have on all the
machines that I use. I can just clone the repository and run "repo/setup.sh" machines that I use. I can just clone the repository and run "repo/setup.sh"
and get most things setup the way I like them. and get most things setup the way I like them.
@@ -14,12 +14,14 @@ This now uses [git-crypt](https://github.com/AGWA/git-crypt) to protect
I still wouldn't check in anything terribly sensitive, like private keys. I still wouldn't check in anything terribly sensitive, like private keys.
### Usefulness ### ### Usefulness ###
Mostly I post this to github so I can quickly grab the things I want, but it Mostly I post this to github so I can quickly grab the things I want, but it
might also be useful to others. Feel free to raise an issue if you have any might also be useful to others. Feel free to raise an issue if you have any
questions. I don't anticipating taking merge requests -- make your own questions. I don't anticipating taking merge requests -- make your own
dotfiles. ;) dotfiles. ;)
### Options ### ### Options ###
``` ```
BASEDIR: Where the skel framework is installed. Defaults to $HOME/.skel BASEDIR: Where the skel framework is installed. Defaults to $HOME/.skel
MINIMAL: Don't do things that require git clones or installation of anything MINIMAL: Don't do things that require git clones or installation of anything
@@ -31,9 +33,10 @@ INSTALL_PKGS: Install common packages, if on a Debian-like system.
(Defaults to opposite of $MINIMAL.) (Defaults to opposite of $MINIMAL.)
SAVE: Save the install options to ${BASEDIR}/installed-prefs SAVE: Save the install options to ${BASEDIR}/installed-prefs
``` ```
### TODO ### ### TODO ###
[ ] Re-do the installation of packages. - [X] Re-do the installation of packages.
[ ] Make manual installation of sets easy/possible. - [X] Make manual installation of sets easy/possible.
[ ] Make missing packages not cause a full set failure. - [X] Make missing packages not cause a full set failure.
[X] Allow comments and blank lines. - [X] Allow comments and blank lines. in packages

View File

@@ -26,5 +26,8 @@ function verify_dest {
verify_dest "$DEST" verify_dest "$DEST"
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

@@ -1,3 +1,11 @@
#!/bin/bash #!/bin/bash
exec xdg-open $(dirname $0)/cyberchef.html set -u
CHEF_FILE=${HOME}/tools/cyberchef/cyberchef.html
if [ ! -f ${CHEF_FILE} ] ; then
${HOME}/bin/install_tool cyberchef
fi
exec xdg-open ${CHEF_FILE}

File diff suppressed because one or more lines are too long

22
bin/disk-benchmark Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -ue
FILENAME=${1}
BENCHMARK_SIZE=${BENCHMARK_SIZE:-1000m}
if [ -f ${FILENAME} ] ; then
echo "File ${FILENAME} already exists!" >/dev/stderr
exit 1
fi
trap "test -f ${FILENAME} && rm -f ${FILENAME}" EXIT
fio --loops=5 --size=${BENCHMARK_SIZE} --filename=${FILENAME} \
--stonewall --ioengine=libaio --direct=1 \
--name=Seqread --bs=1m --rw=read \
--name=Seqwrite --bs=1m --rw=write \
--name=512Kread --bs=512k --rw=randread \
--name=512Kwrite --bs=512k --rw=randwrite \
--name=4kQD32read --bs=4k --iodepth=32 --rw=randread \
--name=4kQD32write --bs=4k --iodepth=32 --rw=randwrite

View File

@@ -1,3 +1,21 @@
#!/bin/bash #!/bin/bash
CHROME_BINS="google-chrome-beta google-chrome"
for bin in ${CHROME_BINS} ; do
if command -v ${bin} >/dev/null 2>&1 ; then
CHROME=$(command -v ${bin})
break
fi
done
if test -z "${CHROME}" ; then
echo "Chrome not found!" >/dev/stderr
exit 1
fi
# Set alternate HOME to use alternate NSS DB
export HOME=${HOME}/.chrome-pentest
mkdir -p ${HOME}
# Launch chrome for burp # Launch chrome for burp
exec /usr/bin/google-chrome-beta --ignore-certificate-errors --user-data-dir=${HOME}/.config/chrome-pentest --proxy-server=127.0.0.1:8080 exec ${CHROME} --user-data-dir=${HOME}/chrome-pentest --proxy-server=127.0.0.1:8080

View File

@@ -1,8 +1,10 @@
#!/bin/sh #!/bin/sh
LOCKTIME="${SCREENSAVER_MIN:-5}"
LOCKER="i3lock -c 000000" LOCKER="i3lock -c 000000"
/usr/bin/xss-lock -- "${LOCKER}" & # intentionally want word splitting below
/usr/bin/xss-lock -- ${LOCKER} &
exec /usr/bin/xautolock \ exec /usr/bin/xautolock \
-time 5 \ -time "${LOCKTIME}" \
-detectsleep \ -detectsleep \
-locker "${LOCKER}" \ -locker "${LOCKER}" \
-notify 30 \ -notify 30 \

View File

@@ -5,7 +5,10 @@ set -ue
REINSTALL=0 REINSTALL=0
PACKAGES=1 PACKAGES=1
export GO111MODULE=on
while getopts -- "-:" a ; do while getopts -- "-:" a ; do
# shellcheck disable=SC2154
case "${a}" in case "${a}" in
-) -)
case "${OPTARG}" in case "${OPTARG}" in
@@ -20,37 +23,57 @@ while getopts -- "-:" a ; do
exit 1 exit 1
;; ;;
esac esac
;;
*)
echo "Unknown short option ${OPTARG}" >/dev/stderr
exit 1
;;
esac esac
done done
shift $(($OPTIND-1)) shift $((OPTIND-1))
function list_tools {
echo "Options:" >/dev/stderr
awk 'BEGIN {s=0;FS=")"};/main tool selection/{s=1};/^\s+\w+)$/{if(s==1){print $1}}' "$0" | sort | while read -r opt; do
echo -e "\\t${opt}" >/dev/stderr
done
}
if [ $# -ne 1 ] ; then if [ $# -ne 1 ] ; then
echo "Usage: ${0} <tool>" >/dev/stderr echo "Usage: ${0} <tool>" >/dev/stderr
list_tools
exit 1 exit 1
fi fi
TOOL=${1} TOOL=${1}
function die {
echo "$@" >/dev/stderr
exit 1
}
function install_pkgs { function install_pkgs {
if [ ${PACKAGES} -eq 0 ] ; then if [ ${PACKAGES} -eq 0 ] ; then
return 0 return 0
fi fi
if [ `id -u` -ne "0" ] ; then # TODO: check if packages are already installed
sudo apt-get -y install $* || ( if [ "$(id -u)" -ne "0" ] ; then
sudo apt-get -y install "$@" || (
echo -n "Unable to install packages, please ensure these " >/dev/stderr echo -n "Unable to install packages, please ensure these " >/dev/stderr
echo "are installed, then run with --no-packages." >/dev/stderr echo "are installed, then run with --no-packages." >/dev/stderr
echo $* echo "$@"
false ) false )
return 0 return 0
fi fi
apt-get -y install $* apt-get -y install "$@"
} }
function download { function download {
SRC=${1} SRC=${1}
DST=${2} DST=${2}
echo -n "Downloading ${SRC} to ${DST}..." >&2 echo -n "Downloading ${SRC} to ${DST}..." >&2
wget --no-server-response -q -O ${DST} --content-disposition ${SRC} # TODO: consider curl instead?
wget --no-server-response -q -O "${DST}" --content-disposition "${SRC}"
echo " done." >&2 echo " done." >&2
} }
@@ -58,126 +81,369 @@ function check_sudo {
sudo -l >/dev/null sudo -l >/dev/null
} }
function add_bin_symlink {
local TARGET NAME BINDIR
TARGET="${1}"
NAME="${2:-$(basename "${1}")}"
BINDIR="${HOME}/bin/tools/"
mkdir -p -- "${BINDIR}"
ln -sf "${DESTDIR}/${TARGET}" "${BINDIR}/${NAME}"
}
mkdir -p "${HOME}/tools"
DESTDIR="${HOME}/tools/${TOOL}" DESTDIR="${HOME}/tools/${TOOL}"
if [ -d ${DESTDIR} ] ; then function makedest {
if [ ${REINSTALL} -eq 1 ] ; then if [ -d "${DESTDIR}" ] ; then
rm -ri ${DESTDIR} if [ "${REINSTALL}" -eq 1 ] ; then
rm -ri "${DESTDIR}"
else else
echo "${DESTDIR} exists but not reinstalling." >/dev/stderr echo "${DESTDIR} exists but not reinstalling." >/dev/stderr
exit 1 return 1
fi fi
fi fi
mkdir -p "${DESTDIR}"
}
function makedest_or_die {
makedest || die "Aborting."
}
# Begin main tool selection
case ${TOOL} in case ${TOOL} in
john) john)
makedest_or_die
install_pkgs libssl-dev git build-essential yasm libgmp-dev libpcap-dev \ install_pkgs libssl-dev git build-essential yasm libgmp-dev libpcap-dev \
pkg-config libbz2-dev libopenmpi-dev openmpi-bin libnss3-dev \ pkg-config libbz2-dev libopenmpi-dev openmpi-bin libnss3-dev \
libkrb5-dev libgmp-dev libkrb5-dev libgmp-dev
jtemp=`mktemp -d` jtemp=$(mktemp -d)
git clone https://github.com/magnumripper/JohnTheRipper.git ${jtemp}/john git clone https://github.com/magnumripper/JohnTheRipper.git "${jtemp}/john"
cd ${jtemp}/john/src cd "${jtemp}/john/src"
./configure && make -sj2 ./configure && make -sj2
mkdir -p ${DESTDIR} cp -r "${jtemp}"/john/run/* "${DESTDIR}"
cp -r ${jtemp}/john/run/* ${DESTDIR} rm -rf "${jtemp}"
rm -rf ${jtemp}
# Persistent files # Persistent files
mkdir -p ${HOME}/.john mkdir -p "${HOME}/.john"
touch ${HOME}/.john/john.pot touch "${HOME}/.john/john.pot"
ln -sf ${HOME}/.john/* ${DESTDIR} ln -sf "${HOME}/.john/*" "${DESTDIR}"
add_bin_symlink john
;; ;;
wordlists) wordlists)
mkdir -p ${DESTDIR} makedest
download \ download \
http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2 \ http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2 \
${DESTDIR}/rockyou.txt.bz2 "${DESTDIR}/rockyou.txt.bz2"
bunzip2 ${DESTDIR}/rockyou.txt.bz2 bunzip2 "${DESTDIR}/rockyou.txt.bz2"
download \ download \
http://downloads.skullsecurity.org/passwords/phpbb.txt.bz2 \ http://downloads.skullsecurity.org/passwords/phpbb.txt.bz2 \
${DESTDIR}/phpbb.txt.bz2 "${DESTDIR}/phpbb.txt.bz2"
bunzip2 ${DESTDIR}/phpbb.txt.bz2 bunzip2 "${DESTDIR}/phpbb.txt.bz2"
download \ download \
http://downloads.skullsecurity.org/passwords/hak5.txt.bz2 \ http://downloads.skullsecurity.org/passwords/hak5.txt.bz2 \
${DESTDIR}/hak5.txt.bz2 "${DESTDIR}/hak5.txt.bz2"
bunzip2 ${DESTDIR}/hak5.txt.bz2 bunzip2 "${DESTDIR}/hak5.txt.bz2"
;;
seclists)
git clone https://github.com/danielmiessler/SecLists.git "${DESTDIR}"
;;
werdlists)
git clone --depth 1 https://github.com/decal/werdlists.git "${DESTDIR}"
;; ;;
gcloud) gcloud)
mkdir -p ${DESTDIR} makedest_or_die
gtemp=`mktemp -d`
gbase="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/" gbase="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/"
# TODO: find a way to make this version independent # TODO: find a way to make this version independent
gsdk="google-cloud-sdk-142.0.0-linux-x86_64.tar.gz" gsdk="google-cloud-sdk-277.0.0-linux-x86_64.tar.gz"
download "${gbase}${gsdk}" /tmp/gcloud.tar.gz download "${gbase}${gsdk}" /tmp/gcloud.tar.gz
tar zxf /tmp/gcloud.tar.gz --strip-components=1 -C ${DESTDIR} tar zxf /tmp/gcloud.tar.gz --strip-components=1 -C "${DESTDIR}"
rm /tmp/gcloud.tar.gz rm /tmp/gcloud.tar.gz
add_bin_symlink bin/gcloud
;; ;;
android-sdk) android-sdk)
# TODO: find a way to make this version independent # TODO: find a way to make this version independent
asdk="https://dl.google.com/android/repository/tools_r25.2.3-linux.zip" asdk="https://dl.google.com/android/repository/platform-tools_r31.0.2-linux.zip"
download ${asdk} /tmp/android-tools.zip download ${asdk} /tmp/android-tools.zip
unzip -d ${DESTDIR} /tmp/android-tools.zip unzip -d "${DESTDIR}" /tmp/android-tools.zip
rm /tmp/android-tools.zip rm /tmp/android-tools.zip
# Install components # Install components
${DESTDIR}/tools/bin/sdkmanager "emulator" "platform-tools" "${DESTDIR}/tools/bin/sdkmanager" "emulator" "platform-tools"
;; ;;
burp) burp)
# Install latest burp free # Install latest burp free
mkdir -p ${DESTDIR} makedest
download \ if ! download \
https://portswigger.net/DownloadUpdate.ashx\?Product\=Free \ https://portswigger.net/DownloadUpdate.ashx\?Product=Free \
${DESTDIR}/burp-free.jar "${DESTDIR}/burp-free.jar" ; then
if [ $? -ne 0 ] ; then
echo "Download failed." >&2 echo "Download failed." >&2
exit 1 exit 1
fi fi
if [ -x /usr/bin/jarwrapper ] ; then if [ -x /usr/bin/jarwrapper ] ; then
# We have binfmt support for jar, so add to bin # We have binfmt support for jar, so add to bin
chmod +x ${DESTDIR}/*.jar chmod +x "${DESTDIR}"/*.jar
ln -sf ${DESTDIR}/*.jar ${HOME}/bin/burp ln -sf "${DESTDIR}"/*.jar "${HOME}/bin/burp"
fi fi
;; ;;
mitmproxy) mitmproxy)
# Find a better way to get the latest makedest_or_die
src="https://github.com/mitmproxy/mitmproxy/releases/download/v2.0.1/mitmproxy-2.0.1-linux.tar.gz" ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/mitmproxy/mitmproxy/releases/latest"))["tag_name"].replace("v",""))')
download ${src} /tmp/mitmproxy.tar.gz download \
mkdir -p ${DESTDIR} "https://snapshots.mitmproxy.org/${ver}/mitmproxy-${ver}-linux.tar.gz" \
tar zx -C ${DESTDIR} -f /tmp/mitmproxy.tar.gz /tmp/mitmproxy.tar.gz
tar zx -C "${DESTDIR}" -f /tmp/mitmproxy.tar.gz
rm /tmp/mitmproxy.tar.gz rm /tmp/mitmproxy.tar.gz
add_bin_symlink mitmproxy
add_bin_symlink mitmweb
add_bin_symlink mitmdump
;; ;;
esp) esp)
makedest_or_die
src="https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz" src="https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz"
download ${src} /tmp/esp32.tar.gz download ${src} /tmp/esp32.tar.gz
mkdir -p ${DESTDIR} tar zx -C "${DESTDIR}" -f /tmp/esp32.tar.gz
tar zx -C ${DESTDIR} -f /tmp/esp32.tar.gz
rm /tmp/esp32.tar.gz rm /tmp/esp32.tar.gz
git clone --recursive https://github.com/espressif/esp-idf.git ${DESTDIR}/esp-idf git clone --recursive https://github.com/espressif/esp-idf.git "${DESTDIR}/esp-idf"
;; ;;
dex2jar) dex2jar)
makedest_or_die
src="https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip" src="https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip"
download ${src} /tmp/dex2jar.zip download ${src} /tmp/dex2jar.zip
tmpd=`mktemp -d` tmpd=$(mktemp -d)
unzip -d ${tmpd} /tmp/dex2jar.zip unzip -d "${tmpd}" /tmp/dex2jar.zip
mv ${tmpd}/* ${DESTDIR} mv "${tmpd}"/* "${DESTDIR}"
rm /tmp/dex2jar.zip rm /tmp/dex2jar.zip
rm -rf ${tmpd} rm -rf "${tmpd}"
rm ${DESTDIR}/*.bat rm "${DESTDIR}"/*.bat
chmod +x ${DESTDIR}/*.sh chmod +x "${DESTDIR}"/*.sh
;; ;;
proxmark3) proxmark3)
install_pkgs p7zip git build-essential libreadline5 libreadline-dev \ install_pkgs p7zip git build-essential libreadline5 libreadline-dev \
libusb-0.1-4 libusb-dev libqt4-dev perl pkg-config wget libncurses5-dev \ libusb-0.1-4 libusb-dev libqt4-dev perl pkg-config wget libncurses5-dev \
gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib
src="https://github.com/Proxmark/proxmark3.git" src="https://github.com/Proxmark/proxmark3.git"
git clone ${src} ${DESTDIR} git clone "${src}" "${DESTDIR}"
cd ${DESTDIR} cd "${DESTDIR}"
make -sj2 make -sj2
check_sudo && sudo /bin/sh -c \ check_sudo && sudo /bin/sh -c \
"cp -rf driver/78-mm-usb-device-blacklist.rules \ "cp -rf driver/78-mm-usb-device-blacklist.rules \
/etc/udev/rules.d/77-mm-usb-device-blacklist.rules && /etc/udev/rules.d/77-mm-usb-device-blacklist.rules &&
udevadm control --reload-rules" udevadm control --reload-rules"
;; ;;
cyberchef)
makedest
src=$(python3 -c 'from urllib import request; import json; print(filter(lambda x: x["name"]=="cyberchef.htm", json.load(request.urlopen("https://api.github.com/repos/gchq/CyberChef/releases/latest"))["assets"])[0]["browser_download_url"])')
download "${src}" "${DESTDIR}/cyberchef.html"
;;
apktool)
makedest_or_die
download \
https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool \
"${DESTDIR}/apktool"
download \
https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.3.3.jar \
"${DESTDIR}/apktool.jar"
chmod +x "${DESTDIR}/apktool"
add_bin_symlink apktool
;;
ptf)
makedest_or_die
src="https://github.com/trustedsec/ptf.git"
git clone "${src}" "${DESTDIR}"
;;
pwndbg)
if ! command -v gdb > /dev/null 2>&1 ; then
echo 'No gdb available!' >/dev/stderr
exit 1
fi
git clone --depth 1 -b stable https://github.com/pwndbg/pwndbg.git "${DESTDIR}"
PY_PACKAGES=${DESTDIR}/vendor
mkdir -p "${PY_PACKAGES}"
PYVER=$(gdb -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))')
PYTHON=$(gdb -batch -q --nx -ex 'pi import sys; print(sys.executable)')
PYTHON="${PYTHON}${PYVER}"
"${PYTHON}" -m pip install --target "${PY_PACKAGES}" -Ur "${DESTDIR}/requirements.txt"
"${PYTHON}" -m pip install --target "${PY_PACKAGES}" -U capstone unicorn
# capstone package is broken
cp "${PY_PACKAGES}/usr/lib/*/dist-packages/capstone/libcapstone.so" "${PY_PACKAGES}/capstone"
;;
gef)
makedest_or_die
if ! command -v gdb > /dev/null 2>&1 ; then
echo 'No gdb available!' >/dev/stderr
exit 1
fi
download \
https://github.com/hugsy/gef/raw/master/gef.py \
"${DESTDIR}/gef.py"
;;
aflplusplus)
install_pkgs libtool-bin libglib2.0-dev libpixman-1-dev clang clang-tools \
llvm python3-setuptools
git clone "https://github.com/vanhauser-thc/AFLplusplus" "${DESTDIR}"
make -C "${DESTDIR}" distrib
;;
exploitdb)
if test -d "${DESTDIR}" ; then
echo "Already installed, updating instead..." >/dev/stderr
"${DESTDIR}/searchsplit" -u
else
git clone --depth 1 \
https://github.com/offensive-security/exploitdb.git \
"${DESTDIR}"
add_bin_symlink searchsploit
cp "${DESTDIR}/.searchsploit_rc" "${HOME}/.searchsploit_rc"
sed -i "s|/opt/exploitdb|${DESTDIR}|" "${HOME}/.searchsploit_rc"
fi
;;
cura)
makedest
ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/Ultimaker/Cura/releases/latest"))["name"].replace("v",""))')
echo "Latest Cura is ${ver}"
download \
"https://github.com/Ultimaker/Cura/releases/download/${ver}/Cura-${ver}.AppImage" \
"${DESTDIR}/Cura.AppImage"
chmod +x "${DESTDIR}/Cura.AppImage"
add_bin_symlink "Cura.AppImage" cura
;;
rr)
ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/mozilla/rr/releases/latest"))["name"])')
echo "Latest rr is ${ver}"
download \
"https://github.com/mozilla/rr/releases/download/${ver}/rr-${ver}-Linux-$(uname -m).deb" \
"/tmp/rr.deb"
sudo dpkg -i /tmp/rr.deb
;;
nmap-parse-output)
git clone --depth 1 \
https://github.com/ernw/nmap-parse-output.git \
"${DESTDIR}"
add_bin_symlink nmap-parse-output
cat <<EOF >"${HOME}/.zshrc.d/99-nmap-parse-output.zsh"
if test -d ${DESTDIR} ; then
autoload bashcompinit
bashcompinit
source ${DESTDIR}/_nmap-parse-output
fi
EOF
;;
logiops)
install_pkgs cmake libevdev-dev libudev-dev libconfig++-dev checkinstall
git clone "https://github.com/PixlOne/logiops.git" "${DESTDIR}"
mkdir -p "${DESTDIR}/build"
cd "${DESTDIR}/build"
cmake ..
make
sudo checkinstall --pkgname logiops --maintainer "${USER}" -y
;;
aws)
DN=$(mktemp -d)
cd "${DN}"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "${DN}/awscliv2.zip"
unzip "${DN}/awscliv2.zip"
mv "${DN}/aws/dist" "${DESTDIR}"
add_bin_symlink aws
rm -rf ${DN}
;;
tmpmail)
install_pkgs curl w3m jq
mkdir -p ${DESTDIR}
curl -L "https://git.io/tmpmail" > ${DESTDIR}/tmpmail
chmod +x ${DESTDIR}/tmpmail
add_bin_symlink tmpmail
;;
gf)
install_pkgs golang-go silversearcher-ag
go get -u github.com/tomnomnom/gf
mkdir -p ${HOME}/.config
if test -d ${HOME}/.config/gf ; then
git -C ${HOME}/.config/gf pull
else
git clone https://github.com/Matir/gf-patterns.git ${HOME}/.config/gf
fi
;;
gron)
go get -u github.com/tomnomnom/gron
;;
httprobe)
go get -u github.com/tomnomnom/httprobe
;;
ffuf)
go get -u github.com/ffuf/ffuf
;;
gobuster)
go get -u github.com/OJ/gobuster
;;
amass)
go get -u github.com/OWASP/Amass/v3/...
;;
cht.sh)
install_pkgs rlwrap
mkdir -p ${DESTDIR}
curl https://cht.sh/:cht.sh > ${DESTDIR}/cht.sh
chmod +x ${DESTDIR}/cht.sh
add_bin_symlink cht.sh
;;
age)
go get -u filippo.io/age/cmd/age
go get -u filippo.io/age/cmd/age-keygen
;;
docker-compose)
mkdir -p ${DESTDIR}
curl -L \
"https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" \
-o "${DESTDIR}/docker-compose"
chmod +x "${DESTDIR}/docker-compose"
add_bin_symlink docker-compose
;;
tldr)
pip3 install --user tldr
;;
blint)
pip3 install --user blint
;;
dust)
if ! command -v cargo >/dev/null 2>&1 ; then
echo "This needs cargo (for rust)!" >/dev/stderr
exit 1
fi
cargo install du-dust
;;
bottom)
if ! command -v cargo >/dev/null 2>&1 ; then
echo "This needs cargo (for rust)!" >/dev/stderr
exit 1
fi
cargo install bottom
;;
delta)
if !check_sudo ; then
echo "Must be able to run as sudo."
exit 1
fi
dpkg_url=$(curl https://api.github.com/repos/dandavison/delta/releases/latest | \
jq -r '.assets[] | select(.name|test(".*_amd64.deb")) | select(.name|test(".*musl.*")|not) | .browser_download_url')
dpkg_name="/tmp/delta_amd64.deb"
download "${dpkg_url}" "${dpkg_name}"
sudo dpkg -i "${dpkg_name}"
;;
ropper)
install_pkgs python3-z3
pip3 install --user pyvex ropper
;;
kubeconform)
go install github.com/yannh/kubeconform/cmd/kubeconform@latest
;;
starship)
mkdir -p ${DESTDIR}
download \
"https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-musl.tar.gz" \
/tmp/starship.tar.gz
tar -C ${DESTDIR} -zxf /tmp/starship.tar.gz starship
add_bin_symlink starship
;;
*) *)
echo "Unknown tool: ${TOOL}" >/dev/stderr echo "Unknown tool: ${TOOL}" >/dev/stderr
list_tools
exit 1 exit 1
;; ;;
esac esac

View File

@@ -1,33 +1,13 @@
#!/bin/sh #!/bin/sh
export NAME=$(basename "$0") export NAME=$(basename "$0")
export BASE="/opt/metasploit" # TODO: search this path export BASE="/opt/metasploit-framework" # TODO: search this path
unset GEM_PATH
# Autogen'd if [ -f "${BASE}/bin/${NAME}" ] ; then
if [ -f "${BASE}/scripts/setenv.sh" ] ; then exec "${BASE}/bin/${NAME}" "$@"
. ${BASE}/scripts/setenv.sh
fi fi
# Use Pro's bundled gems instead of the gemcache
export MSF_BUNDLE_GEMS=0
export BUNDLE_GEMFILE=${BASE}/apps/pro/Gemfile
# Set a flag so Gemfile can limit gems
export FRAMEWORK_FLAG=true
export MSF_DATABASE_CONFIG=${BASE}/apps/pro/ui/config/database.yml
export TERMINFO=${BASE}/common/share/terminfo/
# Check for ruby scripts such as msfconsole directly to avoid having to add
# msf3 to the path.
if [ -f "${BASE}/apps/pro/msf3/${NAME}" ]; then
exec ${BASE}/apps/pro/msf3/${NAME} "$@"
fi
if [ -f "${BASE}/apps/pro/msf3/tools/exploit/${NAME}.rb" ]; then
exec ${BASE}/apps/pro/msf3/tools/exploit/${NAME}.rb "$@"
fi
export BASE="/opt/metasploit-framework"
if [ -f "${BASE}/embedded/framework/tools/exploit/${NAME}.rb" ]; then if [ -f "${BASE}/embedded/framework/tools/exploit/${NAME}.rb" ]; then
exec ${BASE}/embedded/bin/ruby \ exec ${BASE}/embedded/bin/ruby \
"${BASE}/embedded/framework/tools/exploit/${NAME}.rb" "$@" "${BASE}/embedded/framework/tools/exploit/${NAME}.rb" "$@"

22
bin/nvidia_hold.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
function list_nvidia_installed {
dpkg-query -l '*nvidia*' | grep '^[hi]i' | awk '{print $2}'
}
function hold_or_unhold {
apt-mark "${1:-hold}" $(list_nvidia_installed)
}
case "$1" in
hold|h)
hold_or_unhold hold
;;
unhold|u)
hold_or_unhold unhold
;;
*)
echo "$0 <hold|unhold>" >/dev/stderr
exit 1
;;
esac

46
bin/pactl_helper Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
function get_active_sink {
pactl list short sinks | grep RUNNING | awk '{print $2}'
}
function get_active_source {
pactl list short sources | grep RUNNING | awk '{print $2}'
}
function get_default_sink {
pactl info | grep '^Default Sink:' | awk '{print $NF}'
}
function get_default_source {
pactl info | grep '^Default Source:' | awk '{print $NF}'
}
function micmute {
MODE=${1:-toggle}
pactl set-source-mute $(get_default_source) ${MODE}
}
function mute {
MODE=${1:-toggle}
pactl set-sink-mute $(get_default_sink) ${MODE}
}
function volume {
VOL="${1}"
if test -z "${VOL}" ; then
echo "Need volume spec!"
exit 1
fi
pactl set-sink-volume $(get_default_sink) "${VOL}"
}
case "$1" in
mute|micmute|volume)
$*
;;
*)
echo "Unknown command!"
exit 1
;;
esac

48
bin/qdisc_span.sh Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
set -ue
ACTION="add"
if [ "${1}" == "-d" ] ; then
ACTION="del"
shift
fi
BRIDGE="${1}"
DEST="${2}"
function setup_span {
if tc qdisc show dev "${1}" | grep -q 'qdisc ingress ffff' ; then
return 0
fi
tc qdisc add dev "${1}" ingress
tc filter add dev "${1}" parent ffff: protocol all u32 match u8 0 0 action mirred egress mirror dev "${DEST}"
}
function del_span {
tc qdisc del dev "${1}" ingress
}
function handle_iface {
case "${ACTION}" in
add)
setup_span "${1}"
;;
del)
del_span "${1}"
;;
*)
echo "Unknown action!"
exit 1
;;
esac
}
function get_bridge_ifaces {
bridge link | grep "master ${1}" | cut -d: -f2 | cut -d@ -f1
}
for iface in $(get_bridge_ifaces "${BRIDGE}") ; do
handle_iface "$iface"
done

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

35
bin/setup/apt_proxy.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
set -o errexit
set -o nounset
if test -f /etc/apt/apt.conf.d/90-proxy ; then
echo "Looks already setup."
exit 0
fi
cat >/etc/apt/proxy-detect <<'EOF'
#!/bin/bash
PROXY=192.168.60.10:3142
if ! test -x /bin/nc ; then
echo DIRECT
exit 0
fi
if nc -w 2 -z ${PROXY/:/ } ; then
echo ${PROXY}
exit 0
fi
echo DIRECT
EOF
chmod 755 /etc/apt/proxy-detect
cat >/etc/apt/apt.conf.d/90-proxy <<'EOF'
Acquire::http::Proxy-Auto-Detect "/etc/apt/proxy-detect";
EOF
echo "Setup APT Proxying."

View File

@@ -2,4 +2,4 @@
apt-get install -y \ apt-get install -y \
i3 i3lock xss-lock rxvt-unicode-256color fonts-inconsolata scrot \ i3 i3lock xss-lock rxvt-unicode-256color fonts-inconsolata scrot \
xautolock xbacklight i3status xautolock xbacklight i3status dex libnotify-bin

26
chromeos/hterm.json Normal file
View File

@@ -0,0 +1,26 @@
{
"background-color": "rgba(0, 43, 54, 1)",
"cursor-color": "rgba(238, 232, 213, 0.5)",
"color-palette-overrides": {
"0": "#073642",
"1": "#dc322f",
"2": "#859900",
"3": "#b58900",
"4": "#268bd2",
"5": "#d33682",
"6": "#2aa198",
"7": "#eee8d5",
"8": "#002b36",
"9": "#cb4b16",
"10": "#586e75",
"11": "#657b83",
"12": "#839496",
"13": "#6c71c4",
"14": "#93a1a1",
"15": "#fdf6e3"
},
"font-family": "\"Inconsolata\", \"DejaVu Sans Mono\", \"Noto Sans Mono\", \"Everson Mono\", FreeMono, Menlo, Terminal, monospace",
"font-size": "15",
"foreground-color": "rgba(238, 232, 213, 1)",
"user-css": "https://cdn.jsdelivr.net/gh/wernight/powerline-web-fonts@ba4426cb0c0b05eb6cb342c7719776a41e1f2114/PowerlineFonts.css"
}

24
clone.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -ue
# Script to clone and install
# Wrapped in a function to prevent incomplete execution if download is
# interrupted
function installer_main {
if ! command -v git >/dev/null 2>&1 ; then
( if [ "$EUID" != 0 ] ; then
sudo apt install -y git
else
apt install -y git
fi ) || ( echo 'Failed to install git!' >/dev/stderr; false)
fi
git clone https://github.com/Matir/skel.git ${HOME}/.skel
${HOME}/.skel/install.sh
${HOME}/.skel/install.sh packages minimal
}
installer_main

10
conf/logid.cfg Normal file
View File

@@ -0,0 +1,10 @@
devices: ({
name: "Wireless Mouse MX Master 3";
smartshift: {
on: true;
threshold: 30;
};
dpi: 1500;
});

View File

@@ -0,0 +1,24 @@
[media-keys]
screensaver=['<Primary><Alt>l', 'XF86ScreenSaver']
[wm]
move-to-workspace-1=['<Shift><Super>exclam']
move-to-workspace-2=['<Shift><Super>at']
move-to-workspace-3=['<Shift><Super>numbersign']
move-to-workspace-4=['<Shift><Super>dollar']
move-to-workspace-5=['<Shift><Super>percent']
move-to-workspace-6=['<Shift><Super>asciicircum']
move-to-workspace-7=['<Shift><Super>ampersand']
move-to-workspace-8=['<Shift><Super>asterisk']
move-to-workspace-9=['<Shift><Super>parenleft']
switch-to-workspace-4=['<Super>4']
switch-to-workspace-1=['<Super>1']
switch-to-workspace-10=['<Super>0']
switch-to-workspace-3=['<Super>3']
switch-to-workspace-8=['<Super>8']
switch-to-workspace-5=['<Super>5']
move-to-workspace-10=['<Shift><Super>parenright']
switch-to-workspace-2=['<Super>2']
switch-to-workspace-9=['<Super>9']
switch-to-workspace-6=['<Super>6']
switch-to-workspace-7=['<Super>7']

View File

@@ -3,8 +3,8 @@ Xcursor.size: 16
!!! !!!
! Xft for fonts ! Xft for fonts
!!! !!!
Xft.dpi: 96 !Xft.dpi: 144
Xft.antialias: false Xft.antialias: true
Xft.lcdfilter: lcddefault Xft.lcdfilter: lcddefault
Xft.rgba: rgb Xft.rgba: rgb
Xft.hinting: true Xft.hinting: true
@@ -27,21 +27,34 @@ URxvt.lineSpace: 0
URxvt.iso14755: false URxvt.iso14755: false
! Fonts ! Fonts
URxvt*font: xft:inconsolata:pixelsize=16 URxvt.font: xft:inconsolata:pixelsize=17,xft:monospace:size=12
! Fix font space ! Fix font space
URxvt*letterSpace: -1 URxvt.letterSpace: -1
! Scrollbar ! Scrollbar and scrolling
URxvt.scrollStyle: rxvt URxvt.scrollStyle: rxvt
URxvt.scrollBar: false URxvt.scrollBar: false
! do not scroll with output
URxvt.scrollTtyOutput: false
! scroll in relation to buffer (with mouse scroll or Shift+Page Up)
URxvt.scrollWithBuffer: true
! scroll back to the bottom on keypress
URxvt.scrollTtyKeypress: true
! Allow apps to manage their own secondary screen
URxvt.secondaryScreen: 1
URxvt.secondaryScroll: 0
! Perl extensions ! Perl extensions
URxvt.perl-ext-common: default,matcher,resize-font URxvt.perl-ext-common: default,matcher,font-size,eval
URxvt.matcher.button: 1 URxvt.matcher.button: 1
URxvt.urlLauncher: /usr/bin/xdg-open URxvt.urlLauncher: /usr/bin/xdg-open
URxvt.resize-font.smaller: C-Down URxvt.url-launcher: /usr/bin/xdg-open
URxvt.resize-font.bigger: C-Up
! Copy/Paste Stuff
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard
! Cursor ! Cursor
URxvt.cursorBlink: true URxvt.cursorBlink: true
@@ -50,12 +63,21 @@ URxvt.cursorUnderline: false
! Pointer ! Pointer
URxvt.pointerBlank: true URxvt.pointerBlank: true
! Solarized colors begin ! Disable printing the terminal contents when pressing PrintScreen.
URxvt.print-pipe: "cat > /dev/null"
!!! Solarized colors begin
! base03
URxvt.background: #002b36 URxvt.background: #002b36
URxvt.foreground: #657b83 ! base0
URxvt.foreground: #839496
! base03
URxvt.fadeColor: #002b36 URxvt.fadeColor: #002b36
! base1
URxvt.cursorColor: #93a1a1 URxvt.cursorColor: #93a1a1
! base01
URxvt.pointerColorBackground: #586e75 URxvt.pointerColorBackground: #586e75
! base1
URxvt.pointerColorForeground: #93a1a1 URxvt.pointerColorForeground: #93a1a1
!! black dark/light !! black dark/light

View File

@@ -5,12 +5,14 @@
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Cryptsetup alias # Cryptsetup alias
alias luksFormat='cryptsetup luksFormat -s 512 -c aes-xts-plain64 -h sha256 -i 15000' alias luksFormat='cryptsetup luksFormat --type=luks2 --pbkdf-memory=2560000 --pbkdf=argon2id -i 15000 -s 512 -h sha256 -c aes-xts-plain64'
# Colors # Colors
if [ `uname` != 'Darwin' -a `uname` != 'NetBSD' ] ; then if ls --version >/dev/null 2>&1 ; then
# Should have a better way to check for GNU versions
alias ls='ls --color=auto' alias ls='ls --color=auto'
fi
if [ `uname` != 'Darwin' -a `uname` != 'NetBSD' -a `uname` != 'FreeBSD' -a `uname` != 'OpenBSD' ] ; then
# Should have a better way to check for GNU versions
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto' alias fgrep='fgrep --color=auto'
@@ -33,3 +35,21 @@ alias dircount="for d in * ; do find \$d -type d | wc -l | tr -d '\n' ; echo ' '
# Drop caches for swap issues # Drop caches for swap issues
alias drop_caches="echo 3 | sudo /usr/bin/tee /proc/sys/vm/drop_caches" alias drop_caches="echo 3 | sudo /usr/bin/tee /proc/sys/vm/drop_caches"
# dump acpi temperature
alias gettemp='printf "%02.2f\n" "$(cat /sys/class/thermal/thermal_zone0/temp)e-3"'
# get git working directory
alias gitroot="git rev-parse --show-toplevel"
# SSH without host key checking
alias sshanon="ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no"
# Straight to ipython
alias ipy="ipython3"
# Skip the header on bc
alias bc="command bc -q"
# Get a decently readable df
alias dfh="df -h -x tmpfs -x devtmpfs"

View File

@@ -40,6 +40,3 @@ if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
fi fi
if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

View File

@@ -0,0 +1,33 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR EDITOR:vim
SETUVAR __fish_initialized:3100
SETUVAR fish_color_autosuggestion:586e75
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:93a1a1
SETUVAR fish_color_comment:586e75
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:268bd2
SETUVAR fish_color_error:dc322f
SETUVAR fish_color_escape:00a6b2
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:00a6b2
SETUVAR fish_color_param:839496
SETUVAR fish_color_quote:657b83
SETUVAR fish_color_redirection:6c71c4
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell\x0aType\x20\x60help\x60\x20for\x20instructions\x20on\x20how\x20to\x20use\x20fish
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:B3A06D
SETUVAR fish_pager_color_description:B3A06D
SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan

View File

@@ -0,0 +1,11 @@
# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: https
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor: !!null vim
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager: !!null less -R
# Aliases allow you to create nicknames for gh commands
aliases:
co: pr checkout

View File

@@ -0,0 +1,39 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=-1
tree_sort_key=0
tree_sort_direction=1
hide_kernel_threads=1
hide_userland_threads=1
shadow_other_users=0
show_thread_names=0
show_program_path=1
highlight_base_name=0
highlight_megabytes=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_always_by_pid=0
header_margin=1
detailed_cpu_time=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
account_guest_in_cpu_meter=0
color_scheme=6
enable_mouse=1
delay=15
left_meters=AllCPUs Memory Swap
left_meter_modes=1 1 1
right_meters=Tasks LoadAverage Uptime
right_meter_modes=2 2 2
hide_function_bar=0

View File

@@ -87,6 +87,10 @@ bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9 bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10 bindsym $mod+Shift+0 move container to workspace 10
# do some scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
# Move workspaces between monitors # Move workspaces between monitors
bindsym $mod+Shift+greater move workspace to output right bindsym $mod+Shift+greater move workspace to output right
bindsym $mod+Shift+less move workspace to output left bindsym $mod+Shift+less move workspace to output left
@@ -130,10 +134,13 @@ bindsym $alt+Control+Left workspace prev
# i3 lock # i3 lock
exec --no-startup-id ~/bin/i3lock.sh & exec --no-startup-id ~/bin/i3lock.sh &
exec --no-startup-id xset dpms 600
bindsym $mod+l exec \ bindsym $mod+l exec \
bash -c "i3lock -c 000000 -d && (sleep 2 && xset dpms force off) &" bash -c "i3lock -c 000000 && (sleep 2 && xset dpms force off) &"
bindsym $alt+Control+l exec \ bindsym $alt+Control+l exec \
bash -c "i3lock -c 000000 -d && (sleep 2 && xset dpms force off) &" bash -c "i3lock -c 000000 && (sleep 2 && xset dpms force off) &"
# suspend under systemd
bindsym $mod+Control+s exec --no-startup-id systemctl suspend
# things to start quickly # things to start quickly
bindsym $mod+g exec /usr/bin/google-chrome-beta --password-store=gnome bindsym $mod+g exec /usr/bin/google-chrome-beta --password-store=gnome
@@ -145,38 +152,33 @@ bindsym --whole-window $mod+button3 floating toggle
# media keys # media keys
# Pulse Audio controls # Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% bindsym XF86AudioRaiseVolume exec --no-startup-id ~/bin/pactl_helper volume +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% bindsym XF86AudioLowerVolume exec --no-startup-id ~/bin/pactl_helper volume -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle bindsym XF86AudioMute exec --no-startup-id ~/bin/pactl_helper mute toggle
bindsym XF86AudioMicMute exec --no-startup-id ~/bin/pactl_helper micmute toggle
bindsym F13 exec --no-startup-id ~/bin/pactl_helper micmute toggle
# Screen brightness controls # Screen brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10 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 \
(which xss-lock >/dev/null || /usr/bin/cinnamon-settings-daemon) &
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets
# Make GTK fonts look great again
exec --no-startup-id gnome-settings-daemon
exec --no-startup-id (sleep 2; nm-applet) &
exec --no-startup-id xset r rate 200 20 exec --no-startup-id xset r rate 200 20
exec --no-startup-id ~/bin/autostart.py #exec --no-startup-id ~/bin/autostart.py
exec --no-startup-id dex --autostart --environment x-cinnamon
# Solaar for mouse
exec --no-startup-id sh -c 'command solaar -w hide || true'
# customize windows # customize windows
for_window [window_role="pop-up"] floating enable for_window [window_role="pop-up"] floating enable

View File

@@ -45,6 +45,17 @@ function wireless {
} }
function wired { function wired {
local def_iface="$(ip route get 1.1.1.1 2>&1 | grep -oP 'dev \K\S+')"
if test -n "${def_iface}" ; then
cat <<-EOF
ethernet "${def_iface}" {
format_up = "E: %ip"
format_down = "E: down"
}
order += "ethernet ${def_iface}"
EOF
return 0
fi
cat <<-EOF cat <<-EOF
ethernet _first_ { ethernet _first_ {
format_up = "E: %ip" format_up = "E: %ip"

View File

@@ -0,0 +1,4 @@
" nvim config
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc

View File

@@ -0,0 +1 @@
/dev/null

View File

@@ -0,0 +1,15 @@
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/Shared"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

View File

@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-keyboard-shortcuts" version="1.0">
<property name="commands" type="empty">
<property name="default" type="empty">
<property name="&lt;Alt&gt;F1" type="empty"/>
<property name="&lt;Alt&gt;F2" type="empty">
<property name="startup-notify" type="empty"/>
</property>
<property name="&lt;Alt&gt;F3" type="empty">
<property name="startup-notify" type="empty"/>
</property>
<property name="&lt;Primary&gt;&lt;Alt&gt;Delete" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;l" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;t" type="empty"/>
<property name="XF86Display" type="empty"/>
<property name="&lt;Super&gt;p" type="empty"/>
<property name="&lt;Primary&gt;Escape" type="empty"/>
<property name="XF86WWW" type="empty"/>
<property name="HomePage" type="empty"/>
<property name="XF86Mail" type="empty"/>
<property name="Print" type="empty"/>
<property name="&lt;Alt&gt;Print" type="empty"/>
<property name="&lt;Shift&gt;Print" type="empty"/>
<property name="&lt;Super&gt;e" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;f" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Escape" type="empty"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;Escape" type="empty"/>
<property name="&lt;Super&gt;r" type="empty">
<property name="startup-notify" type="empty"/>
</property>
</property>
<property name="custom" type="empty">
<property name="&lt;Alt&gt;F2" type="string" value="xfce4-appfinder --collapsed">
<property name="startup-notify" type="bool" value="true"/>
</property>
<property name="&lt;Alt&gt;Print" type="string" value="xfce4-screenshooter -w"/>
<property name="&lt;Super&gt;r" type="string" value="xfce4-appfinder -c">
<property name="startup-notify" type="bool" value="true"/>
</property>
<property name="XF86WWW" type="string" value="exo-open --launch WebBrowser"/>
<property name="XF86Mail" type="string" value="exo-open --launch MailReader"/>
<property name="&lt;Alt&gt;F3" type="string" value="xfce4-appfinder">
<property name="startup-notify" type="bool" value="true"/>
</property>
<property name="Print" type="string" value="xfce4-screenshooter"/>
<property name="&lt;Primary&gt;Escape" type="string" value="xfdesktop --menu"/>
<property name="&lt;Shift&gt;Print" type="string" value="xfce4-screenshooter -r"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Delete" type="string" value="xfce4-session-logout"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;t" type="string" value="exo-open --launch TerminalEmulator"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;f" type="string" value="thunar"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;l" type="string" value="xflock4"/>
<property name="&lt;Alt&gt;F1" type="string" value="xfce4-popup-applicationsmenu"/>
<property name="&lt;Super&gt;p" type="string" value="xfce4-display-settings --minimal"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;Escape" type="string" value="xfce4-taskmanager"/>
<property name="&lt;Super&gt;e" type="string" value="thunar"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Escape" type="string" value="xkill"/>
<property name="HomePage" type="string" value="exo-open --launch WebBrowser"/>
<property name="XF86Display" type="string" value="xfce4-display-settings --minimal"/>
<property name="override" type="bool" value="true"/>
<property name="&lt;Super&gt;l" type="string" value="xflock4"/>
</property>
</property>
<property name="xfwm4" type="empty">
<property name="default" type="empty">
<property name="&lt;Alt&gt;Insert" type="empty"/>
<property name="Escape" type="empty"/>
<property name="Left" type="empty"/>
<property name="Right" type="empty"/>
<property name="Up" type="empty"/>
<property name="Down" type="empty"/>
<property name="&lt;Alt&gt;Tab" type="empty"/>
<property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="empty"/>
<property name="&lt;Alt&gt;Delete" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Down" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Left" type="empty"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="empty"/>
<property name="&lt;Alt&gt;F4" type="empty"/>
<property name="&lt;Alt&gt;F6" type="empty"/>
<property name="&lt;Alt&gt;F7" type="empty"/>
<property name="&lt;Alt&gt;F8" type="empty"/>
<property name="&lt;Alt&gt;F9" type="empty"/>
<property name="&lt;Alt&gt;F10" type="empty"/>
<property name="&lt;Alt&gt;F11" type="empty"/>
<property name="&lt;Alt&gt;F12" type="empty"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;End" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Home" type="empty"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="empty"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_1" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_2" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_3" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_4" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_5" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_6" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_7" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_8" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_9" type="empty"/>
<property name="&lt;Alt&gt;space" type="empty"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Right" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;d" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Up" type="empty"/>
<property name="&lt;Super&gt;Tab" type="empty"/>
<property name="&lt;Primary&gt;F1" type="empty"/>
<property name="&lt;Primary&gt;F2" type="empty"/>
<property name="&lt;Primary&gt;F3" type="empty"/>
<property name="&lt;Primary&gt;F4" type="empty"/>
<property name="&lt;Primary&gt;F5" type="empty"/>
<property name="&lt;Primary&gt;F6" type="empty"/>
<property name="&lt;Primary&gt;F7" type="empty"/>
<property name="&lt;Primary&gt;F8" type="empty"/>
<property name="&lt;Primary&gt;F9" type="empty"/>
<property name="&lt;Primary&gt;F10" type="empty"/>
<property name="&lt;Primary&gt;F11" type="empty"/>
<property name="&lt;Primary&gt;F12" type="empty"/>
<property name="&lt;Super&gt;KP_Left" type="empty"/>
<property name="&lt;Super&gt;KP_Right" type="empty"/>
<property name="&lt;Super&gt;KP_Up" type="empty"/>
<property name="&lt;Super&gt;KP_Down" type="empty"/>
<property name="&lt;Super&gt;KP_Page_Up" type="empty"/>
<property name="&lt;Super&gt;KP_Home" type="empty"/>
<property name="&lt;Super&gt;KP_End" type="empty"/>
<property name="&lt;Super&gt;KP_Next" type="empty"/>
</property>
<property name="custom" type="empty">
<property name="&lt;Primary&gt;F12" type="string" value="workspace_12_key"/>
<property name="&lt;Alt&gt;F4" type="string" value="close_window_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_3" type="string" value="move_window_workspace_3_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Down" type="string" value="down_workspace_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_9" type="string" value="move_window_workspace_9_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;End" type="string" value="move_window_next_workspace_key"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="string" value="move_window_left_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_4" type="string" value="move_window_workspace_4_key"/>
<property name="Right" type="string" value="right_key"/>
<property name="Down" type="string" value="down_key"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="string" value="lower_window_key"/>
<property name="&lt;Alt&gt;Tab" type="string" value="cycle_windows_key"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="string" value="move_window_right_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Right" type="string" value="right_workspace_key"/>
<property name="&lt;Alt&gt;F6" type="string" value="stick_window_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_5" type="string" value="move_window_workspace_5_key"/>
<property name="&lt;Primary&gt;F11" type="string" value="workspace_11_key"/>
<property name="&lt;Alt&gt;F10" type="string" value="maximize_window_key"/>
<property name="&lt;Alt&gt;Delete" type="string" value="del_workspace_key"/>
<property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;d" type="string" value="show_desktop_key"/>
<property name="&lt;Super&gt;KP_Page_Up" type="string" value="tile_up_right_key"/>
<property name="&lt;Alt&gt;F7" type="string" value="move_window_key"/>
<property name="Up" type="string" value="up_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_6" type="string" value="move_window_workspace_6_key"/>
<property name="&lt;Alt&gt;F11" type="string" value="fullscreen_key"/>
<property name="&lt;Alt&gt;space" type="string" value="popup_menu_key"/>
<property name="&lt;Super&gt;KP_Home" type="string" value="tile_up_left_key"/>
<property name="Escape" type="string" value="cancel_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_1" type="string" value="move_window_workspace_1_key"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="string" value="raise_window_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Home" type="string" value="move_window_prev_workspace_key"/>
<property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="string" value="cycle_reverse_windows_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Left" type="string" value="left_workspace_key"/>
<property name="&lt;Alt&gt;F12" type="string" value="above_key"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="string" value="move_window_up_key"/>
<property name="&lt;Alt&gt;F8" type="string" value="resize_window_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_7" type="string" value="move_window_workspace_7_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_2" type="string" value="move_window_workspace_2_key"/>
<property name="&lt;Super&gt;KP_End" type="string" value="tile_down_left_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Up" type="string" value="up_workspace_key"/>
<property name="&lt;Alt&gt;F9" type="string" value="hide_window_key"/>
<property name="Left" type="string" value="left_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_8" type="string" value="move_window_workspace_8_key"/>
<property name="&lt;Alt&gt;Insert" type="string" value="add_workspace_key"/>
<property name="override" type="bool" value="true"/>
<property name="&lt;Super&gt;1" type="string" value="workspace_1_key"/>
<property name="&lt;Super&gt;2" type="string" value="workspace_2_key"/>
<property name="&lt;Super&gt;3" type="string" value="workspace_3_key"/>
<property name="&lt;Super&gt;4" type="string" value="workspace_4_key"/>
<property name="&lt;Super&gt;5" type="string" value="workspace_5_key"/>
<property name="&lt;Super&gt;6" type="string" value="workspace_6_key"/>
<property name="&lt;Super&gt;7" type="string" value="workspace_7_key"/>
<property name="&lt;Super&gt;8" type="string" value="workspace_8_key"/>
<property name="&lt;Super&gt;9" type="string" value="workspace_9_key"/>
<property name="&lt;Super&gt;0" type="string" value="workspace_10_key"/>
<property name="&lt;Super&gt;Left" type="string" value="tile_left_key"/>
<property name="&lt;Super&gt;Right" type="string" value="tile_right_key"/>
<property name="&lt;Super&gt;Up" type="string" value="tile_down_key"/>
<property name="&lt;Super&gt;Down" type="string" value="tile_up_key"/>
<property name="&lt;Super&gt;Page_Down" type="string" value="tile_down_right_key"/>
</property>
</property>
<property name="providers" type="array">
<value type="string" value="xfwm4"/>
<value type="string" value="commands"/>
</property>
</channel>

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfwm4" version="1.0">
<property name="general" type="empty">
<property name="activate_action" type="string" value="bring"/>
<property name="borderless_maximize" type="bool" value="true"/>
<property name="box_move" type="bool" value="false"/>
<property name="box_resize" type="bool" value="false"/>
<property name="button_layout" type="string" value="O|SHMC"/>
<property name="button_offset" type="int" value="0"/>
<property name="button_spacing" type="int" value="0"/>
<property name="click_to_focus" type="bool" value="false"/>
<property name="cycle_apps_only" type="bool" value="false"/>
<property name="cycle_draw_frame" type="bool" value="true"/>
<property name="cycle_raise" type="bool" value="false"/>
<property name="cycle_hidden" type="bool" value="true"/>
<property name="cycle_minimum" type="bool" value="true"/>
<property name="cycle_minimized" type="bool" value="false"/>
<property name="cycle_preview" type="bool" value="true"/>
<property name="cycle_tabwin_mode" type="int" value="0"/>
<property name="cycle_workspaces" type="bool" value="false"/>
<property name="double_click_action" type="string" value="maximize"/>
<property name="double_click_distance" type="int" value="5"/>
<property name="double_click_time" type="int" value="250"/>
<property name="easy_click" type="string" value="Alt"/>
<property name="focus_delay" type="int" value="316"/>
<property name="focus_hint" type="bool" value="true"/>
<property name="focus_new" type="bool" value="true"/>
<property name="frame_opacity" type="int" value="100"/>
<property name="frame_border_top" type="int" value="0"/>
<property name="full_width_title" type="bool" value="true"/>
<property name="horiz_scroll_opacity" type="bool" value="false"/>
<property name="inactive_opacity" type="int" value="100"/>
<property name="maximized_offset" type="int" value="0"/>
<property name="mousewheel_rollup" type="bool" value="true"/>
<property name="move_opacity" type="int" value="100"/>
<property name="placement_mode" type="string" value="center"/>
<property name="placement_ratio" type="int" value="20"/>
<property name="popup_opacity" type="int" value="100"/>
<property name="prevent_focus_stealing" type="bool" value="false"/>
<property name="raise_delay" type="int" value="250"/>
<property name="raise_on_click" type="bool" value="true"/>
<property name="raise_on_focus" type="bool" value="false"/>
<property name="raise_with_any_button" type="bool" value="true"/>
<property name="repeat_urgent_blink" type="bool" value="false"/>
<property name="resize_opacity" type="int" value="100"/>
<property name="scroll_workspaces" type="bool" value="true"/>
<property name="shadow_delta_height" type="int" value="0"/>
<property name="shadow_delta_width" type="int" value="0"/>
<property name="shadow_delta_x" type="int" value="0"/>
<property name="shadow_delta_y" type="int" value="-3"/>
<property name="shadow_opacity" type="int" value="50"/>
<property name="show_app_icon" type="bool" value="false"/>
<property name="show_dock_shadow" type="bool" value="true"/>
<property name="show_frame_shadow" type="bool" value="true"/>
<property name="show_popup_shadow" type="bool" value="false"/>
<property name="snap_resist" type="bool" value="false"/>
<property name="snap_to_border" type="bool" value="true"/>
<property name="snap_to_windows" type="bool" value="false"/>
<property name="snap_width" type="int" value="10"/>
<property name="vblank_mode" type="string" value="auto"/>
<property name="theme" type="string" value="Default"/>
<property name="tile_on_move" type="bool" value="true"/>
<property name="title_alignment" type="string" value="center"/>
<property name="title_font" type="string" value="Sans Bold 9"/>
<property name="title_horizontal_offset" type="int" value="0"/>
<property name="titleless_maximize" type="bool" value="false"/>
<property name="title_shadow_active" type="string" value="false"/>
<property name="title_shadow_inactive" type="string" value="false"/>
<property name="title_vertical_offset_active" type="int" value="0"/>
<property name="title_vertical_offset_inactive" type="int" value="0"/>
<property name="toggle_workspaces" type="bool" value="false"/>
<property name="unredirect_overlays" type="bool" value="true"/>
<property name="urgent_blink" type="bool" value="false"/>
<property name="use_compositing" type="bool" value="true"/>
<property name="workspace_count" type="int" value="6"/>
<property name="wrap_cycle" type="bool" value="true"/>
<property name="wrap_layout" type="bool" value="true"/>
<property name="wrap_resistance" type="int" value="10"/>
<property name="wrap_windows" type="bool" value="true"/>
<property name="wrap_workspaces" type="bool" value="false"/>
<property name="zoom_desktop" type="bool" value="true"/>
<property name="zoom_pointer" type="bool" value="true"/>
<property name="workspace_names" type="array">
<value type="string" value="Workspace 1"/>
<value type="string" value="Workspace 2"/>
<value type="string" value="Workspace 3"/>
<value type="string" value="Workspace 4"/>
<value type="string" value="Workspace 5"/>
<value type="string" value="Workspace 6"/>
</property>
</property>
</channel>

View File

@@ -1,4 +1,3 @@
tlsv1 tlsv1
user-agent = "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0 Safari/537.36"
create-dirs create-dirs
referer = ";auto" referer = ";auto"

View File

@@ -1,16 +1,51 @@
# Exact Solarized Dark color theme for the color GNU ls utility.
# Dark 256 color solarized theme for the color GNU ls utility. # Designed for dircolors (GNU coreutils) 5.97
# Used and tested with dircolors (GNU coreutils) 8.5
# #
# @author {@link http://sebastian.tramp.name Sebastian Tramp} # This simple theme was simultaneously designed for these terminal color schemes:
# @license http://sam.zoy.org/wtfpl/ Do What The Fuck You Want To Public License (WTFPL) # - Solarized dark (best)
# - Solarized light
# - default dark
# - default light
# with a slight optimization for Solarized Dark.
# #
# More Information at # How the colors were selected:
# https://github.com/seebi/dircolors-solarized # - Terminal emulators often have an option typically enabled by default that makes
# bold a different color. It is important to leave this option enabled so that
# you can access the entire 16-color Solarized palette, and not just 8 colors.
# - We favor universality over a greater number of colors. So we limit the number
# of colors so that this theme will work out of the box in all terminals,
# Solarized or not, dark or light.
# - We choose to have the following category of files:
# NORMAL & FILE, DIR, LINK, EXEC and
# editable text including source, unimportant text, binary docs & multimedia source
# files, viewable multimedia, archived/compressed, and unimportant non-text
# - For uniqueness, we stay away from the Solarized foreground colors are -- either
# base00 (brightyellow) or base0 (brightblue). However, they can be used if
# you know what the bg/fg colors of your terminal are, in order to optimize the display.
# - 3 different options are provided: universal, solarized dark, and solarized light.
# The only difference between the universal scheme and one that's optimized for
# dark/light is the color of "unimportant" files, which should blend more with the
# background
# - We note that blue is the hardest color to see on dark bg and yellow is the hardest
# color to see on light bg (with blue being particularly bad). So we choose yellow
# for multimedia files which are usually accessed in a GUI folder browser anyway.
# And blue is kept for custom use of this scheme's user.
# - See table below to see the assignments.
# Term Section
TERM Eterm # Installation instructions:
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty
# Below, there should be one TERM entry for each termtype that is colorizable
TERM ansi TERM ansi
TERM color_xterm
TERM color-xterm TERM color-xterm
TERM con132x25 TERM con132x25
TERM con132x30 TERM con132x30
@@ -28,6 +63,7 @@ TERM cygwin
TERM dtterm TERM dtterm
TERM dvtm TERM dvtm
TERM dvtm-256color TERM dvtm-256color
TERM Eterm
TERM eterm-color TERM eterm-color
TERM fbterm TERM fbterm
TERM gnome TERM gnome
@@ -40,6 +76,7 @@ TERM linux
TERM linux-c TERM linux-c
TERM mach-color TERM mach-color
TERM mlterm TERM mlterm
TERM nxterm
TERM putty TERM putty
TERM putty-256color TERM putty-256color
TERM rxvt TERM rxvt
@@ -63,12 +100,16 @@ TERM screen-bce
TERM screen-w TERM screen-w
TERM screen.linux TERM screen.linux
TERM screen.xterm-256color TERM screen.xterm-256color
TERM screen.xterm-new
TERM st TERM st
TERM st-meta TERM st-meta
TERM st-256color TERM st-256color
TERM st-meta-256color TERM st-meta-256color
TERM tmux
TERM tmux-256color
TERM vt100 TERM vt100
TERM xterm TERM xterm
TERM xterm-new
TERM xterm-16color TERM xterm-16color
TERM xterm-256color TERM xterm-256color
TERM xterm-256color-italic TERM xterm-256color-italic
@@ -77,12 +118,13 @@ TERM xterm-color
TERM xterm-debian TERM xterm-debian
TERM xterm-termite TERM xterm-termite
## Documentation # EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
# EIGHTBIT 1
# standard colors
# #############################################################################
# Below are the color init strings for the basic file types. A color init # Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes: # string consists of one or more of the following numeric codes:
#
# Attribute codes: # Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes: # Text color codes:
@@ -90,206 +132,349 @@ TERM xterm-termite
# Background color codes: # Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
# #
# # NOTES:
# 256 color support # - See http://www.oreilly.com/catalog/wdnut/excerpt/color_names.html
# see here: http://www.mail-archive.com/bug-coreutils@gnu.org/msg11030.html) # - Color combinations
# # ANSI Color code Solarized Notes Universal SolDark SolLight
# Text 256 color coding: # ~~~~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~ ~~~~~~~~~ ~~~~~~~ ~~~~~~~~
# 38;5;COLOR_NUMBER # 00 none NORMAL, FILE <SAME> <SAME>
# Background 256 color coding: # 30 black base02
# 48;5;COLOR_NUMBER # 01;30 bright black base03 bg of SolDark
# 31 red red docs & mm src <SAME> <SAME>
## Special files # 01;31 bright red orange EXEC <SAME> <SAME>
# 32 green green editable text <SAME> <SAME>
NORMAL 00;38;5;244 # no color code at all # 01;32 bright green base01 unimportant text <SAME>
#FILE 00 # regular file: use no color at all # 33 yellow yellow unclear in light bg multimedia <SAME> <SAME>
RESET 0 # reset to "normal" color # 01;33 bright yellow base00 fg of SolLight unimportant non-text
DIR 00;38;5;33 # directory 01;34 # 34 blue blue unclear in dark bg user customized <SAME> <SAME>
LINK 00;38;5;37 # symbolic link. (If you set this to 'target' instead of a # 01;34 bright blue base0 fg in SolDark unimportant text
# numerical value, the color is as for the file pointed to.) # 35 magenta magenta LINK <SAME> <SAME>
MULTIHARDLINK 00 # regular file with more than one link # 01;35 bright magenta violet archive/compressed <SAME> <SAME>
FIFO 48;5;230;38;5;136;01 # pipe # 36 cyan cyan DIR <SAME> <SAME>
SOCK 48;5;230;38;5;136;01 # socket # 01;36 bright cyan base1 unimportant non-text <SAME>
DOOR 48;5;230;38;5;136;01 # door # 37 white base2
BLK 48;5;230;38;5;244;01 # block device driver # 01;37 bright white base3 bg in SolLight
CHR 48;5;230;38;5;244;01 # character device driver # 05;37;41 unclear in Putty dark
ORPHAN 48;5;235;38;5;160 # symlink to nonexistent file, or non-stat'able file
SETUID 48;5;160;38;5;230 # file that is setuid (u+s)
SETGID 48;5;136;38;5;230 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
STICKY_OTHER_WRITABLE 48;5;64;38;5;230 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 48;5;235;38;5;33 # dir that is other-writable (o+w) and not sticky
STICKY 48;5;33;38;5;230 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
EXEC 00;38;5;64
## Archives or compressed (violet + bold for compression)
.tar 00;38;5;61
.tgz 00;38;5;61
.arj 00;38;5;61
.taz 00;38;5;61
.lzh 00;38;5;61
.lzma 00;38;5;61
.tlz 00;38;5;61
.txz 00;38;5;61
.zip 00;38;5;61
.z 00;38;5;61
.Z 00;38;5;61
.dz 00;38;5;61
.gz 00;38;5;61
.lz 00;38;5;61
.xz 00;38;5;61
.bz2 00;38;5;61
.bz 00;38;5;61
.tbz 00;38;5;61
.tbz2 00;38;5;61
.tz 00;38;5;61
.deb 00;38;5;61
.rpm 00;38;5;61
.jar 00;38;5;61
.rar 00;38;5;61
.ace 00;38;5;61
.zoo 00;38;5;61
.cpio 00;38;5;61
.7z 00;38;5;61
.rz 00;38;5;61
.apk 00;38;5;61
.gem 00;38;5;61
# Image formats (yellow)
.jpg 00;38;5;136
.JPG 00;38;5;136 #stupid but needed
.jpeg 00;38;5;136
.gif 00;38;5;136
.bmp 00;38;5;136
.pbm 00;38;5;136
.pgm 00;38;5;136
.ppm 00;38;5;136
.tga 00;38;5;136
.xbm 00;38;5;136
.xpm 00;38;5;136
.tif 00;38;5;136
.tiff 00;38;5;136
.png 00;38;5;136
.PNG 00;38;5;136
.svg 00;38;5;136
.svgz 00;38;5;136
.mng 00;38;5;136
.pcx 00;38;5;136
.dl 00;38;5;136
.xcf 00;38;5;136
.xwd 00;38;5;136
.yuv 00;38;5;136
.cgm 00;38;5;136
.emf 00;38;5;136
.eps 00;38;5;136
.CR2 00;38;5;136
.ico 00;38;5;136
# Files of special interest (base1)
.tex 00;38;5;245
.rdf 00;38;5;245
.owl 00;38;5;245
.n3 00;38;5;245
.ttl 00;38;5;245
.nt 00;38;5;245
.torrent 00;38;5;245
.xml 00;38;5;245
*Makefile 00;38;5;245
*Rakefile 00;38;5;245
*Dockerfile 00;38;5;245
*build.xml 00;38;5;245
*rc 00;38;5;245
*1 00;38;5;245
.nfo 00;38;5;245
*README 00;38;5;245
*README.txt 00;38;5;245
*readme.txt 00;38;5;245
.md 00;38;5;245
*README.markdown 00;38;5;245
.ini 00;38;5;245
.yml 00;38;5;245
.cfg 00;38;5;245
.conf 00;38;5;245
.c 00;38;5;245
.cpp 00;38;5;245
.cc 00;38;5;245
.sqlite 00;38;5;245
.go 00;38;5;245
.sql 00;38;5;245
# "unimportant" files as logs and backups (base01)
.log 00;38;5;240
.bak 00;38;5;240
.aux 00;38;5;240
.lof 00;38;5;240
.lol 00;38;5;240
.lot 00;38;5;240
.out 00;38;5;240
.toc 00;38;5;240
.bbl 00;38;5;240
.blg 00;38;5;240
*~ 00;38;5;240
*# 00;38;5;240
.part 00;38;5;240
.incomplete 00;38;5;240
.swp 00;38;5;240
.tmp 00;38;5;240
.temp 00;38;5;240
.o 00;38;5;240
.pyc 00;38;5;240
.class 00;38;5;240
.cache 00;38;5;240
# Audio formats (orange)
.aac 00;38;5;166
.au 00;38;5;166
.flac 00;38;5;166
.mid 00;38;5;166
.midi 00;38;5;166
.mka 00;38;5;166
.mp3 00;38;5;166
.mpc 00;38;5;166
.ogg 00;38;5;166
.ra 00;38;5;166
.wav 00;38;5;166
.m4a 00;38;5;166
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axa 00;38;5;166
.oga 00;38;5;166
.spx 00;38;5;166
.xspf 00;38;5;166
# Video formats (as audio + bold)
.mov 00;38;5;166
.MOV 00;38;5;166
.mpg 00;38;5;166
.mpeg 00;38;5;166
.m2v 00;38;5;166
.mkv 00;38;5;166
.ogm 00;38;5;166
.mp4 00;38;5;166
.m4v 00;38;5;166
.mp4v 00;38;5;166
.vob 00;38;5;166
.qt 00;38;5;166
.nuv 00;38;5;166
.wmv 00;38;5;166
.asf 00;38;5;166
.rm 00;38;5;166
.rmvb 00;38;5;166
.flc 00;38;5;166
.avi 00;38;5;166
.fli 00;38;5;166
.flv 00;38;5;166
.gl 00;38;5;166
.m2ts 00;38;5;166
.divx 00;38;5;166
.webm 00;38;5;166
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axv 00;38;5;166
.anx 00;38;5;166
.ogv 00;38;5;166
.ogx 00;38;5;166
### By file type
# global default
NORMAL 00
# normal file
FILE 00
# directory
DIR 34
# 777 directory
OTHER_WRITABLE 34;40
# symbolic link
LINK 35
# pipe, socket, block device, character device (blue bg)
FIFO 30;44
SOCK 35;44
DOOR 35;44 # Solaris 2.5 and later
BLK 33;44
CHR 37;44
#############################################################################
### By file attributes
# Orphaned symlinks (blinking white on red)
# Blink may or may not work (works on iTerm dark or light, and Putty dark)
ORPHAN 05;37;41
# ... and the files that orphaned symlinks point to (blinking white on red)
MISSING 05;37;41
# files with execute permission
EXEC 01;31 # Unix
.cmd 01;31 # Win
.exe 01;31 # Win
.com 01;31 # Win
.bat 01;31 # Win
.reg 01;31 # Win
.app 01;31 # OSX
#############################################################################
### By extension
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
### Text formats
# Text that we can edit with a regular editor
.txt 32
.org 32
.md 32
.mkd 32
# Source text
.h 32
.hpp 32
.c 32
.C 32
.cc 32
.cpp 32
.cxx 32
.objc 32
.cl 32
.sh 32
.bash 32
.csh 32
.zsh 32
.el 32
.vim 32
.java 32
.pl 32
.pm 32
.py 32
.rb 32
.hs 32
.php 32
.htm 32
.html 32
.shtml 32
.erb 32
.haml 32
.xml 32
.rdf 32
.css 32
.sass 32
.scss 32
.less 32
.js 32
.coffee 32
.man 32
.0 32
.1 32
.2 32
.3 32
.4 32
.5 32
.6 32
.7 32
.8 32
.9 32
.l 32
.n 32
.p 32
.pod 32
.tex 32
.go 32
.sql 32
.csv 32
.sv 32
.svh 32
.v 32
.vh 32
.vhd 32
### Multimedia formats
# Image
.bmp 33
.cgm 33
.dl 33
.dvi 33
.emf 33
.eps 33
.gif 33
.jpeg 33
.jpg 33
.JPG 33
.mng 33
.pbm 33
.pcx 33
.pdf 33
.pgm 33
.png 33
.PNG 33
.ppm 33
.pps 33
.ppsx 33
.ps 33
.svg 33
.svgz 33
.tga 33
.tif 33
.tiff 33
.xbm 33
.xcf 33
.xpm 33
.xwd 33
.xwd 33
.yuv 33
# Audio
.aac 33
.au 33
.flac 33
.m4a 33
.mid 33
.midi 33
.mka 33
.mp3 33
.mpa 33
.mpeg 33
.mpg 33
.ogg 33
.opus 33
.ra 33
.wav 33
# Video
.anx 33
.asf 33
.avi 33
.axv 33
.flc 33
.fli 33
.flv 33
.gl 33
.m2v 33
.m4v 33
.mkv 33
.mov 33
.MOV 33
.mp4 33
.mp4v 33
.mpeg 33
.mpg 33
.nuv 33
.ogm 33
.ogv 33
.ogx 33
.qt 33
.rm 33
.rmvb 33
.swf 33
.vob 33
.webm 33
.wmv 33
### Misc
# Binary document formats and multimedia source
.doc 31
.docx 31
.rtf 31
.odt 31
.dot 31
.dotx 31
.ott 31
.xls 31
.xlsx 31
.ods 31
.ots 31
.ppt 31
.pptx 31
.odp 31
.otp 31
.fla 31
.psd 31
# Archives, compressed
.7z 1;35
.apk 1;35
.arj 1;35
.bin 1;35
.bz 1;35
.bz2 1;35
.cab 1;35 # Win
.deb 1;35
.dmg 1;35 # OSX
.gem 1;35
.gz 1;35
.iso 1;35
.jar 1;35
.msi 1;35 # Win
.rar 1;35
.rpm 1;35
.tar 1;35
.tbz 1;35
.tbz2 1;35
.tgz 1;35
.tx 1;35
.war 1;35
.xpi 1;35
.xz 1;35
.z 1;35
.Z 1;35
.zip 1;35
# For testing
.ANSI-30-black 30
.ANSI-01;30-brblack 01;30
.ANSI-31-red 31
.ANSI-01;31-brred 01;31
.ANSI-32-green 32
.ANSI-01;32-brgreen 01;32
.ANSI-33-yellow 33
.ANSI-01;33-bryellow 01;33
.ANSI-34-blue 34
.ANSI-01;34-brblue 01;34
.ANSI-35-magenta 35
.ANSI-01;35-brmagenta 01;35
.ANSI-36-cyan 36
.ANSI-01;36-brcyan 01;36
.ANSI-37-white 37
.ANSI-01;37-brwhite 01;37
#############################################################################
# Your customizations
# Unimportant text files
# For universal scheme, use brightgreen 01;32
# For optimal on light bg (but too prominent on dark bg), use white 01;34
.log 01;32
*~ 01;32
*# 01;32
#.log 01;34
#*~ 01;34
#*# 01;34
# Unimportant non-text files
# For universal scheme, use brightcyan 01;36
# For optimal on dark bg (but too prominent on light bg), change to 01;33
#.bak 01;36
#.BAK 01;36
#.old 01;36
#.OLD 01;36
#.org_archive 01;36
#.off 01;36
#.OFF 01;36
#.dist 01;36
#.DIST 01;36
#.orig 01;36
#.ORIG 01;36
#.swp 01;36
#.swo 01;36
#*,v 01;36
.bak 01;33
.BAK 01;33
.old 01;33
.OLD 01;33
.org_archive 01;33
.off 01;33
.OFF 01;33
.dist 01;33
.DIST 01;33
.orig 01;33
.ORIG 01;33
.swp 01;33
.swo 01;33
*,v 01;33
# The brightmagenta (Solarized: purple) color is free for you to use for your
# custom file type
.gpg 34
.gpg 34
.pgp 34
.asc 34
.3des 34
.aes 34
.enc 34
.sqlite 34

View File

@@ -1,12 +1,12 @@
# Sourced by zshrc as well as bash. # Sourced by zshrc as well as bash.
# Should only use POSIX shell constructs.
umask 027 umask 027
ulimit -c unlimited
# Paths and preferences # Paths and preferences
export PYTHONPATH="$HOME/.python:$PYTHONPATH" export PYTHONPATH="$HOME/.python:$PYTHONPATH"
export GOPATH="$HOME/Projects/Go" export GOPATH="$HOME/go:$HOME/Projects/Go:/usr/share/gocode"
export PATH="$HOME/bin:/sbin:/usr/sbin:$PATH:$GOPATH/bin" export PATH="$HOME/bin:$HOME/bin/tools:/sbin:/usr/sbin:$PATH:$HOME/go/bin"
export VISUAL=vim export VISUAL=vim
export EDITOR=vim export EDITOR=vim
export DEBEMAIL="david@systemoverlord.com" export DEBEMAIL="david@systemoverlord.com"
@@ -15,14 +15,71 @@ export LESS="-MR"
export QUOTING_STYLE="literal" # Coreutils quotes export QUOTING_STYLE="literal" # Coreutils quotes
# Fix gnome-terminal # Fix gnome-terminal
if [[ $TERM == "xterm" && $COLORTERM == "gnome-terminal" ]] ; then if [ "$TERM" = "xterm" ] && [ "$COLORTERM" = "gnome-terminal" ] ; then
# Requires `ncurses-base` package for terminfo.
export TERM="xterm-256color" export TERM="xterm-256color"
fi fi
# Terminal preferences for i3
if [ -z "${TERMINAL}" ] ; then
for t in urxvt gnome-terminal; do
if TERMINAL=$(command -v ${t}) ; then
export TERMINAL
fi
done
fi
# Browser preferences
if [ -z "${BROWSER}" ] ; then
for t in google-chrome-beta google-chrome firefox ; do
if BROWSER=$(command -v ${t}); then
export BROWSER
break
fi
done
fi
# For virtualenvwrapper # For virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs export WORKON_HOME=$HOME/.virtualenvs
# GPG full key id # GPG full key id
export GPG_ID=7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B export GPG_ID=7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B
if [[ -e $HOME/.localenv ]] ; then source $HOME/.localenv ; fi # Setup locale
if test -x /usr/bin/locale ; then
for l in en_US.utf8 en_US.UTF-8 C.UTF-8 C ; do
if /usr/bin/locale -a | grep -q "${l}" ; then
export LC_CTYPE=${l}
export LC_NUMERIC=${l}
export LC_TIME=${l}
export LC_MONETARY=${l}
export LC_MESSAGES=${l}
export LC_PAPER=${l}
export LC_NAME=${l}
export LC_ADDRESS=${l}
export LC_TELEPHONE=${l}
export LC_MEASUREMENT=${l}
export LC_IDENTIFICATION=${l}
break
fi
done
else
export LC_CTYPE=C
export LC_NUMERIC=C
export LC_TIME=C
export LC_MONETARY=C
export LC_MESSAGES=C
export LC_PAPER=C
export LC_NAME=C
export LC_ADDRESS=C
export LC_TELEPHONE=C
export LC_MEASUREMENT=C
export LC_IDENTIFICATION=C
fi
export LC_COLLATE=C
# Opt out of .net telemetry
export DOTNET_CLI_TELEMETRY_OPTOUT=1
# shellcheck source=/dev/null
test -e "$HOME/.localenv" && . "$HOME/.localenv"

View File

@@ -26,10 +26,13 @@ end
python python
import sys import sys
import os.path import os.path
pwndbg = os.path.expanduser('~/.pwndbg/gdbinit.py') gef = os.path.expanduser('~/tools/gef/gef.py')
pwndbg = os.path.expanduser('~/tools/pwndbg/gdbinit.py')
peda = os.path.expanduser('~/.peda/peda.py') peda = os.path.expanduser('~/.peda/peda.py')
if os.path.isfile(pwndbg): if os.path.isfile(gef):
sys.path.insert(0, os.path.expanduser('~/.pwndbg/vendor')) gdb.execute('source {}'.format(gef))
elif os.path.isfile(pwndbg):
sys.path.insert(0, os.path.expanduser('~/tools/pwndbg/vendor'))
gdb.execute('source {}'.format(pwndbg)) gdb.execute('source {}'.format(pwndbg))
elif os.path.isfile(peda): elif os.path.isfile(peda):
gdb.execute('source {}'.format(peda)) gdb.execute('source {}'.format(peda))

125
dotfiles/gef.rc Normal file
View File

@@ -0,0 +1,125 @@
[context]
clear_screen = False
enable = True
grow_stack_down = False
ignore_registers =
layout = legend regs stack code args source memory threads trace extra
nb_lines_backtrace = 10
nb_lines_code = 6
nb_lines_code_prev = 3
nb_lines_stack = 8
nb_lines_threads = -1
peek_calls = True
peek_ret = True
redirect =
show_registers_raw = False
show_stack_raw = False
[dereference]
max_recursion = 7
[entry-break]
entrypoint_symbols = main _main __libc_start_main __uClibc_main start _start
[gef-remote]
clean_on_exit = False
[gef]
autosave_breakpoints_file =
debug = False
disable_color = False
extra_plugins_dir =
follow_child = True
readline_compat = False
[got]
function_not_resolved = yellow
function_resolved = green
[heap-analysis-helper]
check_double_free = True
check_free_null = False
check_heap_overlap = True
check_uaf = True
check_weird_free = True
[heap-chunks]
peek_nb_byte = 16
[hexdump]
always_show_ascii = False
[highlight]
regex = False
[ida-interact]
host = 127.0.0.1
port = 1337
sync_cursor = False
[pattern]
length = 1024
[pcustom]
struct_path = /tmp/gef/structs
[process-search]
ps_command = /bin/ps auxww
[syscall-args]
path = /tmp/gef/syscall-tables
[theme]
address_code = red
address_heap = green
address_stack = pink
context_title_line = gray
context_title_message = cyan
default_title_line = gray
default_title_message = cyan
dereference_base_address = cyan
dereference_code = gray
dereference_register_value = bold blue
dereference_string = yellow
disassemble_current_instruction = green
registers_register_name = blue
registers_value_changed = bold red
source_current_line = green
table_heading = blue
[trace-run]
max_tracing_recursion = 1
tracefile_prefix = ./gef-trace-
[aliases]
pf = print-format
status = process-status
binaryninja-interact = ida-interact
bn = ida-interact
binja = ida-interact
lookup = scan
grep = search-pattern
xref = search-pattern
flags = edit-flags
sc-search = shellcode search
sc-get = shellcode get
ps = process-search
start = entry-break
nb = name-break
ctx = context
telescope = dereference
pattern offset = pattern search
hl = highlight
highlight ls = highlight list
hll = highlight list
hlc = highlight clear
highlight set = highlight add
hla = highlight add
highlight delete = highlight remove
highlight del = highlight remove
highlight unset = highlight remove
highlight rm = highlight remove
hlr = highlight remove
fmtstr-helper = format-string-helper
screen-setup = tmux-setup

View File

@@ -1,12 +1,12 @@
[user] [user]
name = David Tomaschik name = David Tomaschik
email = david@systemoverlord.com
signingKey = 0x5DEA789B signingKey = 0x5DEA789B
[core] [core]
excludesfile = ~/.gitignore excludesfile = ~/.gitignore
editor = vim editor = vim
whitespace = trailing-space,space-before-tab whitespace = trailing-space,space-before-tab
pager = command -v delta >/dev/null 2>&1 && delta || less -eFiJM~ -j3
[color] [color]
diff = auto diff = auto
@@ -14,6 +14,7 @@
[diff] [diff]
tool = vimdiff tool = vimdiff
colorMoved = default
[difftool] [difftool]
prompt = false prompt = false
@@ -23,9 +24,12 @@
last = log -1 HEAD last = log -1 HEAD
# Thanks to # Thanks to
# http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/ # http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate logs = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
lg = log -p
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
files = ls-files files = ls-files
ls = ls-files
lol = log --graph --pretty=format:'%C(yellow)%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cblue(%cr)%Creset' --abbrev-commit --date=relative
f = "!git ls-files | grep -i" f = "!git ls-files | grep -i"
logtree = log --graph --oneline --decorate --all logtree = log --graph --oneline --decorate --all
@@ -39,7 +43,7 @@
user = matir user = matir
# Site specific config # Site specific config
[url "https://github.com./"] [url "https://github.com/"]
insteadOf = "github:" insteadOf = "github:"
insteadOf = "github://" insteadOf = "github://"
@@ -56,5 +60,29 @@
[credential] [credential]
helper = cache --timeout=36000 helper = cache --timeout=36000
[receive] [receive]
denyCurrentBranch = updateInstead denyCurrentBranch = updateInstead
[merge]
tool = vimdiff
conflictstyle = diff3
[mergetool]
prompt = false
[include]
path = ~/.gitconfig.local
[pull]
rebase = false
[init]
defaultBranch = main
[interactive]
diffFilter = command -v delta >/dev/null 2>&1 && delta || cat
[delta]
navigate = true
line-numbers = true

View File

@@ -17,3 +17,13 @@ Thumbs.db
# Try to avoid accidentally checking in private keys # Try to avoid accidentally checking in private keys
id_rsa id_rsa
id_ecdsa id_ecdsa
id_ed25519
# Kicad backup files
*.kicad_pcb-bak
# Mypy cache path
.mypy_cache
# These files should basically never be committed
.env

View File

@@ -1,2 +1 @@
keyserver hkps://hkps.pool.sks-keyservers.net keyserver hkps://keys.openpgp.org
hkp-cacert ~/.gnupg/sks-keyservers.pem

View File

@@ -1,9 +1,10 @@
use-agent use-agent
# HKPS requires gnupg-curl for gpg1 # HKPS requires gnupg-curl for gpg1
keyserver hkps://hkps.pool.sks-keyservers.net keyserver hkps://keys.openpgp.org
keyserver-options auto-key-retrieve no-honor-keyserver-url keyserver-options auto-key-retrieve no-honor-keyserver-url
auto-key-locate keyserver auto-key-locate keyserver
personal-digest-preferences SHA256 personal-digest-preferences SHA256
cert-digest-algo SHA256 cert-digest-algo SHA256
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
cipher-algo AES256 cipher-algo AES256
default-key 7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B

4
dotfiles/inputrc Normal file
View File

@@ -0,0 +1,4 @@
set editing-mode vi
set keymap vi
set convert-meta on

7
dotfiles/ipython.py Normal file
View File

@@ -0,0 +1,7 @@
try:
import os, IPython
os.environ['PYTHONSTARTUP'] = '' # Prevent running this again
IPython.start_ipython()
raise SystemExit
except ImportError:
pass

View File

@@ -0,0 +1,611 @@
# Configuration file for ipython.
#------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
#------------------------------------------------------------------------------
## A Mixin for applications that start InteractiveShell instances.
#
# Provides configurables for loading extensions and executing files as part of
# configuring a Shell environment.
#
# The following methods should be called by the :meth:`initialize` method of the
# subclass:
#
# - :meth:`init_path`
# - :meth:`init_shell` (to be implemented by the subclass)
# - :meth:`init_gui_pylab`
# - :meth:`init_extensions`
# - :meth:`init_code`
## Execute the given command string.
#c.InteractiveShellApp.code_to_run = ''
## Run the file referenced by the PYTHONSTARTUP environment variable at IPython
# startup.
c.InteractiveShellApp.exec_PYTHONSTARTUP = False
## List of files to run at IPython startup.
#c.InteractiveShellApp.exec_files = []
## lines of code to run at IPython startup.
#c.InteractiveShellApp.exec_lines = []
## A list of dotted module names of IPython extensions to load.
#c.InteractiveShellApp.extensions = []
## dotted module name of an IPython extension to load.
#c.InteractiveShellApp.extra_extension = ''
## A file to be run
#c.InteractiveShellApp.file_to_run = ''
## Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk2', 'gtk3',
# 'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', 'qt4').
#c.InteractiveShellApp.gui = None
## Should variables loaded at startup (by startup files, exec_lines, etc.) be
# hidden from tools like %who?
#c.InteractiveShellApp.hide_initial_ns = True
## Configure matplotlib for interactive use with the default matplotlib backend.
#c.InteractiveShellApp.matplotlib = None
## Run the module as a script.
#c.InteractiveShellApp.module_to_run = ''
## Pre-load matplotlib and numpy for interactive use, selecting a particular
# matplotlib backend and loop integration.
#c.InteractiveShellApp.pylab = None
## If true, IPython will populate the user namespace with numpy, pylab, etc. and
# an ``import *`` is done from numpy and pylab, when using pylab mode.
#
# When False, pylab mode should not import any names into the user namespace.
#c.InteractiveShellApp.pylab_import_all = True
## Reraise exceptions encountered loading IPython extensions?
#c.InteractiveShellApp.reraise_ipython_extension_failures = False
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging formatters for %(asctime)s
#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
#c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
#c.Application.log_level = 30
#------------------------------------------------------------------------------
# BaseIPythonApplication(Application) configuration
#------------------------------------------------------------------------------
## IPython: an enhanced interactive Python shell.
## Whether to create profile dir if it doesn't exist
#c.BaseIPythonApplication.auto_create = False
## Whether to install the default config files into the profile dir. If a new
# profile is being created, and IPython contains config files for that profile,
# then they will be staged into the new directory. Otherwise, default config
# files will be automatically generated.
#c.BaseIPythonApplication.copy_config_files = False
## Path to an extra config file to load.
#
# If specified, load this config file in addition to any other IPython config.
#c.BaseIPythonApplication.extra_config_file = ''
## The name of the IPython directory. This directory is used for logging
# configuration (through profiles), history storage, etc. The default is usually
# $HOME/.ipython. This option can also be specified through the environment
# variable IPYTHONDIR.
#c.BaseIPythonApplication.ipython_dir = ''
## Whether to overwrite existing config files when copying
#c.BaseIPythonApplication.overwrite = False
## The IPython profile to use.
#c.BaseIPythonApplication.profile = 'default'
## Create a massive crash report when IPython encounters what may be an internal
# error. The default is to append a short message to the usual traceback
#c.BaseIPythonApplication.verbose_crash = False
#------------------------------------------------------------------------------
# TerminalIPythonApp(BaseIPythonApplication,InteractiveShellApp) configuration
#------------------------------------------------------------------------------
## Whether to display a banner upon starting IPython.
#c.TerminalIPythonApp.display_banner = True
## If a command or file is given via the command-line, e.g. 'ipython foo.py',
# start an interactive shell after executing the file or command.
#c.TerminalIPythonApp.force_interact = False
## Class to use to instantiate the TerminalInteractiveShell object. Useful for
# custom Frontends
#c.TerminalIPythonApp.interactive_shell_class = 'IPython.terminal.interactiveshell.TerminalInteractiveShell'
## Start IPython quickly by skipping the loading of config files.
#c.TerminalIPythonApp.quick = False
#------------------------------------------------------------------------------
# InteractiveShell(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## An enhanced, interactive shell for Python.
## 'all', 'last', 'last_expr' or 'none', 'last_expr_or_assign' specifying which
# nodes should be run interactively (displaying output from expressions).
#c.InteractiveShell.ast_node_interactivity = 'last_expr'
## A list of ast.NodeTransformer subclass instances, which will be applied to
# user input before code is run.
#c.InteractiveShell.ast_transformers = []
## Automatically run await statement in the top level repl.
#c.InteractiveShell.autoawait = True
## Make IPython automatically call any callable object even if you didn't type
# explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically.
# The value can be '0' to disable the feature, '1' for 'smart' autocall, where
# it is not applied if there are no more arguments on the line, and '2' for
# 'full' autocall, where all callable objects are automatically called (even if
# no arguments are present).
#c.InteractiveShell.autocall = 0
## Autoindent IPython code entered interactively.
#c.InteractiveShell.autoindent = True
## Enable magic commands to be called without the leading %.
#c.InteractiveShell.automagic = True
## The part of the banner to be printed before the profile
#c.InteractiveShell.banner1 = "Python 3.7.3rc1 (default, Mar 13 2019, 11:01:15) \nType 'copyright', 'credits' or 'license' for more information\nIPython 7.5.0 -- An enhanced Interactive Python. Type '?' for help.\n"
## The part of the banner to be printed after the profile
#c.InteractiveShell.banner2 = ''
## Set the size of the output cache. The default is 1000, you can change it
# permanently in your config file. Setting it to 0 completely disables the
# caching system, and the minimum value accepted is 3 (if you provide a value
# less than 3, it is reset to 0 and a warning is issued). This limit is defined
# because otherwise you'll spend more time re-flushing a too small cache than
# working
#c.InteractiveShell.cache_size = 1000
## Use colors for displaying information about objects. Because this information
# is passed through a pager (like 'less'), and some pagers get confused with
# color codes, this capability can be turned off.
#c.InteractiveShell.color_info = True
## Set the color scheme (NoColor, Neutral, Linux, or LightBG).
#c.InteractiveShell.colors = 'Neutral'
##
#c.InteractiveShell.debug = False
## Don't call post-execute functions that have failed in the past.
#c.InteractiveShell.disable_failing_post_execute = False
## If True, anything that would be passed to the pager will be displayed as
# regular output instead.
#c.InteractiveShell.display_page = False
## (Provisional API) enables html representation in mime bundles sent to pagers.
#c.InteractiveShell.enable_html_pager = False
## Total length of command history
#c.InteractiveShell.history_length = 10000
## The number of saved history entries to be loaded into the history buffer at
# startup.
#c.InteractiveShell.history_load_length = 1000
##
#c.InteractiveShell.ipython_dir = ''
## Start logging to the given file in append mode. Use `logfile` to specify a log
# file to **overwrite** logs to.
#c.InteractiveShell.logappend = ''
## The name of the logfile to use.
#c.InteractiveShell.logfile = ''
## Start logging to the default log file in overwrite mode. Use `logappend` to
# specify a log file to **append** logs to.
#c.InteractiveShell.logstart = False
## Select the loop runner that will be used to execute top-level asynchronous
# code
#c.InteractiveShell.loop_runner = 'IPython.core.interactiveshell._asyncio_runner'
##
#c.InteractiveShell.object_info_string_level = 0
## Automatically call the pdb debugger after every exception.
#c.InteractiveShell.pdb = False
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_in1 = 'In [\\#]: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_in2 = ' .\\D.: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_out = 'Out[\\#]: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompts_pad_left = True
##
#c.InteractiveShell.quiet = False
##
#c.InteractiveShell.separate_in = '\n'
##
#c.InteractiveShell.separate_out = ''
##
#c.InteractiveShell.separate_out2 = ''
## Show rewritten input, e.g. for autocall.
#c.InteractiveShell.show_rewritten_input = True
## Enables rich html representation of docstrings. (This requires the docrepr
# module).
#c.InteractiveShell.sphinxify_docstring = False
##
#c.InteractiveShell.wildcards_case_sensitive = True
## Switch modes for the IPython exception handlers.
#c.InteractiveShell.xmode = 'Context'
#------------------------------------------------------------------------------
# TerminalInteractiveShell(InteractiveShell) configuration
#------------------------------------------------------------------------------
## Set to confirm when you try to exit IPython with an EOF (Control-D in Unix,
# Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a
# direct exit without any confirmation.
#c.TerminalInteractiveShell.confirm_exit = True
## Options for displaying tab completions, 'column', 'multicolumn', and
# 'readlinelike'. These options are for `prompt_toolkit`, see `prompt_toolkit`
# documentation for more information.
#c.TerminalInteractiveShell.display_completions = 'multicolumn'
## Shortcut style to use at the prompt. 'vi' or 'emacs'.
c.TerminalInteractiveShell.editing_mode = 'vi'
## Set the editor used by IPython (default to $EDITOR/vi/notepad).
#c.TerminalInteractiveShell.editor = 'vim'
## Allows to enable/disable the prompt toolkit history search
#c.TerminalInteractiveShell.enable_history_search = True
## Enable vi (v) or Emacs (C-X C-E) shortcuts to open an external editor. This is
# in addition to the F2 binding, which is always enabled.
#c.TerminalInteractiveShell.extra_open_editor_shortcuts = False
## Provide an alternative handler to be called when the user presses Return. This
# is an advanced option intended for debugging, which may be changed or removed
# in later releases.
#c.TerminalInteractiveShell.handle_return = None
## Highlight matching brackets.
#c.TerminalInteractiveShell.highlight_matching_brackets = True
## The name or class of a Pygments style to use for syntax highlighting. To see
# available styles, run `pygmentize -L styles`.
#c.TerminalInteractiveShell.highlighting_style = traitlets.Undefined
## Override highlighting format for specific tokens
#c.TerminalInteractiveShell.highlighting_style_overrides = {}
## Enable mouse support in the prompt (Note: prevents selecting text with the
# mouse)
#c.TerminalInteractiveShell.mouse_support = False
## Display the current vi mode (when using vi editing mode).
#c.TerminalInteractiveShell.prompt_includes_vi_mode = True
## Class used to generate Prompt token for prompt_toolkit
#c.TerminalInteractiveShell.prompts_class = 'IPython.terminal.prompts.Prompts'
## Use `raw_input` for the REPL, without completion and prompt colors.
#
# Useful when controlling IPython as a subprocess, and piping STDIN/OUT/ERR.
# Known usage are: IPython own testing machinery, and emacs inferior-shell
# integration through elpy.
#
# This mode default to `True` if the `IPY_TEST_SIMPLE_PROMPT` environment
# variable is set, or the current terminal is not a tty.
#c.TerminalInteractiveShell.simple_prompt = False
## Number of line at the bottom of the screen to reserve for the completion menu
#c.TerminalInteractiveShell.space_for_menu = 6
## Automatically set the terminal title
#c.TerminalInteractiveShell.term_title = True
## Customize the terminal title format. This is a python format string.
# Available substitutions are: {cwd}.
#c.TerminalInteractiveShell.term_title_format = 'IPython: {cwd}'
## Use 24bit colors instead of 256 colors in prompt highlighting. If your
# terminal supports true color, the following command should print 'TRUECOLOR'
# in orange: printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
#c.TerminalInteractiveShell.true_color = False
#------------------------------------------------------------------------------
# HistoryAccessor(HistoryAccessorBase) configuration
#------------------------------------------------------------------------------
## Access the history database without adding to it.
#
# This is intended for use by standalone history tools. IPython shells use
# HistoryManager, below, which is a subclass of this.
## Options for configuring the SQLite connection
#
# These options are passed as keyword args to sqlite3.connect when establishing
# database connections.
#c.HistoryAccessor.connection_options = {}
## enable the SQLite history
#
# set enabled=False to disable the SQLite history, in which case there will be
# no stored history, no SQLite connection, and no background saving thread.
# This may be necessary in some threaded environments where IPython is embedded.
#c.HistoryAccessor.enabled = True
## Path to file to use for SQLite history database.
#
# By default, IPython will put the history database in the IPython profile
# directory. If you would rather share one history among profiles, you can set
# this value in each, so that they are consistent.
#
# Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts.
# If you see IPython hanging, try setting this to something on a local disk,
# e.g::
#
# ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite
#
# you can also use the specific value `:memory:` (including the colon at both
# end but not the back ticks), to avoid creating an history file.
#c.HistoryAccessor.hist_file = ''
#------------------------------------------------------------------------------
# HistoryManager(HistoryAccessor) configuration
#------------------------------------------------------------------------------
## A class to organize all history-related functionality in one place.
## Write to database every x commands (higher values save disk access & power).
# Values of 1 or less effectively disable caching.
#c.HistoryManager.db_cache_size = 0
## Should the history database include output? (default: no)
#c.HistoryManager.db_log_output = False
#------------------------------------------------------------------------------
# ProfileDir(LoggingConfigurable) configuration
#------------------------------------------------------------------------------
## An object to manage the profile directory and its resources.
#
# The profile directory is used by all IPython applications, to manage
# configuration, logging and security.
#
# This object knows how to find, create and manage these directories. This
# should be used by any code that wants to handle profiles.
## Set the profile location directly. This overrides the logic used by the
# `profile` option.
#c.ProfileDir.location = ''
#------------------------------------------------------------------------------
# BaseFormatter(Configurable) configuration
#------------------------------------------------------------------------------
## A base formatter class that is configurable.
#
# This formatter should usually be used as the base class of all formatters. It
# is a traited :class:`Configurable` class and includes an extensible API for
# users to determine how their objects are formatted. The following logic is
# used to find a function to format an given object.
#
# 1. The object is introspected to see if it has a method with the name
# :attr:`print_method`. If is does, that object is passed to that method
# for formatting.
# 2. If no print method is found, three internal dictionaries are consulted
# to find print method: :attr:`singleton_printers`, :attr:`type_printers`
# and :attr:`deferred_printers`.
#
# Users should use these dictionaries to register functions that will be used to
# compute the format data for their objects (if those objects don't have the
# special print methods). The easiest way of using these dictionaries is through
# the :meth:`for_type` and :meth:`for_type_by_name` methods.
#
# If no function/callable is found to compute the format data, ``None`` is
# returned and this format type is not used.
##
#c.BaseFormatter.deferred_printers = {}
##
#c.BaseFormatter.enabled = True
##
#c.BaseFormatter.singleton_printers = {}
##
#c.BaseFormatter.type_printers = {}
#------------------------------------------------------------------------------
# PlainTextFormatter(BaseFormatter) configuration
#------------------------------------------------------------------------------
## The default pretty-printer.
#
# This uses :mod:`IPython.lib.pretty` to compute the format data of the object.
# If the object cannot be pretty printed, :func:`repr` is used. See the
# documentation of :mod:`IPython.lib.pretty` for details on how to write pretty
# printers. Here is a simple example::
#
# def dtype_pprinter(obj, p, cycle):
# if cycle:
# return p.text('dtype(...)')
# if hasattr(obj, 'fields'):
# if obj.fields is None:
# p.text(repr(obj))
# else:
# p.begin_group(7, 'dtype([')
# for i, field in enumerate(obj.descr):
# if i > 0:
# p.text(',')
# p.breakable()
# p.pretty(field)
# p.end_group(7, '])')
##
#c.PlainTextFormatter.float_precision = ''
## Truncate large collections (lists, dicts, tuples, sets) to this size.
#
# Set to 0 to disable truncation.
#c.PlainTextFormatter.max_seq_length = 1000
##
#c.PlainTextFormatter.max_width = 79
##
#c.PlainTextFormatter.newline = '\n'
##
#c.PlainTextFormatter.pprint = True
##
#c.PlainTextFormatter.verbose = False
#------------------------------------------------------------------------------
# Completer(Configurable) configuration
#------------------------------------------------------------------------------
## Enable unicode completions, e.g. \alpha<tab> . Includes completion of latex
# commands, unicode names, and expanding unicode characters back to latex
# commands.
#c.Completer.backslash_combining_completions = True
## Enable debug for the Completer. Mostly print extra information for
# experimental jedi integration.
#c.Completer.debug = False
## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care
# of with Jedi.
#
# This will enable completion on elements of lists, results of function calls,
# etc., but can be unsafe because the code is actually evaluated on TAB.
#c.Completer.greedy = False
## Experimental: restrict time (in milliseconds) during which Jedi can compute
# types. Set to 0 to stop computing types. Non-zero value lower than 100ms may
# hurt performance by preventing jedi to build its cache.
#c.Completer.jedi_compute_type_timeout = 400
## Experimental: Use Jedi to generate autocompletions. Default to True if jedi is
# installed.
#c.Completer.use_jedi = True
#------------------------------------------------------------------------------
# IPCompleter(Completer) configuration
#------------------------------------------------------------------------------
## Extension of the completer class with IPython-specific features
## DEPRECATED as of version 5.0.
#
# Instruct the completer to use __all__ for the completion
#
# Specifically, when completing on ``object.<tab>``.
#
# When True: only those names in obj.__all__ will be included.
#
# When False [default]: the __all__ attribute is ignored
#c.IPCompleter.limit_to__all__ = False
## Whether to merge completion results into a single list
#
# If False, only the completion results from the first non-empty completer will
# be returned.
#c.IPCompleter.merge_completions = True
## Instruct the completer to omit private method names
#
# Specifically, when completing on ``object.<tab>``.
#
# When 2 [default]: all names that start with '_' will be excluded.
#
# When 1: all 'magic' names (``__foo__``) will be excluded.
#
# When 0: nothing will be excluded.
#c.IPCompleter.omit__names = 2
#------------------------------------------------------------------------------
# ScriptMagics(Magics) configuration
#------------------------------------------------------------------------------
## Magics for talking to scripts
#
# This defines a base `%%script` cell magic for running a cell with a program in
# a subprocess, and registers a few top-level magics that call %%script with
# common interpreters.
## Extra script cell magics to define
#
# This generates simple wrappers of `%%script foo` as `%%foo`.
#
# If you want to add script magics that aren't on your path, specify them in
# script_paths
#c.ScriptMagics.script_magics = []
## Dict mapping short 'ruby' names to full paths, such as '/opt/secret/bin/ruby'
#
# Only necessary for items in script_magics where the default path will not find
# the right interpreter.
#c.ScriptMagics.script_paths = {}
#------------------------------------------------------------------------------
# LoggingMagics(Magics) configuration
#------------------------------------------------------------------------------
## Magics related to all logging machinery.
## Suppress output of log state when logging is enabled
#c.LoggingMagics.quiet = False
#------------------------------------------------------------------------------
# StoreMagics(Magics) configuration
#------------------------------------------------------------------------------
## Lightweight persistence for python variables.
#
# Provides the %store magic.
## If True, any %store-d variables will be automatically restored when IPython
# starts.
#c.StoreMagics.autorestore = False

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,37 @@
#!/bin/bash
# Also sourced by zsh, etc.
# Interactive shells only.
# Should only use POSIX constructs.
# Always load ENV # Always load ENV
test -f "$HOME/.env" && . "$HOME/.env" test -f "$HOME/.env" && . "$HOME/.env"
test -f "${HOME}/.profile.local" && . "${HOME}/.profile.local" # Setup GREP_COLORS
export GREP_COLOR='01;31'
export GREP_COLORS='mt=01;31:mc=01;31:ms=01;31'
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. # Setup LS_COLORS
export PATH="$PATH:$HOME/.rvm/bin" if whence dircolors >/dev/null 2>&1 ; then
test -f "${HOME}/.dircolors" && \
eval "$(dircolors "${HOME}/.dircolors")"
else
# Static solarized LS_COLORS
LS_COLORS='no=00:fi=00:di=34:ow=34;40:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.hpp=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.cl=32:*.sh=32:*.bash=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.erb=32:*.haml=32:*.xml=32:*.rdf=32:*.css=32:*.sass=32:*.scss=32:*.less=32:*.js=32:*.coffee=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.go=32:*.sql=32:*.csv=32:*.sv=32:*.svh=32:*.v=32:*.vh=32:*.vhd=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.PNG=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.m4a=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.opus=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.MOV=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.webm=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.odt=31:*.dot=31:*.dotx=31:*.ott=31:*.xls=31:*.xlsx=31:*.ods=31:*.ots=31:*.ppt=31:*.pptx=31:*.odp=31:*.otp=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;32:*~=01;32:*#=01;32:*.bak=01;33:*.BAK=01;33:*.old=01;33:*.OLD=01;33:*.org_archive=01;33:*.off=01;33:*.OFF=01;33:*.dist=01;33:*.DIST=01;33:*.orig=01;33:*.ORIG=01;33:*.swp=01;33:*.swo=01;33:*,v=01;33:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:*.sqlite=34:';
export LS_COLORS
fi
if [ "$(uname)" = "Darwin" ] ; then
LSCOLORS="gxfxbEaEBxxEhEhBaDaCaD"
export LSCOLORS
CLICOLOR=1
export CLICOLOR
fi
# Setup for libvirt
if [ -z "${LIBVIRT_DEFAULT_URI}" ] ; then
if [ "$(id -u)" = "0" ] || (id -g -n | grep -q "\blibvirt\b") ; then
LIBVIRT_DEFAULT_URI="qemu:///system"
export LIBVIRT_DEFAULT_URI
fi
fi
test -f "${HOME}/.profile.local" && . "${HOME}/.profile.local"

View File

@@ -1,12 +1,32 @@
tmp .AndroidStudio*
Downloads .Genymobile
.Ticket to Ride*
.android*
.arduino*
.bundle
.cache .cache
.local/share/Trash .dropbox-dist
.wine .gradle
.thumbnails
.histfile .histfile
.local/share/Steam
.local/share/Trash
.local/lib
.rvm*
.sliver
.sqlite_history
.thumbnails
.wine
.zcompdump .zcompdump
.zcompdump* .zcompdump*
.sqlite_history
VirtualBox VMs
Audits Audits
Downloads
SpiderOak Hive
VirtualBox VMs
tmp
tools
.minikube
.config/unity3d/cache
.xsession-errors*
.config/google-chrome-beta
.config/google-chrome
Unity

1
dotfiles/rvmrc Normal file
View File

@@ -0,0 +1 @@
rvm_silence_path_mismatch_check_flag=1

2
dotfiles/sqliterc Normal file
View File

@@ -0,0 +1,2 @@
.header on
.mode column

View File

@@ -1,9 +1,28 @@
# Universal Settings (can't override) # Universal Settings
# Never fall back to protocol 1: it's broken
Protocol 2 Protocol 2
# Permit Local Overrides
Include ~/.ssh/config.d/*
# SSH known host hashing doesn't buy much with shell history, etc.
HashKnownHosts no
# Enable canonicalization, unless overridden
CanonicalizeHostname yes
CanonicalizeFallbackLocal yes
CanonicalDomains systemoverlord.com
CanonicalizeMaxDots 0
# Defaults (May be Overridden) # Defaults (May be Overridden)
Host * Host *.*
CheckHostIP yes
Host *.cloudshell.dev
# Cloudshell hostnames are too long for unix sockets
ControlMaster no
Match canonical all
CheckHostIP no
ControlMaster auto ControlMaster auto
ControlPath ~/.ssh/master/%r@%h:%p ControlPath ~/.ssh/master/%r@%h:%p
ControlPersist yes ControlPersist yes
@@ -11,9 +30,6 @@ Host *
ForwardX11 no ForwardX11 no
ForwardX11Trusted no ForwardX11Trusted no
ServerAliveInterval 120 ServerAliveInterval 120
CheckHostIP no UpdateHostKeys yes
User david
Host warzone VerifyHostKeyDNS yes
Hostname warzone.shadowcats.club
Port 22
User matir

27
dotfiles/ssh/rc Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
# Roughly based on this article:
# https://werat.github.io/2017/02/04/tmux-ssh-agent-forwarding.html
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}"
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
@@ -18,6 +21,10 @@ set -g pane-base-index 1
set -g set-titles on set -g set-titles on
set -g set-titles-string '#h:#S:#I.#P #W' set -g set-titles-string '#h:#S:#I.#P #W'
# Set keybindings
set -g mode-keys vi
set -g status-keys vi
# Set a 256color $TERM variable so programs inside tmux know they can use 256 # Set a 256color $TERM variable so programs inside tmux know they can use 256
# colors # colors
set -g default-terminal screen-256color set -g default-terminal screen-256color
@@ -33,9 +40,7 @@ setw -g automatic-rename on
source-file ~/.tmux/tmux-solarized-256.conf source-file ~/.tmux/tmux-solarized-256.conf
# Provide a statusbar # Provide a statusbar
set -g window-status-current-bg colour33 set -g window-status-current-style fg=colour235,bg=colour33,bold
set -g window-status-current-fg colour235
set -g window-status-current-attr bold
set -g status-interval 60 set -g status-interval 60
set -g status-left-length 30 set -g status-left-length 30
set -g status-left '/#S/ ' set -g status-left '/#S/ '
@@ -57,3 +62,10 @@ bind M \
set -g mouse-select-pane off \;\ set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\ set -g mouse-select-window off \;\
display 'Mouse: OFF' display 'Mouse: OFF'
# tmux X clipboard integration
bind C-c run "tmux show-buffer | xsel -i -b"
bind C-v run "tmux set-buffer -- \"$(xsel -o -b)\"; tmux paste-buffer"
# Enable logging module, if available
run-shell "~/.tmux/tmux-logging/logging.tmux || true"

View File

@@ -1,27 +1,22 @@
#### COLOUR (Solarized 256) #### COLOUR (Solarized 256)
# default statusbar colors # default statusbar colors
set-option -g status-bg colour235 #base02 set-option -g status-style fg=colour136,bg=colour235 #yellow and base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors # default window title colors
set-window-option -g window-status-fg colour244 #base0 set-window-option -g window-status-style fg=colour244,bg=default #base0 and default
set-window-option -g window-status-bg default #set-window-option -g window-status-style dim
#set-window-option -g window-status-attr dim
# active window title colors # active window title colors
set-window-option -g window-status-current-fg colour166 #orange set-window-option -g window-status-current-style fg=colour166,bg=default #orange and default
set-window-option -g window-status-current-bg default #set-window-option -g window-status-current-style bright
#set-window-option -g window-status-current-attr bright
# pane border # pane border
set-option -g pane-border-fg colour235 #base02 set-option -g pane-border-style fg=colour235 #base02
set-option -g pane-active-border-fg colour240 #base01 set-option -g pane-active-border-style fg=colour240 #base01
# message text # message text
set-option -g message-bg colour235 #base02 set-option -g message-style fg=colour166,bg=colour235 #orange and base02
set-option -g message-fg colour166 #orange
# pane number display # pane number display
set-option -g display-panes-active-colour colour33 #blue set-option -g display-panes-active-colour colour33 #blue
@@ -29,3 +24,6 @@ set-option -g display-panes-colour colour166 #orange
# clock # clock
set-window-option -g clock-mode-colour colour64 #green set-window-option -g clock-mode-colour colour64 #green
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red

View File

View File

@@ -1,29 +1,6 @@
" Allow full use of vim options " Allow full use of vim options
set nocompatible set nocompatible
" Enable Vundle if installed
if filereadable(glob("~/.vim/bundle/Vundle.vim/README.md"))
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'nvie/vim-flake8'
Plugin 'tell-k/vim-autopep8'
Plugin 'tpope/vim-fugitive'
Plugin 'mileszs/ack.vim'
Plugin 'tpope/vim-unimpaired'
Plugin 'scrooloose/syntastic'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'vimoutliner/vimoutliner'
Plugin 'PotatoesMaster/i3-vim-syntax'
Plugin 'Matt-Deacalion/vim-systemd-syntax'
Plugin 'fatih/vim-go'
Plugin 'vhda/verilog_systemverilog.vim'
call vundle#end()
endif
" Setup paths " Setup paths
set backupdir=~/.cache/vim/backup// set backupdir=~/.cache/vim/backup//
set directory=~/.cache/vim/swap// set directory=~/.cache/vim/swap//
@@ -46,12 +23,32 @@ 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
set ruler set ruler
set cursorline
" Setup viminfo for recording positions, etc.
if !has('nvim')
set viminfo='10,\"100,:20,%,n~/.viminfo
endif
" Jump back when editing a file
function! ResCur()
" Don't jump in git commits since they're generated.
if &ft == 'gitcommit'
return
endif
if line("'\"") <= line("$")
normal! g`"
return
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
" File options " File options
set encoding=utf-8 set encoding=utf-8
@@ -64,13 +61,15 @@ else
let g:solarized_termcolors=256 let g:solarized_termcolors=256
let g:solarized_termtrans=1 let g:solarized_termtrans=1
endif endif
silent! colorscheme solarized if $TERM ==? 'rxvt-unicode-256color'
" Enable filetype support " I have .Xresources setup for solarized
filetype plugin indent on let g:solarized_use16=1
endif
silent! colorscheme solarized8
" Default ASM syntax for ft support " Default ASM syntax for ft support
let asmsyntax="nasm" let asmsyntax="nasm"
" Allow file modelines " Too risky to allow file modelines
set modeline set nomodeline
" Automatically re-read changed files " Automatically re-read changed files
set autoread set autoread
" fsync() after writing files " fsync() after writing files
@@ -94,7 +93,6 @@ imap <silent> <F4> <ESC>:set invpaste<CR>:set paste?<CR>
" Mediocre Hex editing in vim " Mediocre Hex editing in vim
" Source: http://vim.wikia.com/wiki/Improved_hex_editing " Source: http://vim.wikia.com/wiki/Improved_hex_editing
" TODO: move to an include " TODO: move to an include
nnoremap <C-H> :Hexmode<CR>
command -bar Hexmode call ToggleHex() command -bar Hexmode call ToggleHex()
function ToggleHex() function ToggleHex()
" hex mode should be considered a read-only operation " hex mode should be considered a read-only operation
@@ -136,11 +134,56 @@ endfunction
" Options for syntastic " Options for syntastic
let g:syntastic_enable_signs = 1 let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list = 2 let g:syntastic_auto_loc_list = 2
let g:syntastic_check_on_wq = 0
let g:syntastic_go_checkers = ['govet', 'errcheck', 'go'] let g:syntastic_go_checkers = ['govet', 'errcheck', 'go']
let g:syntastic_python_checkers=['flake8']
" Because XXE
let g:syntastic_xml_checkers=['']
let g:syntastic_xslt_checkers=['']
autocmd BufReadPost *
\ if &readonly
\| let b:syntastic_mode = 'passive'
\| else
\| silent! unlet b:syntastic_mode
\| endif
" Have F5 run the tests and display errors " Have F5 run the tests and display errors
nnoremap <silent> <F5> :SyntasticCheck<CR> :Errors<CR> nnoremap <silent> <F5> :SyntasticCheck<CR> :Errors<CR>
" Load vim-ycm if installed on the system level
" Currently only works on debian-based systems...
" It also does not play nicely with virtual envs, so we skip it then
if isdirectory("/usr/share/vim-youcompleteme") && empty($VIRTUAL_ENV)
let g:ycm_gopls_binary_path='gopls'
let g:ycm_autoclose_preview_window_after_insertion=1
set runtimepath+=/usr/share/vim-youcompleteme
endif
" Enable vim-bracketed-paste mode
" From
" https://github.com/ConradIrwin/vim-bracketed-paste/blob/master/plugin/bracketed-paste.vim
if exists("g:loaded_bracketed_paste")
finish
endif
let g:loaded_bracketed_paste = 1
let &t_ti .= "\<Esc>[?2004h"
let &t_te = "\e[?2004l" . &t_te
function! XTermPasteBegin(ret)
set pastetoggle=<f29>
set paste
return a:ret
endfunction
execute "set <f28>=\<Esc>[200~"
execute "set <f29>=\<Esc>[201~"
map <expr> <f28> XTermPasteBegin("i")
imap <expr> <f28> XTermPasteBegin("")
vmap <expr> <f28> XTermPasteBegin("c")
cmap <f28> <nop>
cmap <f29> <nop>
" Include a .vimrc.local if it exists " Include a .vimrc.local if it exists
if filereadable(glob("~/.vimrc.local")) if filereadable(glob("~/.vimrc.local"))
source ~/.vimrc.local source ~/.vimrc.local
@@ -162,3 +205,13 @@ command Unsmartquote %s/“\|”/"/g
" Markdown options " Markdown options
autocmd Filetype markdown set expandtab shiftwidth=4 autocmd Filetype markdown set expandtab shiftwidth=4
" Python options
autocmd Filetype python set expandtab shiftwidth=4
" Makefile options
autocmd BufRead,BufNewFile Makefile* set noexpandtab
" Enable filetype support
" Needs to be at end of vimrc
filetype plugin indent on

View File

@@ -6,7 +6,8 @@ content_disposition = on
# Recursive download options # Recursive download options
no_parent = on no_parent = on
follow_ftp = on follow_ftp = on
adjust_extension = on # Good for HTML, not for other things
adjust_extension = off
robots = off robots = off
# Show responses # Show responses

View File

@@ -1,4 +1,4 @@
setxkbmap -option ctrl:nocaps setxkbmap -option ctrl:nocaps -option compose:ralt
test -x /usr/bin/xsettingsd && /usr/bin/xsettingsd & test -x /usr/bin/xsettingsd && /usr/bin/xsettingsd &
test -f "$HOME/.env" && "$HOME/.env" test -f "$HOME/.env" && "$HOME/.env"
test -f "$HOME/.profile" && . "$HOME/.profile" test -f "$HOME/.profile" && . "$HOME/.profile"

8
dotfiles/zlogin Normal file
View File

@@ -0,0 +1,8 @@
# Execute code that does not affect the current session in the background.
{
# Compile the completion dump to increase startup speed.
zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
zcompile "$zcompdump"
fi
} &!

View File

@@ -1,36 +0,0 @@
function prompt_matir_setup {
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
autoload -Uz colors
prompt_opts=(sp subst cr percent)
colors
add-zsh-hook precmd prompt_matir_precmd
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' formats ' (%b%u)'
zstyle ':vcs_info:*' stagedstr '*'
zstyle ':vcs_info:*' unstagedstr '*'
# TODO: add virtualenv/rvm info
PROMPT='%{$fg[black]%}[%{$fg[yellow]%}%h%{$fg[black]%}] %{%(!.$fg[red].$fg[green])%}%8>..>%n%>>%{$fg[white]%}@%{$fg[blue]%}%12>..>%m%>>%{$fg[white]%}:%{$fg[green]%}%32<...<%~%<<%{$fg[blue]%}${vcs_info_msg_0_}%{$fg[white]%}%#%{$reset_color%} '
# Rprompt setup
local show_return="✘ "
# Default is to show the return value
if zstyle -T ':prezto:module:prompt' show-return-val; then
show_return+='%? '
fi
RPROMPT='%(?:: %{$fg[red]%}'
RPROMPT+=${show_return}
RPROMPT+='%{$reset_color)%}'
}
function prompt_matir_precmd {
vcs_info
}
prompt_matir_setup "$@"

View File

@@ -1,230 +0,0 @@
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
# Set case-sensitivity for completion, history lookup, etc.
# zstyle ':prezto:*:*' case-sensitive 'yes'
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Add additional directories to load prezto modules from
zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto_custom
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
# Set the Zsh functions to load (man zshcontrib).
# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'matir' \
'tmux' \
'git' \
'gpg' \
'python' \
'ruby' \
'history-substring-search' \
'jekyll' \
'prompt' \
'xtra_completions'
#
# Autosuggestions
#
# Set the query found color.
# zstyle ':prezto:module:autosuggestions:color' found ''
#
# Completions
#
# Set the entries to ignore in static */etc/hosts* for host completion.
# zstyle ':prezto:module:completion:*:hosts' etc-host-ignores \
# '0.0.0.0' '127.0.0.1'
#
# Editor
#
# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' key-bindings 'vi'
# Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes'
#
# Git
#
# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
# zstyle ':prezto:module:git:status:ignore' submodules 'all'
#
# GNU Utility
#
# Set the command prefix on non-GNU systems.
zstyle ':prezto:module:gnu-utility' prefix 'g'
#
# History Substring Search
#
# Set the query found color.
# zstyle ':prezto:module:history-substring-search:color' found ''
# Set the query not found color.
# zstyle ':prezto:module:history-substring-search:color' not-found ''
# Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
#
# OS X
#
# Set the keyword used by `mand` to open man pages in Dash.app
# zstyle ':prezto:module:osx:man' dash-keyword 'manpages'
#
# Pacman
#
# Set the Pacman frontend.
# zstyle ':prezto:module:pacman' frontend 'yaourt'
#
# Prompt
#
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'matir'
# Set the working directory prompt display length.
# By default, it is set to 'short'. Set it to 'long' (without '~' expansion)
# for longer or 'full' (with '~' expansion) for even longer prompt display.
# zstyle ':prezto:module:prompt' pwd-length 'short'
# Set the prompt to display the return code along with an indicator for non-zero
# return codes. This is not supported by all prompts.
# zstyle ':prezto:module:prompt' show-return-val 'yes'
#
# Ruby
#
# Auto switch the Ruby version on directory change.
# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes'
#
# Python
#
# Auto switch the Python virtualenv on directory change.
# zstyle ':prezto:module:python:virtualenv' auto-switch 'yes'
# Automatically initialize virtualenvwrapper if pre-requisites are met.
# zstyle ':prezto:module:python:virtualenv' initialize 'yes'
#
# Screen
#
# Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:screen:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:screen:auto-start' remote 'yes'
#
# SSH
#
# Set the SSH identities to load into the agent.
# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github'
#
# Syntax Highlighting
#
# Set syntax highlighters.
# By default, only the main highlighter is enabled.
# zstyle ':prezto:module:syntax-highlighting' highlighters \
# 'main' \
# 'brackets' \
# 'pattern' \
# 'line' \
# 'cursor' \
# 'root'
#
# Set syntax highlighting styles.
# zstyle ':prezto:module:syntax-highlighting' styles \
# 'builtin' 'bg=blue' \
# 'command' 'bg=blue' \
# 'function' 'bg=blue'
#
# Set syntax pattern styles.
# zstyle ':prezto:module:syntax-highlighting' pattern \
# 'rm*-rf*' 'fg=white,bold,bg=red'
#
# Terminal
#
# Auto set the tab and window titles.
# zstyle ':prezto:module:terminal' auto-title 'yes'
# Set the window title format.
# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
# Set the tab title format.
# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
# Set the terminal multiplexer title format.
# zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
#
# Tmux
#
# Auto start a session when Zsh is launched in a local terminal.
zstyle ':prezto:module:tmux:auto-start' local 'no'
# Auto start a session when Zsh is launched in a SSH connection.
zstyle ':prezto:module:tmux:auto-start' remote 'yes'
# Integrate with iTerm2.
# zstyle ':prezto:module:tmux:iterm' integrate 'yes'
# Set the default session name:
# zstyle ':prezto:module:tmux:session' name 'YOUR DEFAULT SESSION NAME'
#
# Utility
#
# Enabled safe options. This aliases cp, ln, mv and rm so that they prompt
# before deleting or overwriting files. Set to 'no' to disable this safer
# behavior.
zstyle ':prezto:module:utility' safe-ops 'no'

View File

@@ -1,16 +1,57 @@
# For interactive shells # For interactive shells
HISTFILE=~/.histfile HISTFILE=~/.zhistory
HISTSIZE=1000 HISTSIZE=10000
SAVEHIST=1000 SAVEHIST=10000
setopt appendhistory autocd autopushd extendedglob nohup nomatch histignorespace histlexwords histverify cbases setopt \
unsetopt beep histbeep listbeep flowcontrol ALWAYS_TO_END \
bindkey -e APPEND_HISTORY \
AUTO_CD \
AUTO_LIST \
AUTO_MENU \
AUTO_PARAM_SLASH \
AUTO_PUSHD \
BANG_HIST \
C_BASES \
COMPLETE_IN_WORD \
EXTENDED_GLOB \
EXTENDED_HISTORY \
HIST_EXPIRE_DUPS_FIRST \
HIST_FIND_NO_DUPS \
HIST_IGNORE_DUPS \
HIST_IGNORE_SPACE \
HIST_LEX_WORDS \
HIST_SAVE_NO_DUPS \
HIST_VERIFY \
INTERACTIVE_COMMENTS \
LONG_LIST_JOBS \
MULTIOS \
NO_CLOBBER \
NO_HUP \
NOMATCH \
NOTIFY \
PUSHD_IGNORE_DUPS \
PUSHD_SILENT \
PUSHD_TO_HOME \
RC_QUOTES \
SHARE_HISTORY
unsetopt \
BEEP \
CDABLE_VARS \
HIST_BEEP \
LIST_BEEP \
FLOW_CONTROL \
MAIL_WARNING \
HUP \
BG_NICE \
CHECK_JOBS
# vi keybindings
bindkey -v
# Completion # Allow core files
zstyle :compinstall filename '/home/david/.zshrc' ulimit -c unlimited
autoload -Uz compinit && compinit
DIRSTACKSIZE=16 DIRSTACKSIZE=16
# Set terminal title
case $TERM in case $TERM in
xterm*) xterm*)
precmd () {print -Pn "\e]0;%n@%m: %~\a"} precmd () {print -Pn "\e]0;%n@%m: %~\a"}
@@ -20,59 +61,98 @@ esac
autoload -U colors && colors autoload -U colors && colors
PS1="%{$fg[black]%}[%{$fg[yellow]%}%h%{$fg[black]%}] %{%(!.$fg[red].$fg[green])%}%8>..>%n%>>%{$fg[white]%}@%{$fg[blue]%}%12>..>%m%>>%{$fg[white]%}:%{$fg[green]%}%32<...<%~%<<%{$fg[white]%}%#%{$reset_color%} " PS1="%{$fg[black]%}[%{$fg[yellow]%}%h%{$fg[black]%}] %{%(!.$fg[red].$fg[green])%}%8>..>%n%>>%{$fg[white]%}@%{$fg[blue]%}%12>..>%m%>>%{$fg[white]%}:%{$fg[green]%}%32<...<%~%<<%{$fg[white]%}%#%{$reset_color%} "
if [ `uname` != 'Darwin' ] ; then zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# ls Colors zstyle ':completion::complete:*' use-cache on
alias ls='ls --color' zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
else
alias ls='ls -G'
fi
# Load prezto
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# .profile is universal # .profile is universal
# but after oh-my-zsh to use anything setup there
. ~/.profile . ~/.profile
# Deduplicate the path # Deduplicate the path
typeset -U path typeset -U path
# Additional Keybindings
# Keybindings
bindkey '^[[A' history-search-backward bindkey '^[[A' history-search-backward
bindkey '^[[B' history-search-forward bindkey '^[[B' history-search-forward
# ctrl-arrow keys
bindkey '^[[1;5C' forward-word bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word bindkey '^[[1;5D' backward-word
bindkey '^P' up-history
bindkey '^N' down-history
bindkey '^?' backward-delete-char
bindkey '^h' backward-delete-char
# ok, a few emacs convenience bindings
bindkey '^w' backward-kill-word
bindkey '^r' history-incremental-search-backward
# delete really deletes
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
for file in $HOME/.zshrc.d/* ; do source "$file" ; done if [[ -e $HOME/.aliases.local ]] ; then source $HOME/.aliases.local ; fi
fi # zsh-only-ism to avoid error if glob doesn't expand
for file in $HOME/.zshrc.d/[a-zA-Z0-9]*.zsh(N) ; do
source "$file"
done
# extra completions, prompt
fpath=(~/.zshrc.completions ~/.zshrc.d/matir_prompt ~/.zshrc.d/agnoster_prompt $fpath)
# Completion
zstyle ':compinstall' filename "${HOME}/.zshrc"
zstyle ':completion:*' users root ${USER}
# Modules after fpath
autoload -Uz compinit && compinit -i
autoload -Uz promptinit && promptinit
# Virtualenvwrapper
if test -f /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh ; then
source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
fi
if command ls --version >/dev/null 2>&1 ; then
alias ls="$(whence -p ls) --color=auto -C"
fi
# Syntax highlighting and substring search
if test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ; then
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
elif test -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ; then
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
if test -f ${HOME}/.zshrc.d/_zsh-history-substring-search.zsh ; then
source ${HOME}/.zshrc.d/_zsh-history-substring-search.zsh
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
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
# In case ack is named ack-grep # In case ack is named ack-grep
if [ -x /usr/bin/ack-grep ] ; then if [ -x /usr/bin/ack-grep ] ; then
alias ack='/usr/bin/ack-grep' alias ack='/usr/bin/ack-grep'
fi fi
# Most is nice, if we have it # Got rust?
if command -v most >/dev/null 2>&1; then if test -d ${HOME}/.cargo/bin ; then
export PAGER="most" PATH=${PATH}:${HOME}/.cargo/bin
fi
# Pip packages
if test -d ${HOME}/.local/bin ; then
PATH=${PATH}:${HOME}/.local/bin
fi
if test -z "${PAGER}" && command -v less >/dev/null 2>&1; then
export PAGER="less"
fi fi
# Load any local settings # Load any local settings
if [ -e $HOME/.zshrc.local ] ; then source $HOME/.zshrc.local ; fi if [ -e $HOME/.zshrc.local ] ; then source $HOME/.zshrc.local ; fi
function start_esp { # Set prompt based on local settings
if [ ! -d ${HOME}/tools/esp ] ; then prompt "${THEME:-matir}"
echo "ESP not installed!" >/dev/stderr
return 1
fi
export PATH="${PATH}:${HOME}/tools/esp/xtensa-esp32-elf/bin"
export IDF_PATH="${HOME}/tools/esp/esp-idf"
}
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,759 @@
#!/usr/bin/env zsh
##############################################################################
#
# Copyright (c) 2009 Peter Stephenson
# Copyright (c) 2011 Guido van Steen
# Copyright (c) 2011 Suraj N. Kurapati
# Copyright (c) 2011 Sorin Ionescu
# Copyright (c) 2011 Vincent Guerci
# Copyright (c) 2016 Geza Lore
# Copyright (c) 2017 Bengt Brodersen
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# * Neither the name of the FIZSH nor the names of its contributors
# may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
##############################################################################
#-----------------------------------------------------------------------------
# declare global configuration variables
#-----------------------------------------------------------------------------
typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold'
typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold'
typeset -g HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i'
typeset -g HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=''
typeset -g HISTORY_SUBSTRING_SEARCH_FUZZY=''
#-----------------------------------------------------------------------------
# declare internal global variables
#-----------------------------------------------------------------------------
typeset -g BUFFER MATCH MBEGIN MEND CURSOR
typeset -g _history_substring_search_refresh_display
typeset -g _history_substring_search_query_highlight
typeset -g _history_substring_search_result
typeset -g _history_substring_search_query
typeset -g -a _history_substring_search_query_parts
typeset -g -a _history_substring_search_raw_matches
typeset -g -i _history_substring_search_raw_match_index
typeset -g -a _history_substring_search_matches
typeset -g -i _history_substring_search_match_index
typeset -g -A _history_substring_search_unique_filter
#-----------------------------------------------------------------------------
# the main ZLE widgets
#-----------------------------------------------------------------------------
history-substring-search-up() {
_history-substring-search-begin
_history-substring-search-up-history ||
_history-substring-search-up-buffer ||
_history-substring-search-up-search
_history-substring-search-end
}
history-substring-search-down() {
_history-substring-search-begin
_history-substring-search-down-history ||
_history-substring-search-down-buffer ||
_history-substring-search-down-search
_history-substring-search-end
}
zle -N history-substring-search-up
zle -N history-substring-search-down
#-----------------------------------------------------------------------------
# implementation details
#-----------------------------------------------------------------------------
zmodload -F zsh/parameter
#
# We have to "override" some keys and widgets if the
# zsh-syntax-highlighting plugin has not been loaded:
#
# https://github.com/nicoulaj/zsh-syntax-highlighting
#
if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
#
# Dummy implementation of _zsh_highlight() that
# simply removes any existing highlights when the
# user inserts printable characters into $BUFFER.
#
_zsh_highlight() {
if [[ $KEYS == [[:print:]] ]]; then
region_highlight=()
fi
}
#
# The following snippet was taken from the zsh-syntax-highlighting project:
#
# https://github.com/zsh-users/zsh-syntax-highlighting/blob/56b134f5d62ae3d4e66c7f52bd0cc2595f9b305b/zsh-syntax-highlighting.zsh#L126-161
#
# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the zsh-syntax-highlighting contributors nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#--------------8<-------------------8<-------------------8<-----------------
# Rebind all ZLE widgets to make them invoke _zsh_highlights.
_zsh_highlight_bind_widgets()
{
# Load ZSH module zsh/zleparameter, needed to override user defined widgets.
zmodload zsh/zleparameter 2>/dev/null || {
echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter.' >&2
return 1
}
# Override ZLE widgets to make them invoke _zsh_highlight.
local cur_widget
for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|run-help|which-command|beep|yank*)}; do
case $widgets[$cur_widget] in
# Already rebound event: do nothing.
user:$cur_widget|user:_zsh_highlight_widget_*);;
# User defined widget: override and rebind old one with prefix "orig-".
user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \
_zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Completion widget: override and rebind old one with prefix "orig-".
completion:*) eval "zle -C orig-$cur_widget ${${widgets[$cur_widget]#*:}/:/ }; \
_zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Builtin widget: override and make it call the builtin ".widget".
builtin) eval "_zsh_highlight_widget_$cur_widget() { builtin zle .$cur_widget -- \"\$@\" && _zsh_highlight }; \
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Default: unhandled case.
*) echo "zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget'" >&2 ;;
esac
done
}
#-------------->8------------------->8------------------->8-----------------
_zsh_highlight_bind_widgets
fi
_history-substring-search-begin() {
setopt localoptions extendedglob
_history_substring_search_refresh_display=
_history_substring_search_query_highlight=
#
# If the buffer is the same as the previously displayed history substring
# search result, then just keep stepping through the match list. Otherwise
# start a new search.
#
if [[ -n $BUFFER && $BUFFER == ${_history_substring_search_result:-} ]]; then
return;
fi
#
# Clear the previous result.
#
_history_substring_search_result=''
if [[ -z $BUFFER ]]; then
#
# If the buffer is empty, we will just act like up-history/down-history
# in ZSH, so we do not need to actually search the history. This should
# speed things up a little.
#
_history_substring_search_query=
_history_substring_search_query_parts=()
_history_substring_search_raw_matches=()
else
#
# For the purpose of highlighting we keep a copy of the original
# query string.
#
_history_substring_search_query=$BUFFER
#
# compose search pattern
#
if [[ -n $HISTORY_SUBSTRING_SEARCH_FUZZY ]]; then
#
# `=` split string in arguments
#
_history_substring_search_query_parts=(${=_history_substring_search_query})
else
_history_substring_search_query_parts=(${==_history_substring_search_query})
fi
#
# Escape and join query parts with wildcard character '*' as seperator
# `(j:CHAR:)` join array to string with CHAR as seperator
#
local search_pattern="*${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*"
#
# Find all occurrences of the search pattern in the history file.
#
# (k) returns the "keys" (history index numbers) instead of the values
# (R) returns values in reverse older, so the index of the youngest
# matching history entry is at the head of the list.
#
_history_substring_search_raw_matches=(${(k)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${search_pattern}]})
fi
#
# In order to stay as responsive as possible, we will process the raw
# matches lazily (when the user requests the next match) to choose items
# that need to be displayed to the user.
# _history_substring_search_raw_match_index holds the index of the last
# unprocessed entry in _history_substring_search_raw_matches. Any items
# that need to be displayed will be added to
# _history_substring_search_matches.
#
# We use an associative array (_history_substring_search_unique_filter) as
# a 'set' data structure to ensure uniqueness of the results if desired.
# If an entry (key) is in the set (non-empty value), then we have already
# added that entry to _history_substring_search_matches.
#
_history_substring_search_raw_match_index=0
_history_substring_search_matches=()
_history_substring_search_unique_filter=()
#
# If $_history_substring_search_match_index is equal to
# $#_history_substring_search_matches + 1, this indicates that we
# are beyond the end of $_history_substring_search_matches and that we
# have also processed all entries in
# _history_substring_search_raw_matches.
#
# If $#_history_substring_search_match_index is equal to 0, this indicates
# that we are beyond the beginning of $_history_substring_search_matches.
#
# If we have initially pressed "up" we have to initialize
# $_history_substring_search_match_index to 0 so that it will be
# incremented to 1.
#
# If we have initially pressed "down" we have to initialize
# $_history_substring_search_match_index to 1 so that it will be
# decremented to 0.
#
if [[ $WIDGET == history-substring-search-down ]]; then
_history_substring_search_match_index=1
else
_history_substring_search_match_index=0
fi
}
_history-substring-search-end() {
setopt localoptions extendedglob
_history_substring_search_result=$BUFFER
# the search was successful so display the result properly by clearing away
# existing highlights and moving the cursor to the end of the result buffer
if [[ $_history_substring_search_refresh_display -eq 1 ]]; then
region_highlight=()
CURSOR=${#BUFFER}
fi
# highlight command line using zsh-syntax-highlighting
_zsh_highlight
# highlight the search query inside the command line
if [[ -n $_history_substring_search_query_highlight ]]; then
# highlight first matching query parts
local highlight_start_index=0
local highlight_end_index=0
local query_part
for query_part in $_history_substring_search_query_parts; do
local escaped_query_part=${query_part//(#m)[\][()|\\*?#<>~^]/\\$MATCH}
# (i) get index of pattern
local query_part_match_index="${${BUFFER:$highlight_start_index}[(i)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${escaped_query_part}]}"
if [[ $query_part_match_index -le ${#BUFFER:$highlight_start_index} ]]; then
highlight_start_index=$(( $highlight_start_index + $query_part_match_index ))
highlight_end_index=$(( $highlight_start_index + ${#query_part} ))
region_highlight+=("$(($highlight_start_index - 1)) $(($highlight_end_index - 1)) $_history_substring_search_query_highlight")
fi
done
fi
# For debugging purposes:
# zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches}
# read -k -t 200 && zle -U $REPLY
# Exit successfully from the history-substring-search-* widgets.
return 0
}
_history-substring-search-up-buffer() {
#
# Check if the UP arrow was pressed to move the cursor within a multi-line
# buffer. This amounts to three tests:
#
# 1. $#buflines -gt 1.
#
# 2. $CURSOR -ne $#BUFFER.
#
# 3. Check if we are on the first line of the current multi-line buffer.
# If so, pressing UP would amount to leaving the multi-line buffer.
#
# We check this by adding an extra "x" to $LBUFFER, which makes
# sure that xlbuflines is always equal to the number of lines
# until $CURSOR (including the line with the cursor on it).
#
local buflines XLBUFFER xlbuflines
buflines=(${(f)BUFFER})
XLBUFFER=$LBUFFER"x"
xlbuflines=(${(f)XLBUFFER})
if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xlbuflines -ne 1 ]]; then
zle up-line-or-history
return 0
fi
return 1
}
_history-substring-search-down-buffer() {
#
# Check if the DOWN arrow was pressed to move the cursor within a multi-line
# buffer. This amounts to three tests:
#
# 1. $#buflines -gt 1.
#
# 2. $CURSOR -ne $#BUFFER.
#
# 3. Check if we are on the last line of the current multi-line buffer.
# If so, pressing DOWN would amount to leaving the multi-line buffer.
#
# We check this by adding an extra "x" to $RBUFFER, which makes
# sure that xrbuflines is always equal to the number of lines
# from $CURSOR (including the line with the cursor on it).
#
local buflines XRBUFFER xrbuflines
buflines=(${(f)BUFFER})
XRBUFFER="x"$RBUFFER
xrbuflines=(${(f)XRBUFFER})
if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xrbuflines -ne 1 ]]; then
zle down-line-or-history
return 0
fi
return 1
}
_history-substring-search-up-history() {
#
# Behave like up in ZSH, except clear the $BUFFER
# when beginning of history is reached like in Fish.
#
if [[ -z $_history_substring_search_query ]]; then
# we have reached the absolute top of history
if [[ $HISTNO -eq 1 ]]; then
BUFFER=
# going up from somewhere below the top of history
else
zle up-line-or-history
fi
return 0
fi
return 1
}
_history-substring-search-down-history() {
#
# Behave like down-history in ZSH, except clear the
# $BUFFER when end of history is reached like in Fish.
#
if [[ -z $_history_substring_search_query ]]; then
# going down from the absolute top of history
if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then
BUFFER=${history[1]}
_history_substring_search_refresh_display=1
# going down from somewhere above the bottom of history
else
zle down-line-or-history
fi
return 0
fi
return 1
}
_history_substring_search_process_raw_matches() {
#
# Process more outstanding raw matches and append any matches that need to
# be displayed to the user to _history_substring_search_matches.
# Return whether there were any more results appended.
#
#
# While we have more raw matches. Process them to see if there are any more
# matches that need to be displayed to the user.
#
while [[ $_history_substring_search_raw_match_index -lt $#_history_substring_search_raw_matches ]]; do
#
# Move on to the next raw entry and get its history index.
#
_history_substring_search_raw_match_index+=1
local index=${_history_substring_search_raw_matches[$_history_substring_search_raw_match_index]}
#
# If HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set to a non-empty value,
# then ensure that only unique matches are presented to the user.
# When HIST_IGNORE_ALL_DUPS is set, ZSH already ensures a unique history,
# so in this case we do not need to do anything.
#
if [[ ! -o HIST_IGNORE_ALL_DUPS && -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then
#
# Get the actual history entry at the new index, and check if we have
# already added it to _history_substring_search_matches.
#
local entry=${history[$index]}
if [[ -z ${_history_substring_search_unique_filter[$entry]} ]]; then
#
# This is a new unique entry. Add it to the filter and append the
# index to _history_substring_search_matches.
#
_history_substring_search_unique_filter[$entry]=1
_history_substring_search_matches+=($index)
#
# Indicate that we did find a match.
#
return 0
fi
else
#
# Just append the new history index to the processed matches.
#
_history_substring_search_matches+=($index)
#
# Indicate that we did find a match.
#
return 0
fi
done
#
# We are beyond the end of the list of raw matches. Indicate that no
# more matches are available.
#
return 1
}
_history-substring-search-has-next() {
#
# Predicate function that returns whether any more older matches are
# available.
#
if [[ $_history_substring_search_match_index -lt $#_history_substring_search_matches ]]; then
#
# We did not reach the end of the processed list, so we do have further
# matches.
#
return 0
else
#
# We are at the end of the processed list. Try to process further
# unprocessed matches. _history_substring_search_process_raw_matches
# returns whether any more matches were available, so just return
# that result.
#
_history_substring_search_process_raw_matches
return $?
fi
}
_history-substring-search-has-prev() {
#
# Predicate function that returns whether any more younger matches are
# available.
#
if [[ $_history_substring_search_match_index -gt 1 ]]; then
#
# We did not reach the beginning of the processed list, so we do have
# further matches.
#
return 0
else
#
# We are at the beginning of the processed list. We do not have any more
# matches.
#
return 1
fi
}
_history-substring-search-found() {
#
# A match is available. The index of the match is held in
# $_history_substring_search_match_index
#
# 1. Make $BUFFER equal to the matching history entry.
#
# 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND
# to highlight the current buffer.
#
BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]]
_history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND
}
_history-substring-search-not-found() {
#
# No more matches are available.
#
# 1. Make $BUFFER equal to $_history_substring_search_query so the user can
# revise it and search again.
#
# 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
# to highlight the current buffer.
#
BUFFER=$_history_substring_search_query
_history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
}
_history-substring-search-up-search() {
_history_substring_search_refresh_display=1
#
# Select history entry during history-substring-down-search:
#
# The following variables have been initialized in
# _history-substring-search-up/down-search():
#
# $_history_substring_search_matches is the current list of matches that
# need to be displayed to the user.
# $_history_substring_search_match_index is the index of the current match
# that is being displayed to the user.
#
# The range of values that $_history_substring_search_match_index can take
# is: [0, $#_history_substring_search_matches + 1]. A value of 0
# indicates that we are beyond the beginning of
# $_history_substring_search_matches. A value of
# $#_history_substring_search_matches + 1 indicates that we are beyond
# the end of $_history_substring_search_matches and that we have also
# processed all entries in _history_substring_search_raw_matches.
#
# If $_history_substring_search_match_index equals
# $#_history_substring_search_matches and
# $_history_substring_search_raw_match_index is not greater than
# $#_history_substring_search_raw_matches, then we need to further process
# $_history_substring_search_raw_matches to see if there are any more
# entries that need to be displayed to the user.
#
# In _history-substring-search-up-search() the initial value of
# $_history_substring_search_match_index is 0. This value is set in
# _history-substring-search-begin(). _history-substring-search-up-search()
# will initially increment it to 1.
#
if [[ $_history_substring_search_match_index -gt $#_history_substring_search_matches ]]; then
#
# We are beyond the end of $_history_substring_search_matches. This
# can only happen if we have also exhausted the unprocessed matches in
# _history_substring_search_raw_matches.
#
# 1. Update display to indicate search not found.
#
_history-substring-search-not-found
return
fi
if _history-substring-search-has-next; then
#
# We do have older matches.
#
# 1. Move index to point to the next match.
# 2. Update display to indicate search found.
#
_history_substring_search_match_index+=1
_history-substring-search-found
else
#
# We do not have older matches.
#
# 1. Move the index beyond the end of
# _history_substring_search_matches.
# 2. Update display to indicate search not found.
#
_history_substring_search_match_index+=1
_history-substring-search-not-found
fi
#
# When HIST_FIND_NO_DUPS is set, meaning that only unique command lines from
# history should be matched, make sure the new and old results are different.
#
# However, if the HIST_IGNORE_ALL_DUPS shell option, or
# HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set, then we already have a
# unique history, so in this case we do not need to do anything.
#
if [[ -o HIST_IGNORE_ALL_DUPS || -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then
return
fi
if [[ -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then
#
# Repeat the current search so that a different (unique) match is found.
#
_history-substring-search-up-search
fi
}
_history-substring-search-down-search() {
_history_substring_search_refresh_display=1
#
# Select history entry during history-substring-down-search:
#
# The following variables have been initialized in
# _history-substring-search-up/down-search():
#
# $_history_substring_search_matches is the current list of matches that
# need to be displayed to the user.
# $_history_substring_search_match_index is the index of the current match
# that is being displayed to the user.
#
# The range of values that $_history_substring_search_match_index can take
# is: [0, $#_history_substring_search_matches + 1]. A value of 0
# indicates that we are beyond the beginning of
# $_history_substring_search_matches. A value of
# $#_history_substring_search_matches + 1 indicates that we are beyond
# the end of $_history_substring_search_matches and that we have also
# processed all entries in _history_substring_search_raw_matches.
#
# In _history-substring-search-down-search() the initial value of
# $_history_substring_search_match_index is 1. This value is set in
# _history-substring-search-begin(). _history-substring-search-down-search()
# will initially decrement it to 0.
#
if [[ $_history_substring_search_match_index -lt 1 ]]; then
#
# We are beyond the beginning of $_history_substring_search_matches.
#
# 1. Update display to indicate search not found.
#
_history-substring-search-not-found
return
fi
if _history-substring-search-has-prev; then
#
# We do have younger matches.
#
# 1. Move index to point to the previous match.
# 2. Update display to indicate search found.
#
_history_substring_search_match_index+=-1
_history-substring-search-found
else
#
# We do not have younger matches.
#
# 1. Move the index beyond the beginning of
# _history_substring_search_matches.
# 2. Update display to indicate search not found.
#
_history_substring_search_match_index+=-1
_history-substring-search-not-found
fi
#
# When HIST_FIND_NO_DUPS is set, meaning that only unique command lines from
# history should be matched, make sure the new and old results are different.
#
# However, if the HIST_IGNORE_ALL_DUPS shell option, or
# HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set, then we already have a
# unique history, so in this case we do not need to do anything.
#
if [[ -o HIST_IGNORE_ALL_DUPS || -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then
return
fi
if [[ -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then
#
# Repeat the current search so that a different (unique) match is found.
#
_history-substring-search-down-search
fi
}
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,173 @@
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
# In addition, I recommend the
# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app -
# it has significantly better color fidelity.
#
# # Goals
#
# The aim of this theme is to only show you *relevant* information. Like most
# prompts, it will only show git information when in a git working directory.
# However, it goes a step further: everything from the current user and
# hostname to whether the last call exited with an error to whether background
# jobs are running in this shell will all be displayed automatically when
# appropriate.
### Segments of the prompt, default order declaration
typeset -aHg AGNOSTER_PROMPT_SEGMENTS=(
prompt_status
prompt_context
prompt_virtualenv
prompt_dir
prompt_git
prompt_end
)
### Segment drawing
# A few utility functions to make it easy and re-usable to draw segmented prompts
CURRENT_BG='NONE'
if [[ -z "$PRIMARY_FG" ]]; then
PRIMARY_FG=black
fi
# Characters
SEGMENT_SEPARATOR="\ue0b0"
PLUSMINUS="\u00b1"
BRANCH="\ue0a0"
DETACHED="\u27a6"
CROSS="\u2718"
LIGHTNING="\u26a1"
GEAR="\u2699"
# Begin a segment
# Takes two arguments, background and foreground. Both can be omitted,
# rendering default background/foreground.
prompt_segment() {
local bg fg
[[ -n $1 ]] && bg="%K{$1}" || bg="%k"
[[ -n $2 ]] && fg="%F{$2}" || fg="%f"
if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then
print -n "%{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%}"
else
print -n "%{$bg%}%{$fg%}"
fi
CURRENT_BG=$1
[[ -n $3 ]] && print -n $3
}
# End the prompt, closing any open segments
prompt_end() {
if [[ -n $CURRENT_BG ]]; then
print -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR"
else
print -n "%{%k%}"
fi
print -n "%{%f%}"
CURRENT_BG=''
}
### Prompt components
# Each component will draw itself, and hide itself if no information needs to be shown
# Context: user@hostname (who am I and where am I)
prompt_context() {
local user=`whoami`
if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CONNECTION" ]]; then
prompt_segment $PRIMARY_FG default " %(!.%{%F{yellow}%}.)$user@%m "
fi
}
# Git: branch/detached head, dirty status
prompt_git() {
local color ref
is_dirty() {
test -n "$(git status --porcelain --ignore-submodules)"
}
ref="$vcs_info_msg_0_"
if [[ -n "$ref" ]]; then
if is_dirty; then
color=yellow
ref="${ref} $PLUSMINUS"
else
color=green
ref="${ref} "
fi
if [[ "${ref/.../}" == "$ref" ]]; then
ref="$BRANCH $ref"
else
ref="$DETACHED ${ref/.../}"
fi
prompt_segment $color $PRIMARY_FG
print -n " $ref"
fi
}
# Dir: current working directory
prompt_dir() {
prompt_segment blue $PRIMARY_FG ' %~ '
}
# Status:
# - was there an error
# - am I root
# - are there background jobs?
prompt_status() {
local symbols
symbols=()
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$CROSS"
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}$LIGHTNING"
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}$GEAR"
[[ -n "$symbols" ]] && prompt_segment $PRIMARY_FG default " $symbols "
}
# Display current virtual environment
prompt_virtualenv() {
if [[ -n $VIRTUAL_ENV ]]; then
color=cyan
prompt_segment $color $PRIMARY_FG
print -Pn " $(basename $VIRTUAL_ENV) "
fi
}
## Main prompt
prompt_agnoster_main() {
RETVAL=$?
CURRENT_BG='NONE'
for prompt_segment in "${AGNOSTER_PROMPT_SEGMENTS[@]}"; do
[[ -n $prompt_segment ]] && $prompt_segment
done
}
prompt_agnoster_precmd() {
vcs_info
PROMPT='%{%f%b%k%}$(prompt_agnoster_main) '
}
prompt_agnoster_setup() {
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
prompt_opts=(cr subst percent)
add-zsh-hook precmd prompt_agnoster_precmd
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes false
zstyle ':vcs_info:git*' formats '%b'
zstyle ':vcs_info:git*' actionformats '%b (%a)'
}
prompt_agnoster_setup "$@"

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env zsh
# On some systems, bat is batcat
if ! command -v bat >/dev/null 2>&1 ; then
if command -v batcat >/dev/null 2>&1 ; then
alias bat=$(command -v batcat)
fi
fi

4
dotfiles/zshrc.d/cnf.zsh Normal file
View File

@@ -0,0 +1,4 @@
# TODO: this is horribly unportable. Fix it.
if test -r /etc/zsh_command_not_found && test -r /var/lib/command-not-found/commands.db ; then
source /etc/zsh_command_not_found
fi

View File

@@ -0,0 +1,7 @@
if command -v xiwi >/dev/null 2>&1; then
function xiwibg {
local tmpf=$(mktemp)
echo Logging to ${tmpf}
nohup xiwi "$@" >!${tmpf} 2>&1 &
}
fi

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

@@ -0,0 +1,9 @@
function dumpenv {
tr '\0' '\n' < /proc/${1}/environ
}
if test -x "${HOME}/tools/starship/starship" ; then
function starship_prompt {
eval $($HOME/tools/starship/starship init zsh)
}
fi

View File

@@ -2,16 +2,23 @@
GCL=${HOME}/tools/gcloud GCL=${HOME}/tools/gcloud
if [ ! -d ${GCL} ] ; then if [ -d "${GCL}" ] ; then
return # Add bin to path
export PATH="${PATH}:${GCL}/bin"
# Load completion
source "${GCL}/completion.zsh.inc"
elif [ -f /usr/share/google-cloud-sdk/completion.zsh.inc ] ; then
source /usr/share/google-cloud-sdk/completion.zsh.inc
fi fi
# Add bin to path
export PATH="${PATH}:${GCL}/bin"
# Load completion
source ${GCL}/completion.zsh.inc
which kubectl 2>/dev/null >&2 && \ which kubectl 2>/dev/null >&2 && \
source <(kubectl completion zsh) || \ function kubectl() {
if ! type __start_kubectl >/dev/null 2>&1; then
source <(command kubectl completion zsh)
fi
command kubectl "$@"
} || \
true true

54
dotfiles/zshrc.d/gpg.zsh Normal file
View File

@@ -0,0 +1,54 @@
if ! which gpg-agent >/dev/null 2>&1 ; then
return 1
fi
if test -f ${HOME}/.no-gpg-agent ; then
return 0
fi
# Set the default paths to gpg-agent files.
_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf"
_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID"
# Load environment variables from previous run
source "$_gpg_agent_env" 2> /dev/null
# Start gpg-agent if not started.
if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then
# Start gpg-agent if not started.
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then
eval "$(gpg-agent --daemon 2>/dev/null | tee "$_gpg_agent_env")"
fi
fi
# Inform gpg-agent of the current TTY for user prompts.
export GPG_TTY="$(tty)"
# Setup SSH agent support
if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then
# Load required functions.
autoload -Uz add-zsh-hook
if test -z "$SSH_AUTH_SOCK" ; then
SSH_AUTH_SOCK="/run/user/$(id -u)/gnupg/S.gpg-agent.ssh"
if test -S "$SSH_AUTH_SOCK" ; then
export SSH_AUTH_SOCK
else
unset SSH_AUTH_SOCK
fi
fi
# Updates the GPG-Agent TTY before every command since SSH does not set it.
function _gpg-agent-update-tty {
gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null
}
add-zsh-hook preexec _gpg-agent-update-tty
fi
# Clean up.
unset _gpg_agent_{conf,env}
# Disable GUI prompts inside SSH.
if [[ -n "$SSH_CONNECTION" ]]; then
export PINENTRY_USER_DATA='USE_CURSES=1'
fi

View File

@@ -0,0 +1,34 @@
histmode() {
# This is very brittle as it assumes we're the only user of fc
case "$1" in
on)
if [ "$HISTDISABLED" -ne 1 ] ; then
echo "History is not disabled." >&2
return 1
fi
fc -P
HISTDISABLED=0
echo "History enabled."
;;
off)
if [ "$HISTDISABLED" -eq 1 ] ; then
echo "History is already disabled." >&2
return 1
fi
HISTDISABLED=1
fc -p /dev/null $HISTSIZE 0
echo "History disabled."
;;
*)
echo "Unknown command." >&2
;;
esac
}
histsearch() {
fc -l -m "${1}" 1
}
histbrowse() {
fc -l 1
}

View File

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

View File

@@ -60,6 +60,7 @@ function jekyll {
local DATE local DATE
local NEWNAME local NEWNAME
local JEKYLL_DIR local JEKYLL_DIR
local EDITOR=${EDITOR:-vim}
JEKYLL_DIR=`_jekyll_locate_dir` JEKYLL_DIR=`_jekyll_locate_dir`
@@ -73,7 +74,13 @@ function jekyll {
JTEMPLATE+="category: Blog\n" JTEMPLATE+="category: Blog\n"
JTEMPLATE+="---\n\n" JTEMPLATE+="---\n\n"
TITLE=${@[2,-1]} TITLE=${@[2,-1]}
SLUG=$(echo -n ${TITLE}|tr A-Z a-z|tr -c -s -- a-z0-9 -) SLUG=$(echo -n ${TITLE} |
tr A-Z a-z | # Everything in lower case
tr -d "'" | # Remove single quotes entirely
tr -c -s -- a-z0-9 - | # Replace non-alphanums with dashes
sed 's/^-*\([^-].*[^-]\)-*$/\1/' # Remove leading and trailing slashes
)
TITLE=$(echo ${TITLE} | sed 's/\\/\\\\/g;s/"/\\"/g')
DATE=`date +%Y-%m-%d` DATE=`date +%Y-%m-%d`
case "${1:-help}" in case "${1:-help}" in
@@ -84,6 +91,7 @@ function jekyll {
echo " post Create a new post to publish immediately." echo " post Create a new post to publish immediately."
echo " publish Publish a draft post by name." echo " publish Publish a draft post by name."
echo " edit Edit a post." echo " edit Edit a post."
echo " dev Run local server with drafts and incremental."
;; ;;
draft) draft)
if [ -z "${SLUG}" ] ; then if [ -z "${SLUG}" ] ; then
@@ -93,7 +101,7 @@ function jekyll {
mkdir -p "${JEKYLL_DIR}/_drafts" mkdir -p "${JEKYLL_DIR}/_drafts"
FILENAME="${JEKYLL_DIR}/_drafts/${SLUG}.md" FILENAME="${JEKYLL_DIR}/_drafts/${SLUG}.md"
printf -- "${JTEMPLATE}" "${TITLE}" > "${FILENAME}" printf -- "${JTEMPLATE}" "${TITLE}" > "${FILENAME}"
vim "${FILENAME}" '+$' '+startinsert' ${EDITOR} "${FILENAME}" '+$' '+startinsert'
;; ;;
post) post)
if [ -z "${SLUG}" ] ; then if [ -z "${SLUG}" ] ; then
@@ -103,7 +111,7 @@ function jekyll {
FILENAME="${JEKYLL_DIR}/_posts/${DATE}-${SLUG}.md" FILENAME="${JEKYLL_DIR}/_posts/${DATE}-${SLUG}.md"
printf -- "${JTEMPLATE}" "${TITLE}" > "${FILENAME}" printf -- "${JTEMPLATE}" "${TITLE}" > "${FILENAME}"
_jekyll_set_date "${FILENAME}" "${DATE}" _jekyll_set_date "${FILENAME}" "${DATE}"
vim "${FILENAME}" '+$' '+startinsert' ${EDITOR} "${FILENAME}" '+$' '+startinsert'
;; ;;
publish) publish)
if [ -z "${SLUG}" ] ; then if [ -z "${SLUG}" ] ; then
@@ -131,10 +139,13 @@ function jekyll {
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
return return
fi fi
vim "${FILENAME}" ${EDITOR} "${FILENAME}"
;;
dev)
command bundle exec jekyll serve -D -I "$@"
;; ;;
*) *)
command jekyll "$@" command bundle exec jekyll "$@"
;; ;;
esac esac
} }

View File

@@ -0,0 +1,8 @@
test -f /usr/share/source-highlight/src-hilite-lesspipe.sh && \
function srcless {
if [ $# -ne 1 ] ; then
echo "$0 <what>" > /dev/stderr
return 1
fi
/usr/share/source-highlight/src-hilite-lesspipe.sh $1 | less -R
}

View File

@@ -0,0 +1,39 @@
LOGGER_ENV=""
LOGGER_DIR="${LOGGER_DIR:-${HOME}/.zlogs}"
function _logger_now {
print -P "%D{%Y%m%d-%H%M%S}"
}
function logenv {
LOGGER_ENV="${1:-}"
if test -z "${LOGGER_ENV}" ; then
return 0
fi
mkdir -p "${LOGGER_DIR}/${LOGGER_ENV}"
}
# Executed on prompt
function _logger_precmd {
_RV="$?"
if test -z "${LOGGER_ENV}" ; then
return 0
fi
_LOGGER_STOP="$(_logger_now)"
_LOGGER_DATE="$(print -P '%D{%Y%m%d}')"
echo "$_LOGGER_START $_LOGGER_STOP $$ $_RV $_LOGGER_CMD" >>| \
"${LOGGER_DIR}/${LOGGER_ENV}/${_LOGGER_DATE}.log"
return 0
}
# Executed on command entry
function _logger_preexec {
_LOGGER_CMD="${2}"
_LOGGER_START="$(_logger_now)"
return 0
}
typeset -a precmd_functions
precmd_functions+=_logger_precmd
typeset -a preexec_functions
preexec_functions+=_logger_preexec

View File

@@ -0,0 +1,70 @@
# vim: syntax=zsh
function prompt_matir_setup {
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
autoload -Uz colors
prompt_opts=(sp subst cr percent)
colors
add-zsh-hook precmd prompt_matir_precmd
# Git related styles
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' formats ' (%b%u%c)'
zstyle ':vcs_info:*' stagedstr '*'
zstyle ':vcs_info:*' unstagedstr '*'
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
PROMPT='%{$fg[black]%}[%{$fg[yellow]%}%h%{$fg[black]%}] ' # History #
PROMPT+='%{%(!.$fg[red].$fg[green])%}%8>..>%n%>>%{$fg[white]%}@' # username@
PROMPT+='%{$fg[blue]%}%12>..>%m%>>%{$fg[white]%}:' # hostname
PROMPT+='%{$fg[green]%}%32<...<%~%<<' # path
PROMPT+='%{$fg[magenta]%}${VIRTUAL_ENV_SHORT}' # virtualenv
PROMPT+='%{$fg[blue]%}${vcs_info_msg_0_}' # VCS info
PROMPT+='%{$fg[white]%}%#%{$reset_color%} ' # prompt symbol
# Rprompt setup
local show_return='✘ '
RPROMPT='%(?:: %{$fg[red]%}'
RPROMPT+=${show_return}
RPROMPT+='%? '
RPROMPT+='%{$reset_color%})'
RPROMPT+='${PROMPT_VIMODE}'
# Disable virtualenv's own python info
VIRTUAL_ENV_DISABLE_PROMPT="yes"
}
function zle-keymap-select {
# Add prompt info
PROMPT_VIMODE="${${KEYMAP/vicmd/ [VICMD]}/(main|viins)/}"
zle reset-prompt
}
zle -N zle-keymap-select
zle -N zle-line-init zle-keymap-select
function prompt_matir_precmd {
vcs_info 2>/dev/null
if [ $VIRTUAL_ENV ] ; then
VIRTUAL_ENV_SHORT=" (py:$(basename $VIRTUAL_ENV))"
else
VIRTUAL_ENV_SHORT=""
fi
}
### git: Show marker (*) if there are untracked files in repository
# Make sure you have added staged to your 'formats': %c
+vi-git-untracked(){
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
git status --porcelain | grep '??' &> /dev/null ; then
hook_com[staged]+='*'
fi
}
prompt_matir_setup "$@"

View File

@@ -12,7 +12,7 @@ prune-broken-symlinks() {
ASK=1 ASK=1
fi fi
DIR=${1:-.} DIR=${1:-.}
FINDCMD=(find ${DIR} -type l -xtype l) FINDCMD=(find -L ${DIR} -xdev -type l)
if (($ASK)) ; then if (($ASK)) ; then
local FILES local FILES
FILES=`${FINDCMD} -print` FILES=`${FINDCMD} -print`

View File

@@ -1,14 +0,0 @@
# Enable RVM if available
if [[ -s ${HOME}/.rvm/scripts/rvm ]] ; then
source ${HOME}/.rvm/scripts/rvm
else
function install_rvm {
export rvm_ignore_dotfiles=yes
pushd `mktemp -d`
curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer
curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc
gpg --verify rvm-installer.asc && \
bash rvm-installer stable
popd
}
fi

View File

@@ -0,0 +1,43 @@
#!/bin/zsh
#
# Skelify -- move a file to my .skel and setup symlinks
function skelify {
local target
local whichdir
local relhome
local fname
local fulltarget
for target in $~@; do
if test -d ${target} ; then
skelify ${target}/* || return 1
elif test -f ${target} ; then
if ! whichdir=$(cd $(dirname $target) && pwd); then
echo Could not find directory for $target >/dev/stderr
return 1
fi
fname=$(basename ${target})
relhome=${whichdir#${HOME}/}
fulltarget="${whichdir}/${fname}"
if [[ ${relhome} == ${whichdir} ]] ; then
echo ${whichdir} is not in home >/dev/stderr
return 1
fi
if [[ ${relhome:0:1} == "." ]] ; then
relhome=${relhome:1}
elif [[ ${fname:0:1} == "." ]] ; then
fname=${fname:1}
else
echo skelify only supports dotfiles >/dev/stderr
return 1
fi
echo ${target}
mkdir -p ${HOME}/.skel/${relhome}
mv ${target} ${HOME}/.skel/${relhome}/${fname}
ln -s ${fulltarget} ${HOME}/.skel/${relhome}/${fname}
else
echo ${target} is not a directory or file. >/dev/stderr
return 1
fi
done
}

View File

@@ -1,6 +0,0 @@
function source_gnupg {
GPG_ENV=${HOME}/.gnupg/gpg-agent.env
if test -f ${GPG_ENV} ; then
eval $(sed 's/^/export /' ${GPG_ENV})
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,3 @@
function duh {
du -sk "$@" | sort -n | while read size fname; do for unit in K M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done
}

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

@@ -1,7 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2155,SC2223
set -o nounset set -o nounset
set -o errexit set -o errexit
set -o shwordsplit 2>/dev/null || true # Make zsh behave like bash
case $(uname) in case $(uname) in
Linux) Linux)
@@ -17,7 +20,7 @@ case $(uname) in
esac esac
is_comment() { is_comment() {
if [ $(echo "${1}" | cut -c1-1) = '#' ] ; then if [ "$(echo "${1}" | cut -c1-1)" = '#' ] ; then
true true
else else
false false
@@ -25,46 +28,63 @@ is_comment() {
} }
prerequisites() { prerequisites() {
if which zsh > /dev/null 2>&1 ; then if command -v zsh > /dev/null 2>&1 ; then
case $- in case $- in
*i*) *i*)
case `getent passwd $USER | cut -d: -f7` in case "$(getent passwd "${USER}" | cut -d: -f7)" in
*/zsh) */zsh)
;; ;;
*) *)
if [ `id` -ne 0 ] ; then if [ "$(id)" -ne 0 ] ; then
echo 'Enter password to change shell.' >&2 echo 'Enter password to change shell.' >&2
fi fi
chsh -s `which zsh` chsh -s "$(command -v zsh)"
;; ;;
esac esac
;; ;;
esac esac
install_git --recursive https://github.com/sorin-ionescu/prezto.git $HOME/.zprezto
else else
echo "ZSH not found!" >&2 echo "ZSH not found!" >&2
fi fi
if which vim > /dev/null 2>&1 ; then
mkdir -p $HOME/.vim/bundle
install_git https://github.com/VundleVim/Vundle.vim.git \
$HOME/.vim/bundle/Vundle.vim
fi
} }
install_dotfile_dir() { install_dotfile_dir() {
local SRCDIR="${1}" local SRCDIR="${1}"
local dotfile local dotfile
local submodule_prune="$(git -C "${BASEDIR}" submodule status -- "${SRCDIR}" 2>/dev/null | \
awk '{print $2}' | \
while read -r submod ; do
echo -n " -o -path ${BASEDIR}/${submod}"
done)"
# shellcheck disable=SC2086
find "${SRCDIR}" \( -name .git -o \ find "${SRCDIR}" \( -name .git -o \
-path "${SRCDIR}/private_dotfiles" -o \ -path "${SRCDIR}/private_dotfiles" -o \
-name install.sh -o \ -name install.sh -o \
-name README.md -o \ -name README.md -o \
-name .gitignore \) \ -name .gitignore \
${submodule_prune} \) \
-prune -o ${FINDTYPE} f -print | \ -prune -o ${FINDTYPE} f -print | \
while read dotfile ; do while read -r dotfile ; do
local TARGET="${HOME}/.${dotfile#${SRCDIR}/}" local TARGET="${HOME}/.${dotfile#${SRCDIR}/}"
mkdir -p `dirname "${TARGET}"` mkdir -p "$(dirname "${TARGET}")"
ln -s -f "${dotfile}" "${TARGET}" ln -s -f "${dotfile}" "${TARGET}"
done done
git -C "${BASEDIR}" submodule status -- "${SRCDIR}" 2>/dev/null | \
awk '{print $2}' | \
while read -r submodule ; do
local FULLNAME="${BASEDIR}/${submodule}"
local TARGET="${HOME}/.${FULLNAME#${SRCDIR}/}"
mkdir -p "$(dirname "${TARGET}")"
if test -L "${TARGET}" ; then
if [ "$(readlink "${TARGET}")" != "${FULLNAME}" ] ; then
echo "${TARGET} points to $(readlink "${TARGET}") not ${FULLNAME}!" >/dev/stderr
fi
elif test -d "${TARGET}" ; then
echo "rm -rf ${TARGET}" >/dev/stderr
else
ln -s -f "${FULLNAME}" "${TARGET}"
fi
done
} }
install_basic_dir() { install_basic_dir() {
@@ -72,89 +92,66 @@ install_basic_dir() {
local DESTDIR="${2}" local DESTDIR="${2}"
local file local file
find "${SRCDIR}" ${FINDTYPE} f -print | \ find "${SRCDIR}" ${FINDTYPE} f -print | \
while read file ; do while read -r file ; do
local TARGET="${2}/${file#${SRCDIR}/}" local TARGET="${2}/${file#${SRCDIR}/}"
mkdir -p `dirname "${TARGET}"` mkdir -p "$(dirname "${TARGET}")"
ln -s -f "${file}" "${TARGET}" ln -s -f "${file}" "${TARGET}"
done done
} }
install_git() { install_git() {
# Install or update a git repository # Install or update a git repository
if ! which git > /dev/null ; then if ! command -v git > /dev/null 2>&1 ; then
return 1 return 1
fi fi
local REPO="${*: -2:1}" local REPO="${*: -2:1}"
local DESTDIR="${*: -1:1}" local DESTDIR="${*: -1:1}"
set -- ${@:1:$(($#-2))} set -- "${@:1:$(($#-2))}"
if [ -d ${DESTDIR}/.git ] ; then if [ -d "${DESTDIR}/.git" ] ; then
( cd ${DESTDIR} ; git pull -q ) ( cd "${DESTDIR}" ; git pull -q )
else else
if [ ${MINIMAL} -eq 1 ] ; then if [ "${MINIMAL}" -eq 1 ] ; then
git clone --depth 1 $* ${REPO} ${DESTDIR} git clone --depth 1 "$@" "${REPO}" "${DESTDIR}"
else else
git clone $* ${REPO} ${DESTDIR} git clone "$@" "${REPO}" "${DESTDIR}"
fi fi
fi fi
} }
add_bin_symlink() { add_bin_symlink() {
local LINKNAME=${HOME}/bin/${2:-`basename $1`} local LINKNAME="${HOME}/bin/${2:-$(basename "$1")}"
if [ -e ${LINKNAME} -a ! -h ${LINKNAME} ] ; then if [ -e "${LINKNAME}" ] && ! [ -h "${LINKNAME}" ] ; then
echo "Refusing to overwrite ${LINKNAME}" >&2 echo "Refusing to overwrite ${LINKNAME}" >&2
return 1 return 1
fi fi
ln -sf ${1} ${LINKNAME} ln -sf "${1}" "${LINKNAME}"
}
# Custom version of pwndbg's installer
install_pwndbg() {
if ! which gdb > /dev/null 2>&1 ; then
return 1
fi
install_git -b stable https://github.com/pwndbg/pwndbg.git $HOME/.pwndbg
mkdir -p $HOME/.pwndbg/vendor
local PYVER=$(gdb -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))')
local PYTHON=$(gdb -batch -q --nx -ex 'pi import sys; print(sys.executable)')
PYTHON="${PYTHON}${PYVER}"
local PY_PACKAGES=$HOME/.pwndbg/vendor
${PYTHON} -m pip install --target ${PY_PACKAGES} -Ur $HOME/.pwndbg/requirements.txt
${PYTHON} -m pip install --target ${PY_PACKAGES} -U capstone unicorn
# capstone package is broken
cp ${PY_PACKAGES}/usr/lib/*/dist-packages/capstone/libcapstone.so ${PY_PACKAGES}/capstone
} }
postinstall() { postinstall() {
# Install Vundle plugins true
if [ -d $HOME/.vim/bundle/Vundle.vim ] ; then
vim +VundleInstall +qall
fi
# Install other useful tools
install_git https://github.com/trustedsec/ptf.git ${HOME}/bin/ptframework && \
add_bin_symlink ${HOME}/bin/ptframework/ptf
} }
ssh_key_already_installed() { ssh_key_already_installed() {
# Return 1 if the key isn't already installed, 0 if it is # Return 1 if the key isn't already installed, 0 if it is
local AK="${HOME}/.ssh/authorized_keys" local AK="${HOME}/.ssh/authorized_keys"
if [ ! -f $AK ] ; then if [ ! -f "$AK" ] ; then
return 1 return 1
fi fi
local KEYFP=`ssh-keygen -l -f $1 2>/dev/null | awk '{print $2}'` local KEYFP="$(ssh-keygen -l -f "$1" 2>/dev/null | awk '{print $2}')"
local TMPF=`mktemp` local TMPF="$(mktemp)"
local key local key
while read key ; do while read -r key ; do
if is_comment "${key}" ; then if is_comment "${key}" ; then
continue continue
fi fi
echo "$key" > $TMPF echo "$key" > "$TMPF"
local EFP=`ssh-keygen -l -f ${TMPF} 2>/dev/null | awk '{print $2}'` local EFP="$(ssh-keygen -l -f "${TMPF}" 2>/dev/null | awk '{print $2}')"
if [ "$EFP" = "$KEYFP" ] ; then if [ "$EFP" = "$KEYFP" ] ; then
rm $TMPF 2>/dev/null rm "$TMPF" 2>/dev/null
return 0 return 0
fi fi
done < ${AK} done < "${AK}"
rm $TMPF 2>/dev/null rm "$TMPF" 2>/dev/null
return 1 return 1
} }
@@ -164,30 +161,30 @@ install_ssh_keys() {
local AK="${HOME}/.ssh/authorized_keys" local AK="${HOME}/.ssh/authorized_keys"
local key local key
local keydir local keydir
if test ${TRUST_ALL_KEYS} = 1 ; then if test "${TRUST_ALL_KEYS}" = 1 ; then
keydir=${BASEDIR}/keys/ssh keydir="${BASEDIR}/keys/ssh"
else else
keydir=${BASEDIR}/keys/ssh/trusted keydir="${BASEDIR}/keys/ssh/trusted"
fi fi
for key in ${keydir}/* ; do for key in "${keydir}"/* ; do
if [ ! -f "${key}" ] ; then if [ ! -f "${key}" ] ; then
continue continue
fi fi
if ssh_key_already_installed "${key}" ; then if ssh_key_already_installed "${key}" ; then
verbose "Key `basename ${key}` already installed..." verbose "Key $(basename "${key}") already installed..."
continue continue
fi fi
echo "# `basename ${key}` added from skel on `date +%Y-%m-%d`" >> ${AK} echo "# $(basename "${key}") added from skel on $(date +%Y-%m-%d)" >> "${AK}"
cat ${key} >> ${AK} cat "${key}" >> "${AK}"
done done
} }
install_gpg_keys() { install_gpg_keys() {
which gpg >/dev/null 2>&1 || \ command -v gpg >/dev/null 2>&1 || \
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
} }
@@ -196,13 +193,14 @@ install_known_hosts() {
if [ ! -f "${BASEDIR}/keys/known_hosts" ] ; then if [ ! -f "${BASEDIR}/keys/known_hosts" ] ; then
return 0 return 0
fi fi
mkdir -p ${HOME}/.ssh mkdir -p "${HOME}/.ssh"
if [ -f "${HOME}/.ssh/known_hosts" ] ; then if [ -f "${HOME}/.ssh/known_hosts" ] ; then
local tmpf=`mktemp` local tmpf="$(mktemp)"
cat ${BASEDIR}/keys/known_hosts ${HOME}/.ssh/known_hosts | sort | uniq > $tmpf cat "${BASEDIR}"/keys/known_hosts "${HOME}"/.ssh/known_hosts \
mv $tmpf ${HOME}/.ssh/known_hosts | sort -u > "$tmpf"
mv "$tmpf" "${HOME}"/.ssh/known_hosts
else else
cp ${BASEDIR}/keys/known_hosts ${HOME}/.ssh/known_hosts cp "${BASEDIR}"/keys/known_hosts "${HOME}"/.ssh/known_hosts
fi fi
} }
@@ -218,10 +216,10 @@ is_deb_system() {
run_as_root() { run_as_root() {
# Attempt to run as root # Attempt to run as root
if [ ${USER} = "root" ] ; then if [ "${USER}" = "root" ] ; then
"$@" "$@"
return $? return $?
elif groups | grep -q '\bsudo\b' ; then elif test -x "$(command -v sudo 2>/dev/null)" ; then
verbose "Using sudo to run ${1}..." verbose "Using sudo to run ${1}..."
sudo "$@" sudo "$@"
return $? return $?
@@ -232,22 +230,26 @@ run_as_root() {
install_pkg_set() { install_pkg_set() {
local pkg_file=${BASEDIR}/${1} local pkg_file=${BASEDIR}/${1}
local pkg_list="" local pkg_list=""
if [ ! -f "${pkg_file}" ] ; then return 0 ; fi if [ ! -f "${pkg_file}" ] ; then
while read line ; do echo "Package set $(basename "${pkg_file}") does not exist." 1>&2
return 1
fi
while read -r line ; do
if is_comment "${line}" ; then if is_comment "${line}" ; then
continue continue
fi fi
if [ -z "${line}" ] ; then if [ -z "${line}" ] ; then
continue continue
fi fi
if apt-cache show ${line} >/dev/null 2>&1 ; then if [ "$(apt-cache -q show "${line}" 2>/dev/null)" != "" ] ; then
pkg_list="${pkg_list} ${line}" pkg_list="${pkg_list} ${line}"
else else
echo "Warning: package ${line} not found." >&2 echo "Warning: package ${line} not found." >&2
fi fi
done < ${pkg_file} done < "${pkg_file}"
if [ -n "${pkg_list}" ] ; then if [ -n "${pkg_list}" ] ; then
verbose "Installing ${pkg_list}" verbose "Installing ${pkg_list}"
# shellcheck disable=SC2086
run_as_root apt-get install -qqy ${pkg_list} run_as_root apt-get install -qqy ${pkg_list}
fi fi
} }
@@ -257,51 +259,76 @@ install_apt_pkgs() {
( echo "Can't run apt-get commands" >&2 && \ ( echo "Can't run apt-get commands" >&2 && \
return 1 ) return 1 )
install_pkg_set packages.minimal install_pkg_set packages.minimal
if test $MINIMAL = 1 ; then if test "$MINIMAL" = 1 ; then
return 0 return 0
fi fi
test $HAVE_X = 1 && install_pkg_set packages.X test "$HAVE_X" = 1 && install_pkg_set packages.X
test $IS_KALI = 1 && install_pkg_set packages.kali test "$IS_KALI" = 1 && install_pkg_set packages.kali
install_pkg_set packages.${ARCH} install_pkg_set "packages.${ARCH}"
test $HAVE_X = 1 && install_chrome test "$HAVE_X" = 1 && install_chrome
} }
install_chrome() { install_chrome() {
local TMPD=`mktemp -d` local TMPD="$(mktemp -d)"
local CHROME_ARCH=`echo ${ARCH} | sed 's/x86_64/amd64/'` local CHROME_ARCH="${ARCH/x86_64/amd64}"
dpkg-query -l 'google-chrome*' >/dev/null 2>&1 && return 0 dpkg-query -l 'google-chrome*' >/dev/null 2>&1 && return 0
/usr/bin/wget --quiet -O ${TMPD}/google-chrome.deb \ /usr/bin/wget --quiet -O "${TMPD}/google-chrome.deb" \
https://dl.google.com/linux/direct/google-chrome-beta_current_${CHROME_ARCH}.deb "https://dl.google.com/linux/direct/google-chrome-beta_current_${CHROME_ARCH}.deb"
run_as_root /usr/bin/dpkg -i ${TMPD}/google-chrome.deb || \ run_as_root /usr/bin/dpkg -i "${TMPD}/google-chrome.deb" || \
run_as_root /usr/bin/apt-get install -qq -f -y || \ run_as_root /usr/bin/apt-get install -qq -f -y || \
( echo "Could not install chrome." >&2 && return 1 ) ( echo "Could not install chrome." >&2 && return 1 )
rm -rf ${TMPD} rm -rf "${TMPD}"
}
setup_git_email() {
local gc_local="${HOME}/.gitconfig.local"
if test -f "${gc_local}" ; then
return 0
fi
if [ "${USER:0:5}" != "david" ] ; then
return 0
fi
local domain="$(hostname -f | grep -E -o '[a-z0-9-]+\.[a-z0-9-]+$')"
case "$(echo "${domain}" | md5sum | awk '{print $1}')" in
b21a24d528346ef7d3932306ed96ede5|a5ed434a3f5089b489576cceab824f25)
;;
*)
return 0
;;
esac
echo -e "[user]\n email=${USER}@${domain}" > "${gc_local}"
} }
read_saved_prefs() { read_saved_prefs() {
# Can't use basedir here as we don't have it yet # Can't use basedir here as we don't have it yet
local pref_file=`dirname $0`/installed-prefs local old_pref_file="$(dirname "$0")/installed-prefs"
if [ -f ${pref_file} ] ; then local pref_file="$(dirname "$0")/.installed-prefs"
if [ -f "${old_pref_file}" ] && ! [ -f "${pref_file}" ] ; then
mv "${old_pref_file}" "${pref_file}"
fi
if [ -f "${pref_file}" ] ; then
verbose "Loading saved skel preferences from ${pref_file}" verbose "Loading saved skel preferences from ${pref_file}"
# source is a bashism # source is a bashism
. ${pref_file} # shellcheck disable=SC1090
. "${pref_file}"
fi fi
} }
save_prefs() { save_prefs() {
test $SAVE = 1 || return 0 test "$SAVE" = 1 || return 0
local pref_file=${BASEDIR}/installed-prefs local pref_file=${BASEDIR}/.installed-prefs
(echo_pref BASEDIR (echo_pref BASEDIR
echo_pref MINIMAL echo_pref MINIMAL
echo_pref INSTALL_KEYS echo_pref INSTALL_KEYS
echo_pref TRUST_ALL_KEYS echo_pref TRUST_ALL_KEYS
echo_pref INSTALL_PKGS echo_pref INSTALL_PKGS
echo_pref VERBOSE) > $pref_file echo_pref VERBOSE) > "$pref_file"
} }
echo_pref() { echo_pref() {
eval "local val=\${$1}" eval "local val=\${$1}"
echo "$1=\${$1:-${val}}" # shellcheck disable=SC2154
echo ": \${$1:=${val}}"
} }
cleanup() { cleanup() {
@@ -317,53 +344,67 @@ EOF
} }
verbose() { verbose() {
test ${VERBOSE:-0} = 1 && echo "$@" >&2 || return 0 test "${VERBOSE:-0}" = 1 && echo "$@" >&2 || return 0
} }
# Operations # Operations
install_dotfiles() { install_dotfiles() {
install_dotfile_dir "${BASEDIR}/dotfiles" install_dotfile_dir "${BASEDIR}/dotfiles"
# shellcheck disable=SC2015
test -d "${BASEDIR}/private_dotfiles" && \ test -d "${BASEDIR}/private_dotfiles" && \
test -d "${BASEDIR}/.git/git-crypt" && \ test -d "${BASEDIR}/.git/git-crypt" && \
install_dotfile_dir "${BASEDIR}/private_dotfiles" || \ install_dotfile_dir "${BASEDIR}/private_dotfiles" || \
true true
# shellcheck disable=SC2015
test -d "${BASEDIR}/local_dotfiles" && \ test -d "${BASEDIR}/local_dotfiles" && \
install_dotfile_dir "${BASEDIR}/local_dotfiles" || \ install_dotfile_dir "${BASEDIR}/local_dotfiles" || \
true true
} }
install_main() { install_main() {
test $MINIMAL = 1 || prerequisites test -d "${BASEDIR}/.git" && command -v git >/dev/null 2>&1 && \
test $INSTALL_PKGS = 1 && is_deb_system && install_apt_pkgs git -C "${BASEDIR}" pull --ff-only
test "$MINIMAL" = 1 || ( command -v git >/dev/null 2>&1 && \
git -C "${BASEDIR}" submodule update --init --recursive )
test "$MINIMAL" = 1 || prerequisites
test "$INSTALL_PKGS" = 1 && is_deb_system && install_apt_pkgs
install_dotfiles install_dotfiles
install_basic_dir "${BASEDIR}/bin" "${HOME}/bin" install_basic_dir "${BASEDIR}/bin" "${HOME}/bin"
test $MINIMAL = 1 || postinstall test "$MINIMAL" = 1 || postinstall
test $INSTALL_KEYS = 1 && install_keys test "$INSTALL_KEYS" = 1 && install_keys
save_prefs save_prefs
setup_git_email
cleanup cleanup
} }
install_dconf() {
command -v dconf >/dev/null 2>&1 || return 1
find "${BASEDIR}/dconf" -type f -printf '/%P\n' | while read -r dcpath ; do
dconf load "${dcpath}/" < "${BASEDIR}/dconf/${dcpath}"
done
}
# Setup variables # Setup variables
read_saved_prefs read_saved_prefs
# Defaults if not passed in or saved. # Defaults if not passed in or saved.
# TODO: use flags instead of environment variables. # TODO: use flags instead of environment variables.
BASEDIR=${BASEDIR:-$HOME/.skel} : ${BASEDIR:=$HOME/.skel}
MINIMAL=${MINIMAL:-0} : ${MINIMAL:=0}
INSTALL_KEYS=${INSTALL_KEYS:-1} : ${INSTALL_KEYS:=1}
TRUST_ALL_KEYS=${TRUST_ALL_KEYS:-0} : ${TRUST_ALL_KEYS:=0}
INSTALL_PKGS=${INSTALL_PKGS:-0} : ${INSTALL_PKGS:=0}
VERBOSE=${VERBOSE:-0} : ${VERBOSE:=0}
SAVE=${SAVE:-1} : ${SAVE:=1}
# Check prerequisites # Check prerequisites
if [ ! -d $BASEDIR ] ; then if [ ! -d "$BASEDIR" ] ; then
echo "Please install to $BASEDIR!" 1>&2 echo "Please install to $BASEDIR!" 1>&2
exit 1 exit 1
fi fi
if which dpkg-query > /dev/null 2>&1 ; then if command -v dpkg-query > /dev/null 2>&1 ; then
HAVE_X=$(dpkg-query -s xserver-xorg 2>/dev/null | \ HAVE_X=$(dpkg-query -s xserver-xorg 2>/dev/null | \
grep -c 'Status.*installed' \ grep -c 'Status.*installed' \
|| true) || true)
@@ -384,21 +425,21 @@ case $OPERATION in
install_dotfiles install_dotfiles
;; ;;
package*) package*)
if [ ${2:-default} != default ] ; then PKG_SET=${2:-minimal}
install_pkg_set packages.${2} install_pkg_set "packages.${PKG_SET}"
else
install_pkg_set packages
fi
;;
pwndbg)
install_pwndbg
;; ;;
test) test)
# Do nothing, just sourcing # Do nothing, just sourcing
set +o errexit set +o errexit
;; ;;
dconf)
# Load dconf
install_dconf
;;
*) *)
echo "Unknown operation $OPERATION." >/dev/stderr echo "Unknown operation $OPERATION." >/dev/stderr
exit 1 exit 1
;; ;;
esac esac
echo "OK"

Some files were not shown because too many files have changed in this diff Show More