78 Commits

Author SHA1 Message Date
David Tomaschik
5577ee29b4 Refactor to include non-dotfile files. 2015-09-03 18:02:48 -07:00
David Tomaschik
562697a2a7 Refactor zshrc. 2015-09-03 17:43:51 -07:00
David Tomaschik
dcaf567116 Add a better status bar. 2015-09-01 22:58:19 -07:00
David Tomaschik
9c6042116a Add virsh completions from jplitza/zsh-virsh-autocomplete 2015-08-31 22:55:50 -07:00
David Tomaschik
de3919a7fe Properly name tmux.conf 2015-08-31 22:54:11 -07:00
David Tomaschik
c568c81f60 Disable YCM 2015-08-31 18:09:31 -07:00
David Tomaschik
9936dd7983 Steal vimrc settings from vita. 2015-08-30 22:34:01 -07:00
David Tomaschik
c693c4b8c7 Steal some tmux settings from vitapluvia. 2015-08-30 22:05:12 -07:00
David Tomaschik
01e1c515ff tmux solarized theme 2015-08-30 21:32:21 -07:00
David Tomaschik
215f03af2e Fix install output to stderr. 2015-08-30 21:32:00 -07:00
David Tomaschik
88fae8ded3 Use solarized color scheme in vim. 2015-08-30 21:13:14 -07:00
David Tomaschik
029e41c1bf UTF-8 support in radare2. 2015-08-30 20:38:35 -07:00
David Tomaschik
ceceb307f9 Remap Caps Lock to Ctrl 2015-08-30 20:38:17 -07:00
David Tomaschik
4cbf297838 Quote variables. 2015-08-30 19:03:38 -07:00
David Tomaschik
1361fb8cc6 Add Vundle 2015-08-30 14:11:52 -07:00
David Tomaschik
c11ea02838 Update irssi configuration. 2015-08-25 00:19:30 -07:00
David Tomaschik
ecdf364f65 Easily add more directories to PATH. 2015-08-24 22:31:45 -07:00
David Tomaschik
98d85b801d Add aliases for github URLs. 2015-08-19 19:19:48 -07:00
David Tomaschik
e1a5c1f588 Use AES256 by default in gpg.conf 2015-07-25 15:57:35 -07:00
David Tomaschik
da2b4b82f4 Install oh-my-zsh if possible. 2015-07-25 15:57:16 -07:00
David Tomaschik
f03e60b30d Various dotfile updates. 2015-06-13 18:14:06 -07:00
David Tomaschik
c6ed005467 Special launch for chrome for burp. 2014-10-31 23:21:45 -07:00
David Tomaschik
3461ae3417 Make more consistent. 2014-10-28 10:38:00 -07:00
David Tomaschik
45c0b529af Merge branch 'master' of github.com:Matir/dotfiles 2014-10-21 18:41:22 -07:00
David Tomaschik
f1e16ebaf8 Fix up vim settings for python. 2014-10-21 18:41:12 -07:00
David Tomaschik
1b901faab1 Change push.default to a setting that is widely compatible. 2014-10-20 13:46:59 -07:00
David Tomaschik
a7ae4f47a8 Rename .zsh_local to .zshrc.local. 2014-10-20 11:08:23 -07:00
David Tomaschik
58bdc6b23a Add a basic curlrc. 2014-10-19 19:27:12 -07:00
David Tomaschik
9bad2d4afa Add history number to prompt. 2014-10-18 23:35:35 -07:00
David Tomaschik
d920a25f57 Fix up some vimrc stuff. 2014-10-17 15:06:06 -07:00
David Tomaschik
2225fbed9a Add some more useful vim plugins. 2014-10-16 16:01:40 -07:00
David Tomaschik
95ccf66984 Set default git web browser to chrome. 2014-10-16 13:58:30 -07:00
David Tomaschik
c32b9ef765 Make the prompt look nicer in my theme. 2014-10-16 13:19:04 -07:00
David Tomaschik
c400ab787f Add my theme and setup a ZSH_CUSTOM directory. 2014-10-16 12:34:36 -07:00
David Tomaschik
91790b5a12 Add cheap alias for dist-upgrade. 2014-10-15 22:07:36 -07:00
David Tomaschik
c65f3b4730 Include my prompt when no zsh theme is available. 2014-10-15 21:40:52 -07:00
David Tomaschik
6185108c0f Fix typo in excludesfile. 2014-10-11 11:58:03 -07:00
David Tomaschik
8b59e8c764 Keybinding for autopep8 2014-09-28 16:22:09 -07:00
David Tomaschik
114db98bdf Add global gitignore. 2014-09-27 22:13:58 -07:00
David Tomaschik
7364eb5446 Ignore swap and other common files. 2014-09-27 19:51:45 -07:00
David Tomaschik
31f16132dc Add flake8 plugin for vim. 2014-09-27 19:50:47 -07:00
David Tomaschik
70efebd88d Also include a .vimrc.local if available. 2014-09-27 18:54:48 -07:00
David Tomaschik
d9f6a1b250 Include Vundle if it's on the machine I'm on. 2014-09-27 18:53:29 -07:00
David Tomaschik
a3292747eb Add extract and sudo oh-my-zsh plugins. 2014-09-27 09:40:29 -07:00
David Tomaschik
6b8b7673d8 Ensure directory and contents of private_dotfiles are ignored. 2014-09-26 07:43:04 -07:00
David Tomaschik
283609cc50 Less flag updates. 2014-09-26 07:42:42 -07:00
David Tomaschik
efec992784 Add hex editing function to vim. 2014-09-25 22:20:59 -07:00
David Tomaschik
be49f3f57c Add ackrc and fix how less is invoked. 2014-09-25 22:16:41 -07:00
David Tomaschik
3a89085279 Keybindings for history and zle. 2014-09-23 20:47:45 -07:00
David Tomaschik
b12b39f8c4 Bump IRSSI configs. 2014-09-23 20:42:25 -07:00
David Tomaschik
e6a7cd9b9f Alias ack to ack-grep. 2014-09-23 20:38:00 -07:00
David Tomaschik
89bdedbf4f Update irssi config. 2014-06-07 17:58:29 -07:00
David Tomaschik
5ac75c4b63 Use bash-style history ignoring. 2014-06-07 17:57:51 -07:00
David Tomaschik
f235fb2660 Disable stty start/stop. 2014-05-26 13:21:14 -07:00
David Tomaschik
3839ac9e2f Get aliases even in non-interactive shells. 2014-05-26 10:20:13 -07:00
David Tomaschik
63a6f8bb32 Radare2 callgraph macro. 2014-05-25 23:26:04 -07:00
David Tomaschik
4510acb3ea Allow core files by default. 2014-05-24 08:30:34 -07:00
David Tomaschik
173abd42e4 Clean up r2 views. 2014-05-24 08:30:08 -07:00
David Tomaschik
27b026f011 Better search options. 2014-05-24 08:29:46 -07:00
David Tomaschik
1dcee2dbf0 radare2rc: Remove options not supported in older versions, set debugger entry point. 2014-05-18 10:44:05 -07:00
David Tomaschik
3721d061fa Silence messages about gpg-agent if missing. 2014-04-10 21:49:48 -07:00
David Tomaschik
403dad5318 Add basic byobu setup. 2014-04-10 21:49:19 -07:00
David Tomaschik
58c49d5c5b Fix up prompt, oh-my-zsh modules. 2014-04-08 21:38:31 -07:00
David Tomaschik
bb519ae3af Selectively enable oh-my-zsh. 2014-04-05 23:34:21 -07:00
David Tomaschik
125bf08e73 Add autopushd option to zshrc. 2014-04-04 07:47:15 -07:00
David Tomaschik
e5066e087d radarerc is radare2rc in modern r2. 2014-04-03 23:33:14 -07:00
David Tomaschik
345c2e5423 Switch from vim keybindings to emacs in zsh. 2014-04-03 18:44:31 -07:00
David Tomaschik
09b7cad44a Add Google Cloud SDK to path. 2014-04-03 18:44:08 -07:00
David Tomaschik
01dab7312f sudow command in vimrc. 2014-03-20 20:41:54 -07:00
David Tomaschik
366f99aef7 Use HKPS for GnuPG. 2014-03-15 21:32:05 -07:00
David Tomaschik
ea571ac1b8 Basic radarerc. 2014-03-02 16:44:47 -08:00
David Tomaschik
59c26347ae GDB: Fix up 64 bit issues, use radix 10 for input. 2014-03-02 09:54:25 -08:00
David Tomaschik
9aa69c551e Add a path for Go. 2014-03-02 09:54:03 -08:00
David Tomaschik
775657b90d Add new aliases. 2014-03-02 09:53:49 -08:00
David Tomaschik
4ae16a4a17 Add reverser's gdbinit as a separate file, get rid of highlighting. 2014-02-10 18:18:58 -05:00
David Tomaschik
9bb50f6136 Add a wgetrc. 2014-02-10 17:54:17 -05:00
David Tomaschik
aa984c6a07 Push aliases to their own file. 2014-02-10 17:48:40 -05:00
David Tomaschik
843863cc75 .gitconfig: simple is not supported in git < 2.0 2014-02-02 16:29:42 -08:00
54 changed files with 3633 additions and 448 deletions

4
.gitignore vendored
View File

@@ -1 +1,5 @@
private_dotfiles
private_dotfiles/**
*.swp
*~
*.bak

3
dotfiles/ackrc Normal file
View File

@@ -0,0 +1,3 @@
--follow
--pager=less -LMXRF
--smart-case

32
dotfiles/aliases Normal file
View File

@@ -0,0 +1,32 @@
# General aliases, should only be sourced in interactive shells
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; 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
alias luksFormat='sudo cryptsetup luksFormat -s 512 -c aes-xts-plain --use-random -h sha256 -i 5000'
# Colors
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# Easy upgrade
alias dist-upgrade="sudo sh -c 'apt-get update && apt-get -y dist-upgrade'"
# Timestamp in a machine-sortable form
alias tstamp="date '+%Y%m%d-%H%M%S'"
# Prepare code for markdown
alias mdcode="sed 's/^/ /'"
# Intel format plz
alias objdump="command objdump -M intel"
# ACK
alias ack="ack-grep"
# Launch chrome for burp
alias chrome-for-burp="/usr/bin/google-chrome --ignore-certificate-errors --user-data-dir=${HOME}/.chrome-for-burp --proxy-server=127.0.0.1:8080 >/dev/null 2>&1 &"

View File

@@ -37,13 +37,8 @@ xterm*|rxvt*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# Bash completion

View File

1
dotfiles/byobu/backend Normal file
View File

@@ -0,0 +1 @@
BYOBU_BACKEND=tmux

3
dotfiles/byobu/color Normal file
View File

@@ -0,0 +1,3 @@
BACKGROUND=k
FOREGROUND=w
MONOCHROME=0

View File

@@ -0,0 +1,5 @@
BYOBU_DARK=black
BYOBU_LIGHT=white
BYOBU_ACCENT=magenta
BYOBU_HIGHLIGHT=red
MONOCHROME=0

View File

@@ -0,0 +1 @@
source $BYOBU_PREFIX/share/byobu/keybindings/common

View File

@@ -0,0 +1,4 @@
unbind-key -n C-a
set -g prefix ^A
set -g prefix2 ^A
bind a send-prefix

1
dotfiles/byobu/profile Normal file
View File

@@ -0,0 +1 @@
source $BYOBU_PREFIX/share/byobu/profiles/common

View File

@@ -0,0 +1 @@
source $BYOBU_PREFIX/share/byobu/profiles/tmux

1
dotfiles/byobu/prompt Normal file
View File

@@ -0,0 +1 @@
[ -r /usr/share/byobu/profiles/bashrc ] && . /usr/share/byobu/profiles/bashrc #byobu-prompt#

37
dotfiles/byobu/status Normal file
View File

@@ -0,0 +1,37 @@
# status - Byobu's default status enabled/disabled settings
#
# Override these in $BYOBU_CONFIG_DIR/status
# where BYOBU_CONFIG_DIR is XDG_CONFIG_HOME if defined,
# and $HOME/.byobu otherwise.
#
# Copyright (C) 2009-2011 Canonical Ltd.
#
# Authors: Dustin Kirkland <kirkland@byobu.co>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Status beginning with '#' are disabled.
# Screen has two status lines, with 4 quadrants for status
screen_upper_left="color"
screen_upper_right="color whoami hostname ip_address menu"
screen_lower_left="color logo distro release #arch"
screen_lower_right="color network #disk_io custom #entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #time_utc date time"
# Tmux has one status line, with 2 halves for status
tmux_left="logo #distro release #arch"
# You can have as many tmux right lines below here, and cycle through them using Shift-F5
tmux_right="#network #disk_io #custom #entropy raid reboot_required updates_available #apport #services #mail #users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp #battery #wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #whoami #hostname #ip_address #time_utc date time"
#tmux_right="network #disk_io #custom entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost fan_speed cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk whoami hostname ip_address #time_utc date time"
#tmux_right="network #disk_io custom #entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #whoami #hostname ip_address #time_utc date time"
#tmux_right="#network disk_io #custom entropy #raid #reboot_required #updates_available #apport #services #mail #users #uptime #ec2_cost #rcs_cost fan_speed cpu_temp #battery #wifi_quality #processes #load_average #cpu_count #cpu_freq #memory #swap whoami hostname ip_address #time_utc disk date time"

78
dotfiles/byobu/statusrc Normal file
View File

@@ -0,0 +1,78 @@
# statusrc - Byobu's default status configurations
#
# Override these in $BYOBU_CONFIG_DIR/statusrc
# where BYOBU_CONFIG_DIR is XDG_CONFIG_HOME if defined,
# and $HOME/.byobu otherwise.
#
# Copyright (C) 2009-2011 Canonical Ltd.
#
# Authors: Dustin Kirkland <kirkland@byobu.co>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Configurations that you can override; if you leave these commented out,
# Byobu will try to auto-detect them.
# This should be auto-detected for most distro, but setting it here will save
# some call to lsb_release and the like.
#DISTRO=Ubuntu
# Default: depends on the distro (which is either auto-detected, either set
# via $DISTRO)
#LOGO="\o/"
# Abbreviate the release to N characters
# By default, this is disabled. But if you set RELEASE_ABBREVIATED=1
# and your lsb_release is "precise", only "p" will be displayed
#RELEASE_ABBREVIATED=1
# Default: /
#MONITORED_DISK=/
# Minimum disk throughput that triggers the notification (in kB/s)
# Default: 50
#DISK_IO_THRESHOLD=50
# Default: eth0
#MONITORED_NETWORK=eth0
# Unit used for network throughput (either bits per second or bytes per second)
# Default: bits
#NETWORK_UNITS=bytes
# Minimum network throughput that triggers the notification (in kbit/s)
# Default: 20
#NETWORK_THRESHOLD=20
# You can add an additional source of temperature here
#MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature
# Default: C
#TEMP=F
#SERVICES="eucalyptus-nc|NC eucalyptus-cloud|CLC eucalyptus-walrus eucalyptus-cc|CC eucalyptus-sc|SC"
#FAN=$(find /sys -type f -name fan1_input | head -n1)
# You can set this to 1 to report your external/public ip address
# Default: 0
#IP_EXTERNAL=0
# The users notification normally counts ssh sessions; set this configuration to '1'
# to instead count number of distinct users logged onto the system
# Default: 0
#USERS_DISTINCT=0
# Set this to zero to hide seconds int the time display
# Default 1
#TIME_SECONDS=0

0
dotfiles/byobu/windows Normal file
View File

4
dotfiles/curlrc Normal file
View File

@@ -0,0 +1,4 @@
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
referer = ";auto"

82
dotfiles/gdbinit Normal file
View File

@@ -0,0 +1,82 @@
# General options
set verbose off
set disassembly-flavor intel
set output-radix 0x10
set input-radix 10.
# helpful shortcuts
define lsbp
info breakpoints
end
document lsbp
List all breakpoints
end
define iframe
info frame
info args
info locals
end
define reg
info registers
end
# __________________gdb options_________________
# set to 1 to have ARM target debugging as default, use the "arm" command to switch inside gdb
set $ARM = 0
# set to 0 if you have problems with the colorized prompt - reported by Plouj with Ubuntu gdb 7.2
set $COLOUREDPROMPT = 0
# Colour the first line of the disassembly - default is green, if you want to change it search for
# SETCOLOUR1STLINE and modify it :-)
set $SETCOLOUR1STLINE = 0
# set to 0 to remove display of objectivec messages (default is 1)
set $SHOWOBJECTIVEC = 1
# set to 0 to remove display of cpu registers (default is 1)
set $SHOWCPUREGISTERS = 1
# set to 1 to enable display of stack (default is 0)
set $SHOWSTACK = 1
# set to 1 to show 4 bytes of the stack at a time for 32bit and 8 bytes for 64bit
set $STACK_WORDSIZE = 1
# set to 1 to enable display of data window (default is 0)
set $SHOWDATAWIN = 0
# set to 0 to disable coloured display of changed registers
set $SHOWREGCHANGES = 1
# set to 1 so skip command to execute the instruction at the new location
# by default it EIP/RIP will be modified and update the new context but not execute the instruction
set $SKIPEXECUTE = 0
# if $SKIPEXECUTE is 1 configure the type of execution
# 1 = use stepo (do not get into calls), 0 = use stepi (step into calls)
set $SKIPSTEP = 1
# show the ARM opcodes - change to 0 if you don't want such thing (in x/i command)
set $ARMOPCODES = 1
# x86 disassembly flavor: 0 for Intel, 1 for AT&T
set $X86FLAVOR = 0
# use colorized output or not
set $USECOLOR = 0
# 64 bit options
set $64BITS = 0
# Remote 64 bit debugging
set $KDP64BITS = -1
set confirm off
set verbose off
set output-radix 0x10
set input-radix 0x10
# These make gdb never pause in its output
set height 0
set width 0
set $SHOW_CONTEXT = 1
set $SHOW_NEST_INSN = 0
set $CONTEXTSIZE_STACK = 6
set $CONTEXTSIZE_DATA = 8
set $CONTEXTSIZE_CODE = 8
# __________________end gdb options_________________
#
source ~/.reverser-gdbinit

15
dotfiles/gitconfig Normal file
View File

@@ -0,0 +1,15 @@
[user]
name = David Tomaschik
email = david@systemoverlord.com
[push]
default = current
[core]
excludesfile = ~/.gitignore
[web]
browser = chrome
[github]
user = matir
[url "https://github.com/"]
insteadOf = github://
[url "ssh://git@github.com/"]
pushInsteadOf = github://

10
dotfiles/gitignore Normal file
View File

@@ -0,0 +1,10 @@
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.swp
*~
*.bak

10
dotfiles/gnupg/gpg.conf Normal file
View File

@@ -0,0 +1,10 @@
use-agent
# HKPS requires gnupg-curl for gpg1
keyserver hkps://hkps.pool.sks-keyservers.net
# Unfortunately, the path must be fully-qualified
keyserver-options auto-key-retrieve ca-cert-file=/home/david/.gnupg/sks-keyservers.pem
auto-key-locate keyserver
personal-digest-preferences SHA256
cert-digest-algo SHA256
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
cipher-algo AES256

View File

@@ -0,0 +1,32 @@
-----BEGIN CERTIFICATE-----
MIIFizCCA3OgAwIBAgIJAK9zyLTPn4CPMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNV
BAYTAk5PMQ0wCwYDVQQIDARPc2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5u
ZXQgQ0ExHjAcBgNVBAMMFXNrcy1rZXlzZXJ2ZXJzLm5ldCBDQTAeFw0xMjEwMDkw
MDMzMzdaFw0yMjEwMDcwMDMzMzdaMFwxCzAJBgNVBAYTAk5PMQ0wCwYDVQQIDARP
c2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5uZXQgQ0ExHjAcBgNVBAMMFXNr
cy1rZXlzZXJ2ZXJzLm5ldCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC
ggIBANdsWy4PXWNUCkS3L//nrd0GqN3dVwoBGZ6w94Tw2jPDPifegwxQozFXkG6I
6A4TK1CJLXPvfz0UP0aBYyPmTNadDinaB9T4jIwd4rnxl+59GiEmqkN3IfPsv5Jj
MkKUmJnvOT0DEVlEaO1UZIwx5WpfprB3mR81/qm4XkAgmYrmgnLXd/pJDAMk7y1F
45b5zWofiD5l677lplcIPRbFhpJ6kDTODXh/XEdtF71EAeaOdEGOvyGDmCO0GWqS
FDkMMPTlieLA/0rgFTcz4xwUYj/cD5e0ZBuSkYsYFAU3hd1cGfBue0cPZaQH2HYx
Qk4zXD8S3F4690fRhr+tki5gyG6JDR67aKp3BIGLqm7f45WkX1hYp+YXywmEziM4
aSbGYhx8hoFGfq9UcfPEvp2aoc8u5sdqjDslhyUzM1v3m3ZGbhwEOnVjljY6JJLx
MxagxnZZSAY424ZZ3t71E/Mn27dm2w+xFRuoy8JEjv1d+BT3eChM5KaNwrj0IO/y
u8kFIgWYA1vZ/15qMT+tyJTfyrNVV/7Df7TNeWyNqjJ5rBmt0M6NpHG7CrUSkBy9
p8JhimgjP5r0FlEkgg+lyD+V79H98gQfVgP3pbJICz0SpBQf2F/2tyS4rLm+49rP
fcOajiXEuyhpcmzgusAj/1FjrtlynH1r9mnNaX4e+rLWzvU5AgMBAAGjUDBOMB0G
A1UdDgQWBBTkwyoJFGfYTVISTpM8E+igjdq28zAfBgNVHSMEGDAWgBTkwyoJFGfY
TVISTpM8E+igjdq28zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4ICAQAR
OXnYwu3g1ZjHyley3fZI5aLPsaE17cOImVTehC8DcIphm2HOMR/hYTTL+V0G4P+u
gH+6xeRLKSHMHZTtSBIa6GDL03434y9CBuwGvAFCMU2GV8w92/Z7apkAhdLToZA/
X/iWP2jeaVJhxgEcH8uPrnSlqoPBcKC9PrgUzQYfSZJkLmB+3jEa3HKruy1abJP5
gAdQvwvcPpvYRnIzUc9fZODsVmlHVFBCl2dlu/iHh2h4GmL4Da2rRkUMlbVTdioB
UYIvMycdOkpH5wJftzw7cpjsudGas0PARDXCFfGyKhwBRFY7Xp7lbjtU5Rz0Gc04
lPrhDf0pFE98Aw4jJRpFeWMjpXUEaG1cq7D641RpgcMfPFvOHY47rvDTS7XJOaUT
BwRjmDt896s6vMDcaG/uXJbQjuzmmx3W2Idyh3s5SI0GTHb0IwMKYb4eBUIpQOnB
cE77VnCYqKvN1NVYAqhWjXbY7XasZvszCRcOG+W3FqNaHOK/n/0ueb0uijdLan+U
f4p1bjbAox8eAOQS/8a3bzkJzdyBNUKGx1BIK2IBL9bn/HravSDOiNRSnZ/R3l9G
ZauX0tu7IIDlRCILXSyeazu0aj/vdT3YFQXPcvt5Fkf5wiNTo53f72/jYEJd6qph
WrpoKqrwGwTpRUCMhYIUt65hsTxCiJJ5nKe39h46sg==
-----END CERTIFICATE-----

View File

@@ -1,37 +1,4 @@
servers = (
{ address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; },
{ address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; },
{ address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; },
{
address = "irc.undernet.org";
chatnet = "Undernet";
port = "6667";
},
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
{
address = "irc.quakenet.org";
chatnet = "QuakeNet";
port = "6667";
},
{ address = "irc.oftc.net"; chatnet = "OFTC"; port = "6667"; },
{
address = "irc.gamesurge.net";
chatnet = "GameSurge";
port = "6667";
},
{ address = "irc.webchat.org"; chatnet = "WebChat"; port = "6667"; },
{ address = "irc.rizon.net"; chatnet = "Rizon"; port = "6667"; },
{ address = "irc.link-net.org"; chatnet = "LinkNet"; port = "6667"; },
{ address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; },
{
address = "irc.freenode.net";
chatnet = "freenode";
port = "7000";
use_ssl = "yes";
ssl_verify = "yes";
ssl_capath = "/etc/ssl/certs";
autoconnect = "yes";
},
{
address = "ircs.overthewire.org";
chatnet = "overthewire";
@@ -49,9 +16,27 @@ servers = (
autoconnect = "yes";
},
{
address = "irc.us.hackint.eu";
chatnet = "hackint";
port = "9999";
address = "chat.freenode.net";
chatnet = "freenode";
port = "7000";
use_ssl = "yes";
ssl_cert = "~/.irssi/matir.pem";
ssl_verify = "yes";
ssl_cafile = "~/.irssi/instantssl.crt";
autoconnect = "yes";
},
{
address = "irc.geekshed.net";
chatnet = "geekshed";
port = "6697";
use_ssl = "yes";
ssl_verify = "no";
autoconnect = "yes";
},
{
address = "irc.rpis.ec";
chatnet = "rpisec";
port = "6697";
use_ssl = "yes";
ssl_verify = "no";
autoconnect = "yes";
@@ -59,72 +44,32 @@ servers = (
);
chatnets = {
IRCnet = {
type = "IRC";
max_kicks = "4";
max_msgs = "5";
max_whois = "4";
max_query_chans = "5";
};
EFNet = {
type = "IRC";
max_kicks = "4";
max_msgs = "3";
max_whois = "1";
};
Undernet = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
DALnet = {
type = "IRC";
max_kicks = "4";
max_msgs = "3";
max_whois = "30";
};
QuakeNet = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
OFTC = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
GameSurge = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
WebChat = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
Rizon = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
LinkNet = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
SILC = { type = "SILC"; };
freenode = { type = "IRC"; };
overthewire = { type = "IRC"; nick = "Matir"; };
secfo = { type = "IRC"; };
hackint = { type = "IRC"; nick = "Matir"; };
freenode = {
type = "IRC";
nick = "Matir";
username = "matir";
realname = "Matir";
max_kicks = "1";
max_msgs = "4";
max_modes = "4";
max_whois = "1";
};
geekshed = {
type = "IRC";
nick = "KF4MDV";
username = "kf4mdv";
realname = "David";
};
rpisec = { type = "IRC"; };
};
channels = (
@@ -132,7 +77,14 @@ channels = (
{ name = "#hak5"; chatnet = "secfo"; autojoin = "yes"; },
{ name = "#wargames"; chatnet = "overthewire"; autojoin = "yes"; },
{ name = "#social"; chatnet = "overthewire"; autojoin = "yes"; },
{ name = "#openvpn"; chatnet = "freenode"; autojoin = "yes"; }
{ name = "#openvpn"; chatnet = "freenode"; autojoin = "yes"; },
{ name = "#shadowcats"; chatnet = "freenode"; autojoin = "yes"; },
{ name = "#amateria"; chatnet = "overthewire"; autojoin = "yes"; },
{ name = "#io"; chatnet = "overthewire"; autojoin = "yes"; },
{ name = "#radare"; chatnet = "freenode"; autojoin = "yes"; },
{ name = "#vulnhub"; chatnet = "freenode"; autojoin = "yes"; },
{ name = "#redditnet"; chatnet = "geekshed"; autojoin = "yes"; },
{ name = "#rpisec"; chatnet = "rpisec"; autojoin = "yes"; }
);
aliases = {
@@ -225,7 +177,7 @@ statusbar = {
# the "default statusbar" to be displayed at the bottom of the window.
# contains all the normal items.
window = {
disabled = "no";
disabled = "yes";
# window, root
type = "window";
@@ -244,7 +196,6 @@ statusbar = {
window = { };
window_empty = { };
lag = { priority = "-1"; };
act = { priority = "10"; };
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
@@ -289,11 +240,30 @@ statusbar = {
visible = "always";
items = {
topicbarstart = { priority = "100"; };
time = { priority = "100"; };
topic = { };
topic_empty = { };
window_empty = { alignment = "right"; };
user = { priority = "100"; alignment = "right"; };
topicbarend = { priority = "100"; alignment = "right"; };
};
};
placement = { items = { }; disabled = "yes"; };
remove = { disabled = "yes"; };
awl_0 = {
items = {
barstart = { priority = "100"; };
awl_0 = { };
barend = { priority = "100"; alignment = "right"; };
};
};
awl_1 = {
items = {
barstart = { priority = "100"; };
awl_1 = { };
barend = { priority = "100"; alignment = "right"; };
};
};
};
};
settings = {
@@ -307,11 +277,120 @@ settings = {
"fe-common/core" = {
autolog = "yes";
autolog_path = "~/irclogs/%Y/%m/$tag/$0.log";
autoclose_query = "1800";
autocreate_own_query = "no";
show_nickmode_empty = "no";
term_charset = "utf-8";
};
"perl/core/scripts" = {
awl_shared_sbar = "OFF";
awl_viewer = "no";
awl_block = "-15";
awl_maxlines = "2";
awl_height_adjust = "2";
};
};
logs = {
"~/irc.log.Window7" = {
level = "ALL";
items = ( { type = "window"; name = "7"; } );
windows = {
1 = { immortal = "yes"; name = "(status)"; level = "ALL"; };
2 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#kali-linux";
tag = "freenode";
}
);
};
3 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#radare";
tag = "freenode";
}
);
};
4 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#vulnhub";
tag = "freenode";
}
);
};
5 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#openvpn";
tag = "freenode";
}
);
};
6 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#wargames";
tag = "overthewire";
}
);
};
7 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#social";
tag = "overthewire";
}
);
};
8 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#amateria";
tag = "overthewire";
}
);
};
9 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#io";
tag = "overthewire";
}
);
};
10 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#RedditNet";
tag = "geekshed";
}
);
};
11 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#hak5";
tag = "secfo";
}
);
};
};
mainwindows = { 1 = { first_line = "1"; lines = "78"; }; };

View File

@@ -0,0 +1,26 @@
-----BEGIN CERTIFICATE-----
MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB
lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG
A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe
MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v
d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh
cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn
0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ
M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a
MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd
oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI
DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy
oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD
VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0
dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy
bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF
BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM
//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli
CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE
CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t
3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS
KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA==
-----END CERTIFICATE-----

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
../adv_windowlist.pl

View File

@@ -1,6 +1,7 @@
# Sourced by zshrc as well as bash.
umask 022
umask 027
ulimit -c unlimited
# if running bash
if [ -n "$BASH_VERSION" ]; then
@@ -8,17 +9,32 @@ if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
shopt -s expand_aliases
fi
# Paths and preferences
export PATH="$HOME/bin:/sbin:/usr/sbin:$PATH"
export PYTHONPATH="$HOME/.python"
export GOPATH="$HOME/.go"
export VISUAL=vim
export EDITOR=vim
export TZ='America/Los_Angeles'
export DEBEMAIL=david@systemoverlord.com
export DEBEMAIL="david@systemoverlord.com"
export DEBFULLNAME="David Tomaschik"
export LESS="-MR"
EXTRA_PATHS=("$HOME/.gce/google-cloud-sdk/bin" "$HOME/bin/genymotion"
"$HOME/bin/genymotion/tools" )
for p in "${EXTRA_PATHS[@]}" ; do
if [ -d "$p" ] ; then
export PATH="$PATH:$p"
fi
done
unset EXTRA_PATHS
# Disable stty ctrl-s/ctrl-q behavior
stty stop undef
stty start undef
# Setup GPG Agent
GPG_AGENT_INFO_PATH=$HOME/.gnupg/gpg-agent-info-`hostname`
@@ -26,17 +42,13 @@ if test -f $GPG_AGENT_INFO_PATH && kill -0 `cut -d: -f 2 $GPG_AGENT_INFO_PATH` 2
. $GPG_AGENT_INFO_PATH
export GPG_AGENT_INFO SSH_AUTH_SOCK SSH_AGENT_PID
else
if which gpg-agent >/dev/null 2>&1 ; then
gpg-agent -q || eval `gpg-agent --daemon --enable-ssh-support --write-env-file $GPG_AGENT_INFO_PATH` 2>/dev/null
fi
fi
unset GPG_AGENT_INFO_PATH
export GPG_TTY=`tty`
# End GPG
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; 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
alias luksFormat='sudo cryptsetup luksFormat -s 512 -c aes-xts-plain --use-random -h sha256 -i 5000'
if [ -f $HOME/.localenv ] ; then source $HOME/.localenv ; fi
if [[ -e $HOME/.localenv ]] ; then source $HOME/.localenv ; fi
if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi

5
dotfiles/radare2/xdot Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
DOT=`mktemp`
cat > $DOT
xdot $DOT

10
dotfiles/radare2rc Normal file
View File

@@ -0,0 +1,10 @@
e scr.color = true
e scr.utf8 = true
e dbg.bep = main
e asm.syntax = intel
e asm.linescall = true
e asm.linesout = true
e asm.lineswidth = 12
# Callgraph: .(cg)
(cg,aa,ag | $HOME/.radare2/xdot || xdot -,)

View File

@@ -1,163 +1,73 @@
# General options
set verbose off
set disassembly-flavor intel
set output-radix 0x10
set input-radix 0x10
# helpful shortcuts
define lsbp
info breakpoints
end
document lsbp
List all breakpoints
end
define iframe
info frame
info args
info locals
end
define reg
info registers
end
# taviso's assembly macro
define assemble
# dont enter routine again if user hits enter
dont-repeat
if ($argc)
if (*$arg0 = *$arg0)
# check if we have a valid address by dereferencing it,
# if we havnt, this will cause the routine to exit.
end
printf "Instructions will be written to %#x.\n", $arg0
else
printf "Instructions will be written to stdout.\n"
end
printf "Type instructions, one per line.\n"
printf "End with a line saying just \"end\".\n"
if ($argc)
# argument specified, assemble instructions into memory
# at address specified.
shell nasm -f bin -o /dev/stdout /dev/stdin \
<<< "$( echo "BITS 32"; while read -ep '>' r && test "$r" != end; \
do echo -E "$r"; done )" | hexdump -ve \
'1/1 "set *((unsigned char *) $arg0 + %#2_ax) = %#02x\n"' \
> ~/.gdbassemble
# load the file containing set instructions
source ~/.gdbassemble
# all done.
shell rm -f ~/.gdbassemble
else
# no argument, assemble instructions to stdout
shell nasm -f bin -o /dev/stdout /dev/stdin \
<<< "$( echo "BITS 32"; while read -ep '>' r && test "$r" != end; \
do echo -E "$r"; done )" | ndisasm -i -b32 /dev/stdin
end
end
document assemble
Assemble instructions using nasm.
Type a line containing "end" to indicate the end.
If an address is specified, insert instructions at that address.
If no address is specified, assembled instructions are printed to stdout.
Use the pseudo instruction "org ADDR" to set the base address.
end
# Color disassembly
shell rm -f /tmp/gdbColorPipe
shell mkfifo -m 600 /tmp/gdbColorPipe
define hook-x
set logging off
set logging redirect off
shell cat /tmp/gdbColorPipe | highlight --syntax=asm -s darkness -Oxterm256 &
set logging redirect on
set logging on /tmp/gdbColorPipe
end
define hookpost-x
set logging off
set logging redirect off
shell sleep 0.1s
end
define hook-disassemble
hook-x
echo \n
end
define hookpost-disassemble
hookpost-x
end
define hook-quit
shell rm -f /tmp/gdbColorPipe
end
define re
hookpost-disassemble
echo \033[0m
end
document re
Restore colorscheme
end
# __________________gdb options_________________
# set to 1 to have ARM target debugging as default, use the "arm" command to switch inside gdb
set $ARM = 0
# set to 0 if you have problems with the colorized prompt - reported by Plouj with Ubuntu gdb 7.2
set $COLOUREDPROMPT = 0
# Colour the first line of the disassembly - default is green, if you want to change it search for
# SETCOLOUR1STLINE and modify it :-)
set $SETCOLOUR1STLINE = 0
# set to 0 to remove display of objectivec messages (default is 1)
set $SHOWOBJECTIVEC = 1
# set to 0 to remove display of cpu registers (default is 1)
set $SHOWCPUREGISTERS = 1
# set to 1 to enable display of stack (default is 0)
set $SHOWSTACK = 1
# set to 1 to show 4 bytes of the stack at a time for 32bit and 8 bytes for 64bit
set $STACK_WORDSIZE = 1
# set to 1 to enable display of data window (default is 0)
set $SHOWDATAWIN = 0
# set to 0 to disable coloured display of changed registers
set $SHOWREGCHANGES = 1
# set to 1 so skip command to execute the instruction at the new location
# by default it EIP/RIP will be modified and update the new context but not execute the instruction
set $SKIPEXECUTE = 0
# if $SKIPEXECUTE is 1 configure the type of execution
# 1 = use stepo (do not get into calls), 0 = use stepi (step into calls)
set $SKIPSTEP = 1
# show the ARM opcodes - change to 0 if you don't want such thing (in x/i command)
set $ARMOPCODES = 1
# x86 disassembly flavor: 0 for Intel, 1 for AT&T
set $X86FLAVOR = 0
# use colorized output or not
set $USECOLOR = 0
set confirm off
set verbose off
set output-radix 0x10
set input-radix 0x10
# These make gdb never pause in its output
set height 0
set width 0
set $SHOW_CONTEXT = 1
set $SHOW_NEST_INSN = 0
set $CONTEXTSIZE_STACK = 6
set $CONTEXTSIZE_DATA = 8
set $CONTEXTSIZE_CODE = 8
# __________________end gdb options_________________
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file, for x86/x86_64 and ARM platforms.
#
# REVISION : 8.0.5 (18/08/2013)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: http://reverse.put.as - reverser@put.as
#
# NOTES: 'help user' in gdb will list the commands/descriptions in this file
# 'context on' now enables auto-display of context screen
#
# MAC OS X NOTES: If you are using this on Mac OS X, you must either attach gdb to a process
# or launch gdb without any options and then load the binary file you want to analyse with "exec-file" option
# If you load the binary from the command line, like $gdb binary-name, this will not work as it should
# For more information, read it here http://reverse.put.as/2008/11/28/apples-gdb-bug/
#
# UPDATE: This bug can be fixed in gdb source. Refer to http://reverse.put.as/2009/08/10/fix-for-apples-gdb-bug-or-why-apple-forks-are-bad/
# and http://reverse.put.as/2009/08/26/gdb-patches/ (if you want the fixed binary for i386)
#
# An updated version of the patch and binary is available at http://reverse.put.as/2011/02/21/update-to-gdb-patches-fix-a-new-bug/
#
# iOS NOTES: iOS gdb from Cydia (and Apple's) suffer from the same OS X bug.
# If you are using this on Mac OS X or iOS, you must either attach gdb to a process
# or launch gdb without any options and then load the binary file you want to analyse with "exec-file" option
# If you load the binary from the command line, like $gdb binary-name, this will not work as it should
# For more information, read it here http://reverse.put.as/2008/11/28/apples-gdb-bug/
#
# CHANGELOG: (older changes at the end of the file)
#
# Version 8.0.6 (05/09/2013)
# - Add patch command to convert bytes to little-endian and patch memory
#
# Version 8.0.5 (18/08/2013)
# - Add commands header and loadcmds to dump Mach-O header information
# - Other fixes and additions from previous commits
#
# Version 8.0.4 (08/05/2013)
# - Detect automatically 32 or 64 bits archs using sizeof(void*).
# Thanks to Tyilo for the simple but very effective idea!
# - Typo in hexdump command also fixed by vuquangtrong.
# - Add shortcuts to attach to VMware kernel debugging gdb stub (kernel32 and kernel64)
#
# Version 8.0.3 (21/03/2013)
# - Add option to colorize or not output (thanks to argp and skier for the request and ideas!)
# - Convert the escape codes into functions so colors can be easily customized
# - Other enhancements available at git commit logs
# Thanks to Plouj, argp, xristos for their ideas and fixes!
#
# Version 8.0.2 (31/07/2012)
# - Merge pull request from mheistermann to support local modifications in a .gdbinit.local file
# - Add a missing opcode to the stepo command
#
# Version 8.0.1 (23/04/2012)
# - Small bug fix to the attsyntax and intelsyntax commands (changing X86 flavor variable was missing)
#
# Version 8.0 (13/04/2012)
# - Merged x86/x64 and ARM versions
# - Added commands intelsyntax and attsyntax to switch between x86 disassembly flavors
# - Added new configuration variables ARM, ARMOPCODES, and X86FLAVOR
# - Code cleanups and fixes to the indentation
# - Bug fixes to some ARM related code
# - Added the dumpmacho command to memory dump the mach-o header to a file
#
# TODO:
#
# OPTIONS MOVED TO MAIN GDBINIT
# __________________color functions_________________
#
@@ -1216,7 +1126,7 @@ define reg
set $oldlr = $lr
end
else
if (sizeof(void *) == 8)
if ($64BITS == 1)
regx64
else
regx86
@@ -1224,13 +1134,13 @@ define reg
# call smallregisters
smallregisters
# display conditional jump routine
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "\t\t\t\t"
end
dumpjump
printf "\n"
if ($SHOWREGCHANGES == 1)
if (sizeof(void *) == 8)
if ($64BITS == 1)
set $oldrax = $rax
set $oldrbx = $rbx
set $oldrcx = $rcx
@@ -1267,7 +1177,7 @@ end
define smallregisters
if (sizeof(void *) == 8)
if ($64BITS == 1)
#64bits stuff
# from rax
set $eax = $rax & 0xffffffff
@@ -1456,20 +1366,6 @@ Syntax: hex_quad ADDR
| Print eight hexadecimal bytes starting at address ADDR.
end
define hex_quad32
if $argc != 1
help hex_quad
else
printf "%02X %02X %02X %02X", \
*(unsigned char*)($arg0), *(unsigned char*)($arg0 + 1), \
*(unsigned char*)($arg0 + 2), *(unsigned char*)($arg0 + 3)
end
end
document hex_quad32
Syntax: hex_quad ADDR
| Print four hexadecimal bytes starting at address ADDR.
end
define hexdump
if $argc == 1
@@ -1499,37 +1395,12 @@ define hexdump_aux
help hexdump_aux
else
color_bold
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "0x%016lX : ", $arg0
else
printf "0x%08X : ", $arg0
end
color_reset
if $STACK_WORDSIZE == 1
if (sizeof(void *) == 8)
hex_quad $arg0
printf " "
color_bold
ascii_char $arg0+0x0
ascii_char $arg0+0x1
ascii_char $arg0+0x2
ascii_char $arg0+0x3
ascii_char $arg0+0x4
ascii_char $arg0+0x5
ascii_char $arg0+0x6
ascii_char $arg0+0x7
color_reset
else
hex_quad32 $arg0
printf " "
color_bold
ascii_char $arg0+0x0
ascii_char $arg0+0x1
ascii_char $arg0+0x2
ascii_char $arg0+0x3
color_reset
end
else
hex_quad $arg0
color_bold
printf " - "
@@ -1554,7 +1425,6 @@ define hexdump_aux
ascii_char $arg0+0xE
ascii_char $arg0+0xF
color_reset
end
printf "\n"
end
end
@@ -1570,7 +1440,7 @@ define ddump
help ddump
else
color $COLOR_SEPARATOR
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "[0x%04X:0x%016lX]", $ds, $data_addr
else
printf "[0x%04X:0x%08X]", $ds, $data_addr
@@ -1578,7 +1448,7 @@ define ddump
color $COLOR_SEPARATOR
printf "------------------------"
printf "-------------------------------"
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "-------------------------------------"
end
color_bold
@@ -1630,7 +1500,7 @@ define datawin
end
################################# X86
else
if (sizeof(void *) == 8)
if ($64BITS == 1)
if ((($rsi >> 0x18) == 0x40) || (($rsi >> 0x18) == 0x08) || (($rsi >> 0x18) == 0xBF))
set $data_addr = $rsi
else
@@ -2094,7 +1964,7 @@ define context
if $SHOWCPUREGISTERS == 1
printf "----------------------------------------"
printf "----------------------------------"
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "---------------------------------------------"
end
color $COLOR_SEPARATOR
@@ -2106,7 +1976,7 @@ define context
end
if $SHOWSTACK == 1
color $COLOR_SEPARATOR
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "[0x%04X:0x%016lX]", $ss, $rsp
else
printf "[0x%04X:0x%08X]", $ss, $esp
@@ -2114,7 +1984,7 @@ define context
color $COLOR_SEPARATOR
printf "-------------------------"
printf "-----------------------------"
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "-------------------------------------"
end
color $COLOR_SEPARATOR
@@ -2123,15 +1993,7 @@ define context
color_reset
set $context_i = $CONTEXTSIZE_STACK
while ($context_i > 0)
if $STACK_WORDSIZE == 1
if (sizeof(void *) == 8)
set $context_t = $sp + 0x8 * ($context_i - 1)
else
set $context_t = $sp + 0x4 * ($context_i - 1)
end
else
set $context_t = $sp + 0x10 * ($context_i - 1)
end
hexdump $context_t
set $context_i--
end
@@ -2166,7 +2028,7 @@ define context
if $displayobjectivec == 1
color $COLOR_SEPARATOR
printf "--------------------------------------------------------------------"
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "---------------------------------------------"
end
color $COLOR_SEPARATOR
@@ -2181,7 +2043,7 @@ define context
if $displayobjectivec == 1
color $COLOR_SEPARATOR
printf "--------------------------------------------------------------------"
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "---------------------------------------------"
end
color $COLOR_SEPARATOR
@@ -2201,7 +2063,7 @@ define context
color $COLOR_SEPARATOR
printf "--------------------------------------------------------------------------"
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "---------------------------------------------"
end
color $COLOR_SEPARATOR
@@ -2212,10 +2074,18 @@ define context
if ($context_i > 0)
if ($SETCOLOUR1STLINE == 1)
color $GREEN
x /i $pc
if ($ARM == 1)
x/i $pc | $cpsr.t
else
x/i $pc
end
color_reset
else
x /i $pc
if ($ARM == 1)
x/i $pc | $cpsr.t
else
x/i $pc
end
end
set $context_i--
end
@@ -2226,7 +2096,7 @@ define context
color $COLOR_SEPARATOR
printf "----------------------------------------"
printf "----------------------------------------"
if (sizeof(void *) == 8)
if ($64BITS == 1)
printf "---------------------------------------------\n"
else
printf "\n"
@@ -2466,7 +2336,7 @@ define stepoframework
set $_nextaddress = $pc + 0x3
end
# call *0x????????(%ebx) (0xFF93????????) ||
if ($_byte2 == 0x93 || $_byte2 == 0x94 || $_byte2 == 0x90 || $_byte2 == 0x92 || $_byte2 == 0x95)
if ($_byte2 == 0x93 || $_byte2 == 0x94 || $_byte2 == 0x90 || $_byte2 == 0x92 || $_byte2 == 0x95 || $_byte2 == 0x15)
set $_nextaddress = $pc + 6
end
# call *0x????????(%ebx,%eax,4) (0xFF94??????????)
@@ -2829,7 +2699,7 @@ define rint3
set $pc = $ORIGINAL_INT3ADDRESS
else
set *(unsigned char *)$ORIGINAL_INT3ADDRESS = $ORIGINAL_INT3
if sizeof(void *) == 8
if ($64BITS == 1)
set $rip = $ORIGINAL_INT3ADDRESS
else
set $eip = $ORIGINAL_INT3ADDRESS
@@ -2841,6 +2711,40 @@ Syntax: rint3
| Restore the original byte previous to int3 patch issued with "int3" command.
end
define patch
if $argc != 3
help patch
end
set $patchaddr = $arg0
set $patchbytes = $arg1
set $patchsize = $arg2
if ($patchsize == 1)
set *(unsigned char*)$patchaddr = $patchbytes
end
if ($patchsize == 2)
set $lendianbytes = (unsigned short)(($patchbytes << 8) | ($patchbytes >> 8))
set *(unsigned short*)$patchaddr = $lendianbytes
end
if ($patchsize == 4)
set $lendianbytes = (unsigned int)( (($patchbytes << 8) & 0xFF00FF00 ) | (($patchbytes >> 8) & 0xFF00FF ))
set $lendianbytes = (unsigned int)($lendianbytes << 0x10 | $lendianbytes >> 0x10)
set *(unsigned int*)$patchaddr = $lendianbytes
end
if ($patchsize == 8)
set $lendianbytes = (unsigned long long)( (($patchbytes << 8) & 0xFF00FF00FF00FF00ULL ) | (($patchbytes >> 8) & 0x00FF00FF00FF00FFULL ) )
set $lendianbytes = (unsigned long long)( (($lendianbytes << 0x10) & 0xFFFF0000FFFF0000ULL ) | (($lendianbytes >> 0x10) & 0x0000FFFF0000FFFFULL ) )
set $lendianbytes = (unsigned long long)( ($lendianbytes << 0x20) | ($lendianbytes >> 0x20) )
set *(unsigned long long*)$patchaddr = $lendianbytes
end
end
document patch
Syntax: patch address bytes size
| Patch a given address, converting the bytes to little-endian.
| Assumes input bytes are unsigned values and should be in hexadecimal format (0x...).
| Size must be 1, 2, 4, 8 bytes.
| Main purpose is to be used with the output from the asm commands.
end
# ____________________cflow___________________
define print_insn_type
@@ -3092,10 +2996,62 @@ Syntax: trace_run
| Log overwrites(!) the file ~/gdb_trace_run.txt.
end
define entry_point
set logging redirect on
set logging file /tmp/gdb-entry_point
set logging on
info files
set logging off
shell entry_point="$(/usr/bin/grep 'Entry point:' /tmp/gdb-entry_point | /usr/bin/awk '{ print $3 }')"; echo "$entry_point"; echo 'set $entry_point_address = '"$entry_point" > /tmp/gdb-entry_point
source /tmp/gdb-entry_point
shell /bin/rm -f /tmp/gdb-entry_point
end
document entry_point
Syntax: entry_point
| Prints the entry point address of the target and stores it in the variable entry_point.
end
define break_entrypoint
entry_point
break *$entry_point_address
end
document break_entrypoint
Syntax: break_entrypoint
| Sets a breakpoint on the entry point of the target.
end
define objc_symbols
set logging redirect on
set logging file /tmp/gdb-objc_symbols
set logging on
info target
set logging off
# XXX: define paths for objc-symbols and SymTabCreator
shell target="$(/usr/bin/head -1 /tmp/gdb-objc_symbols | /usr/bin/head -1 | /usr/bin/awk -F '"' '{ print $2 }')"; objc-symbols "$target" | SymTabCreator -o /tmp/gdb-symtab
set logging on
add-symbol-file /tmp/gdb-symtab
set logging off
shell /bin/rm -f /tmp/gdb-objc_symbols
end
document objc_symbols
Syntax: objc_symbols
| Loads stripped objc symbols into gdb using objc-symbols and SymTabCreator
| See http://stackoverflow.com/questions/17554070/import-class-dump-info-into-gdb
| and https://github.com/0xced/class-dump/tree/objc-symbols (for the required utils)
end
#define ptraceme
# catch syscall ptrace
# commands
# if (sizeof(void *) == 4)
# if ($64BITS == 0)
# if ($ebx == 0)
# set $eax = 0
# continue
@@ -3128,12 +3084,26 @@ end
# ____________________misc____________________
define hook-stop
# Display instructions formats
if (sizeof(void*) == 8)
set $64BITS = 1
else
set $64BITS = 0
end
if ($KDP64BITS != -1)
if ($KDP64BITS == 0)
set $64BITS = 0
else
set $64BITS = 1
end
end
# Display instructions formats
if $ARM == 1
if $ARMOPCODES == 1
set arm show-opcode-bytes 1
else
set arm show-opcode-bytes 1
set arm show-opcode-bytes 0
end
else
if $X86FLAVOR == 0
@@ -3184,7 +3154,7 @@ define assemble
printf "End with a line saying just \"end\".\n"
if ($argc)
if (sizeof(void *) == 8)
if ($64BITS == 1)
# argument specified, assemble instructions into memory at address specified.
shell ASMOPCODE="$(while read -ep '>' r && test "$r" != end ; do echo -E "$r"; done)" ; GDBASMFILENAME=$RANDOM; \
echo -e "BITS 64\n$ASMOPCODE" >/tmp/$GDBASMFILENAME ; /usr/local/bin/nasm -f bin -o /dev/stdout /tmp/$GDBASMFILENAME | /usr/bin/hexdump -ve '1/1 "set *((unsigned char *) $arg0 + %#2_ax) = %#02x\n"' >/tmp/gdbassemble ; /bin/rm -f /tmp/$GDBASMFILENAME
@@ -3200,7 +3170,7 @@ define assemble
shell /bin/rm -f /tmp/gdbassemble
end
else
if (sizeof(void *) == 8)
if ($64BITS == 1)
# no argument, assemble instructions to stdout
shell ASMOPCODE="$(while read -ep '>' r && test "$r" != end ; do echo -E "$r"; done)" ; GDBASMFILENAME=$RANDOM; \
echo -e "BITS 64\n$ASMOPCODE" >/tmp/$GDBASMFILENAME ; /usr/local/bin/nasm -f bin -o /dev/stdout /tmp/$GDBASMFILENAME | /usr/local/bin/ndisasm -i -b64 /dev/stdin ; \
@@ -3650,6 +3620,14 @@ Syntax: arm
| Set gdb to work with ARM binaries.
end
define ioskdp
set $SHOW_CONTEXT = 0
set $SHOW_NEST_INSN = 0
end
document ioskdp
Syntax: ioskdp
| Disable dumping context information for iOS KDP debugging
end
define intelsyntax
if $ARM == 0
@@ -3724,6 +3702,210 @@ Syntax: kernel64 PATH_TO_KGMACROS <PORT>
| By supplying a bogus kgmacros this command should be compatible with any OS.
end
define 32bits
set $KDP64BITS = 0
set $64BITS = 0
end
define 64bits
set $KDP64BITS = 1
set $64BITS = 1
end
define resetkdp
set $KDP64BITS = -1
end
define header
if $argc != 0
dump memory /tmp/gdbinit_header_dump $arg0 $arg0 + 4096
shell /usr/bin/otool -h /tmp/gdbinit_header_dump
shell /bin/rm -f /tmp/gdbinit_header_dump
end
end
document header
Syntax: header MACHO_HEADER_START_ADDRESS
| Dump the Mach-O header located at given address
end
define loadcmds
if $argc != 0
# this size should be good enough for most binaries
dump memory /tmp/gdbinit_header_dump $arg0 $arg0 + 4096 * 10
shell /usr/bin/otool -l /tmp/gdbinit_header_dump
shell /bin/rm -f /tmp/gdbinit_header_dump
end
end
document loadcmds
Syntax: loadcmds MACHO_HEADER_START_ADDRESS
| Dump the Mach-O load commands
end
#EOF
# Older change logs:
#
# Version 7.4.4 (02/01/2012)
# - Added the "skip" command. This will jump to the next instruction after EIP/RIP without executing the current one.
# Thanks to @bSr43 for the tip to retrieve the current instruction size.
#
# Version 7.4.3 (04/11/2011)
# - Modified "hexdump" command to support a variable number of lines (optional parameter)
# - Removed restrictions on type of addresses in the "dd" command - Thanks to Plouj for the warning :-)
# I don't know what was the original thinking behind those :-)
# - Modified the assemble command to support 64bits - You will need to recompile nasm since the version shipped with OS X doesn't supports 64bits (www.nasm.us).
# Assumes that the new binary is installed at /usr/local/bin - modify the variable at the top if you need so.
# It will assemble based on the target arch being debugged. If you want to use gdb for a quick asm just use the 32bits or 64bits commands to set your target.
# Thanks to snare for the warning and original patch :-)
# - Added "asm" command - it's a shortcut to the "assemble" command.
# - Added configuration variable for colorized prompt. Plouj reported some issues with Ubuntu's gdb 7.2 if prompt is colorized.
#
# Version 7.4.2 (11/08/2011)
# Small fix to a weird bug happening on FreeBSD 8.2. It doesn't like a "if(" instruction, needs to be "if (". Weird!
# Many thanks to Evan for reporting and sending the patch :-)
# Added the ptraceme/rptraceme commands to bypass PTRACE_TRACME anti-debugging technique.
# Grabbed this from http://falken.tuxfamily.org/?p=171
# It's commented out due to a gdb problem in OS X (refer to http://reverse.put.as/2011/08/20/another-patch-for-apples-gdb-the-definecommands-problem/ )
# Just uncomment it if you want to use in ptrace enabled systems.
#
# Version 7.4.1 (21/06/2011) - fG!
# Added patch sent by sbz, more than 1 year ago, which I forgot to add :-/
# This will allow to search for a given pattern between start and end address.
# On sbz words: "It's usefull to find call, ret or everything like that." :-)
# New command is "search"
#
# Version 7.4 (20/06/2011) - fG!
# When registers change between instructions the colour will change to red (like it happens in OllyDBG)
# This is the default behavior, if you don't like it, modify the variable SHOWREGCHANGES
# Added patch sent by Philippe Langlois
# Colour the first disassembly line - change the setting below on SETCOLOUR1STLINE - by default it's disabled
#
# Version 7.3.2 (21/02/2011) - fG!
# Added the command rint3 and modified the int3 command. The new command will restore the byte in previous int3 patch.
#
# Version 7.3.1 (29/06/2010) - fG!
# Added enablelib/disablelib command to quickly set the stop-on-solib-events trick
# Implemented the stepoh command equivalent to the stepo but using hardware breakpoints
# More fixes to stepo
#
# Version 7.3 (16/04/2010) - fG!
# Support for 64bits targets. Default is 32bits, you should modify the variable or use the 32bits or 64bits to choose the mode.
# I couldn't find another way to recognize the type of binary… Testing the register doesn't work that well.
# TODO: fix objectivec messages and stepo for 64bits
# Version 7.2.1 (24/11/2009) - fG!
# Another fix to stepo (0xFF92 missing)
#
# Version 7.2 (11/10/2009) - fG!
# Added the smallregisters function to create 16 and 8 bit versions from the registers EAX, EBX, ECX, EDX
# Revised and fixed all the dumpjump stuff, following Intel manuals. There were some errors (thx to rev who pointed the jle problem).
# Small fix to stepo command (missed a few call types)
#
# Version 7.1.7 - fG!
# Added the possibility to modify what's displayed with the context window. You can change default options at the gdb options part. For example, kernel debugging is much slower if the stack display is enabled...
# New commands enableobjectivec, enablecpuregisters, enablestack, enabledatawin and their disable equivalents (to support realtime change of default options)
# Fixed problem with the assemble command. I was calling /bin/echo which doesn't support the -e option ! DUH ! Should have used bash internal version.
# Small fixes to colours...
# New commands enablesolib and disablesolib . Just shortcuts for the stop-on-solib-events fantastic trick ! Hey... I'm lazy ;)
# Fixed this: Possible removal of "u" command, info udot is missing in gdb 6.8-debian . Doesn't exist on OS X so bye bye !!!
# Displays affected flags in jump decisions
#
# Version 7.1.6 - fG!
# Added modified assemble command from Tavis Ormandy (further modified to work with Mac OS X) (shell commands used use full path name, working for Leopard, modify for others if necessary)
# Renamed thread command to threads because thread is an internal gdb command that allows to move between program threads
#
# Version 7.1.5 (04/01/2009) - fG!
# Fixed crash on Leopard ! There was a If Else condition where the else had no code and that made gdb crash on Leopard (CRAZY!!!!)
# Better code indention
#
# Version 7.1.4 (02/01/2009) - fG!
# Bug in show objective c messages with Leopard ???
# Nop routine support for single address or range (contribution from gln [ghalen at hack.se])
# Used the same code from nop to null routine
#
# Version 7.1.3 (31/12/2008) - fG!
# Added a new command 'stepo'. This command will step a temporary breakpoint on next instruction after the call, so you can skip over
# the call. Did this because normal commands not always skip over (mainly with objc_msgSend)
#
# Version 7.1.2 (31/12/2008) - fG!
# Support for the jump decision (will display if a conditional jump will be taken or not)
#
# Version 7.1.1 (29/12/2008) - fG!
# Moved gdb options to the beginning (makes more sense)
# Added support to dump message being sent to msgSend (easier to understand what's going on)
#
# Version 7.1
# Fixed serious (and old) bug in dd and datawin, causing dereference of
# obviously invalid address. See below:
# gdb$ dd 0xffffffff
# FFFFFFFF : Cannot access memory at address 0xffffffff
#
# Version 7.0
# Added cls command.
# Improved documentation of many commands.
# Removed bp_alloc, was neither portable nor usefull.
# Checking of passed argument(s) in these commands:
# contextsize-stack, contextsize-data, contextsize-code
# bp, bpc, bpe, bpd, bpt, bpm, bhb,...
# Fixed bp and bhb inconsistencies, look at * signs in Version 6.2
# Bugfix in bhb command, changed "break" to "hb" command body
# Removed $SHOW_CONTEXT=1 from several commands, this variable
# should only be controlled globally with context-on and context-off
# Improved stack, func, var and sig, dis, n, go,...
# they take optional argument(s) now
# Fixed wrong $SHOW_CONTEXT assignment in context-off
# Fixed serious bug in cft command, forgotten ~ sign
# Fixed these bugs in step_to_call:
# 1) the correct logging sequence is:
# set logging file > set logging redirect > set logging on
# 2) $SHOW_CONTEXT is now correctly restored from $_saved_ctx
# Fixed these bugs in trace_calls:
# 1) the correct logging sequence is:
# set logging file > set logging overwrite >
# set logging redirect > set logging on
# 2) removed the "clean up trace file" part, which is not needed now,
# stepi output is properly redirected to /dev/null
# 3) $SHOW_CONTEXT is now correctly restored from $_saved_ctx
# Fixed bug in trace_run:
# 1) $SHOW_CONTEXT is now correctly restored from $_saved_ctx
# Fixed print_insn_type -- removed invalid semicolons!, wrong value checking,
# Added TODO entry regarding the "u" command
# Changed name from gas_assemble to assemble_gas due to consistency
# Output from assemble and assemble_gas is now similar, because i made
# both of them to use objdump, with respect to output format (AT&T|Intel).
# Whole code was checked and made more consistent, readable/maintainable.
#
# Version 6.2
# Add global variables to allow user to control stack, data and code window sizes
# Increase readability for registers
# Some corrections (hexdump, ddump, context, cfp, assemble, gas_asm, tips, prompt)
#
# Version 6.1-color-user
# Took the Gentoo route and ran sed s/user/user/g
#
# Version 6.1-color
# Added color fixes from
# http://gnurbs.blogsome.com/2006/12/22/colorizing-mamons-gdbinit/
#
# Version 6.1
# Fixed filename in step_to_call so it points to /dev/null
# Changed location of logfiles from /tmp to ~
#
# Version 6
# Added print_insn_type, get_insn_type, context-on, context-off commands
# Added trace_calls, trace_run, step_to_call commands
# Changed hook-stop so it checks $SHOW_CONTEXT variable
#
# Version 5
# Added bpm, dump_bin, dump_hex, bp_alloc commands
# Added 'assemble' by elaine, 'gas_asm' by mong
# Added Tip Topics for aspiring users ;)
#
# Version 4
# Added eflags-changing insns by pusillus
# Added bp, nop, null, and int3 patch commands, also hook-stop
#
# Version 3
# Incorporated elaine's if/else goodness into the hex/ascii dump
#
# Version 2
# Radix bugfix by elaine

View File

51
dotfiles/tmux.conf Normal file
View File

@@ -0,0 +1,51 @@
# Update environment on reconnect
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION"
# Custom binds
bind K confirm kill-server
bind X confirm kill-window
bind ^[ copy-mode
bind R source-file ~/.tmux.conf \; display-message " Config reloaded.."
# Scrollback
set -g history-limit 10000
# Start indexing from 1
set -g base-index 1
set -g pane-base-index 1
# Let us use utf-8 drawing characters to make tab-like window formats
setw -g utf8 on
set -g status-utf8 on
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#h:#S:#I.#P #W'
# Set a 256color $TERM variable so programs inside tmux know they can use 256
# colors
set -g default-terminal screen-256color
# Mouse
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on
# Activity
setw -g monitor-activity on
set -g visual-activity on
# Autorename new tabs automatically
setw -g automatic-rename on
# Color scheme
source-file ~/.tmux/tmux-solarized-256.conf
# Provide a statusbar
set -g window-status-current-bg colour33
set -g window-status-current-fg colour235
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '/#S/ '
set -g status-right '#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=colour166]%H:%M#[default]'

View File

@@ -0,0 +1,31 @@
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green

View File

@@ -0,0 +1,7 @@
nnoremap <F8> :%!autopep8 -<CR>
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=80
setlocal smarttab
setlocal expandtab

137
dotfiles/vimrc Normal file
View File

@@ -0,0 +1,137 @@
" Allow full use of vim options
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 'eistaa/vim-flake8'
Plugin 'tpope/vim-fugitive'
Plugin 'mileszs/ack.vim'
Plugin 'tpope/vim-unimpaired'
Plugin 'scrooloose/syntastic'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
Plugin 'fatih/vim-go'
Plugin 'altercation/vim-colors-solarized'
call vundle#end()
endif
" Setup paths
set backupdir=~/.cache/vim/backup//
set directory=~/.cache/vim/swap//
set undodir=~/.cache/vim/undo//
if !isdirectory($HOME . '/.cache/vim/swap')
silent !mkdir -p ~/.cache/vim/{backup,swap,undo}
endif
" Make sure files get completely written, but don't write backups
set nobackup
set writebackup
" Whitespace/indent options
set autoindent
set copyindent
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set shiftround
set backspace=indent,eol,start
" Shift-tab to go backwards in insert mode
imap <S-Tab> <Esc><<A
" Line numbering, ruler
set number
set ruler
set cursorline
" File options
set encoding=utf-8
" Syntax highlighting, look and feel
syntax on
set background=dark
if has('gui_running')
set guifont=Inconsolata\ 11
else
let g:solarized_termcolors=256
endif
colorscheme solarized
" Enable filetype support
filetype plugin indent on
" Allow file modelines
set modeline
" Automatically re-read changed files
set autoread
" fsync() after writing files
set fsync
" Text width 80
set textwidth=80
" Write via sudo
cnoremap sudow w !sudo tee % >/dev/null
" Search options
set incsearch
set ignorecase
set smartcase
" Optional highlighting
nmap <leader>hs :set hlsearch! hlsearch?<CR>
" Toggle paste mode
nmap <silent> <F4> :set invpaste<CR>:set paste?<CR>
imap <silent> <F4> <ESC>:set invpaste<CR>:set paste?<CR>
" Mediocre Hex editing in vim
" Source: http://vim.wikia.com/wiki/Improved_hex_editing
" TODO: move to an include
nnoremap <C-H> :Hexmode<CR>
command -bar Hexmode call ToggleHex()
function ToggleHex()
" hex mode should be considered a read-only operation
" save values for modified and read-only for restoration later,
" and clear the read-only flag for now
let l:modified=&mod
let l:oldreadonly=&readonly
let &readonly=0
let l:oldmodifiable=&modifiable
let &modifiable=1
if !exists("b:editHex") || !b:editHex
" save old options
let b:oldft=&ft
let b:oldbin=&bin
" set new options
setlocal binary " make sure it overrides any textwidth, etc.
let &ft="xxd"
" set status
let b:editHex=1
" switch to hex editor
%!xxd
else
" restore old options
let &ft=b:oldft
if !b:oldbin
setlocal nobinary
endif
" set status
let b:editHex=0
" return to normal editing
%!xxd -r
endif
" restore values for modified and read only state
let &mod=l:modified
let &readonly=l:oldreadonly
let &modifiable=l:oldmodifiable
endfunction
" Options for syntastic
let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list = 2
" Have F5 run the tests and display errors
nnoremap <silent> <F5> :SyntasticCheck<CR> :Errors<CR>
" Include a .vimrc.local if it exists
if filereadable(glob("~/.vimrc.local"))
source ~/.vimrc.local
endif

17
dotfiles/wgetrc Normal file
View File

@@ -0,0 +1,17 @@
# Use server timestamps and name
timestamping = on
trust_server_names = on
# Recursive download options
no_parent = on
follow_ftp = on
adjust_extension = on
robots = off
# Show responses
server_response = on
# Retry handling
tries = 3
timeout = 60
retry_connrefused = on

1
dotfiles/xprofile Normal file
View File

@@ -0,0 +1 @@
setxkbmap -option ctrl:nocaps

View File

@@ -0,0 +1,161 @@
#compdef virsh
# Copyright (c) 2015, Jan-Philipp Litza <janphilipp@litza.de>
# 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 <organization> 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 <COPYRIGHT HOLDER> 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.
local -a args reply
function _virsh_domains() {
local -a out
local description="${(P)#}"
shift -p
local domaintype="${description/running/}"
out=( ${(f)"$(_call_program commands virsh list --name ${domaintype:+--$domaintype} 2>&1)"} )
if (( $#out == 0 )); then
_message "No $description domains"
else
_describe "$description domains" out "$@"
fi
return $?
}
_virsh() {
_arguments \
{-c,--connect}':hypervisor connection URI:_files' \
{-d,--debug}':debug level:( 0 1 2 3 4 )' \
{-e,--escape}':escape character for console:' \
{-h,--help}'[show help]' \
{-k,--keepalive-interval}':keepalive interval in seconds, 0 for disable:' \
{-K,--keepalive-count}':number of possible missed keepalive messages:' \
{-l,--log}'[output logging to file]:logfile:_files' \
{-q,--quiet}'[quiet mode]' \
{-r,--readonly}'[connect readonly]' \
{-t,--timing}'[print timing information]' \
'-v:show version' \
'-V:long version' \
'--version[show version]:type:( short long )' \
'::virsh command:_virsh_subcommand' \
'*::virsh command arguments:_virsh_subcommand_args'
}
_virsh_domain_or_file() {
_alternative \
"domains:domains:_virsh_domains ${1:-all}" \
"files:files:_files"
}
_virsh_fallback_command() {
domains() {
echo "$1 domains:_virsh_domains $1"
}
local files="file:_files"
local -A cmd_args
cmd_args=(
attach-device "$files"
autostart "$(domains all)"
cd "dirs:_dirs"
console "$(domains running)"
cpu-baseline "$files"
cpu-compare "$files"
create "$files"
start "$(domains inactive)"
destroy "$(domains running)"
detach-device "$(domains all)"
define "$files"
domid "$(domains all)"
domuuid "$(domains all)"
dominfo "$(domains all)"
domjobinfo "$(domains all)"
domjobabort "$(domains all)"
domname "$(domains all)"
domstate "$(domains all)"
dommemstat "$(domains all)"
dumpxml "$(domains all)"
edit "$(domains all)"
list "$(domains all)"
net-create "$files"
net-define "$files"
managedsave "$(domains running)"
managedsave-remove "$(domains all)"
nwfilter-define "$files"
pool-create "$files"
pool-define "$files"
secret-define "$files"
reboot "$(domains running)"
reset "$(domains running)"
restore "$files"
resume "$(domains running)"
send-key "$(domains running)"
setmem "$(domains all)"
setmaxmem "$(domains all)"
setvcpus "$(domains all)"
shutdown "$(domains running)"
suspend "$(domains running)"
ttyconsole "$(domains running)"
undefine "$(domains inactive)"
vcpuinfo "$(domains running)"
vncdisplay "$(domains running)"
snapshot-current "$(domains all)"
snapshot-list "$(domains all)"
)
local cmd="$1"
local -a options
options=(
${${(M)${(f)"$(_call_program commands virsh help $cmd 2>&1)"}:# -*}/#(#b) ([a-z-]##) ##([^[:space:]]*)/$match[1]:$match[2]}
)
if (( $+cmd_args[$cmd] )); then
options+=( ":$cmd_args[$cmd]" )
else
options+=( ":$(domains all)" ":$files" )
fi
_arguments "$options[@]"
}
_virsh_build_cmds() {
(( $+_virsh_cmds )) || _virsh_cmds=(
${${(M)${(f)"$(_call_program commands virsh help 2>&1)"}:# *}/#(#b) ([a-z-]##) ##([^[:space:]])/$match[1]:$match[2]}
)
}
_virsh_subcommand() {
_virsh_build_cmds
_describe 'virsh command' _virsh_cmds
}
_virsh_subcommand_args() {
_virsh_build_cmds
local curcontext="$curcontext"
cmd="${${_virsh_cmds[(r)$words[1]:*]%%:*}:-${(k)_virsh_syns[(r)(*:|)$words[1](:*|)]}}"
if (( $#cmd )); then
curcontext="${curcontext%:*:*}:virsh-${cmd}:"
_virsh_fallback_command "$cmd"
else
_message "unknown virsh command; $words[1]"
fi
}
_virsh "$@"

View File

@@ -0,0 +1,3 @@
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]%}$(git_prompt_info)%{$fg[white]%}%#%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX=" ("
ZSH_THEME_GIT_PROMPT_SUFFIX=")"

51
dotfiles/zshrc Normal file
View File

@@ -0,0 +1,51 @@
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd autopushd extendedglob nohup nomatch histignorespace
unsetopt beep
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/david/.zshrc'
autoload -Uz compinit && compinit
# End of lines added by compinstall
DIRSTACKSIZE=16
case $TERM in
xterm*)
precmd () {print -Pn "\e]0;%n@%m: %~\a"}
;;
esac
autoload -U colors && colors
PS1="%{%(!.$fg[red].$fg[green])%}%n%{$fg[white]%}@%{$fg[cyan]%}%m%{$fg[white]%}:%{$fg[green]%}%32<...<%~%<<%{$fg[white]%}%#%{$reset_color%} "
. ~/.profile
# Deduplicate the path
typeset -U path
alias ls='ls --color'
# Load oh-my-zsh
if [ -d $HOME/.oh-my-zsh ] ; then
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="matir"
ZSH_CUSTOM="$HOME/.zsh_custom"
plugins=(git encode64 gpg-agent pep8 pip python tmux urltools extract sudo virsh virtualenv)
source $ZSH/oh-my-zsh.sh
unset ZSH_THEME
fi
# Keybindings
bindkey '^[[A' history-search-backward
bindkey '^[[B' history-search-forward
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
# Source extras
for file in $HOME/.zshrc.d/* ; do source "$file" ; done
# Load any local settings
if [ -e $HOME/.zshrc.local ] ; then source $HOME/.zshrc.local ; fi

View File

@@ -0,0 +1,6 @@
remove-wine-associations() {
rm ~/.local/share/applications/wine*.desktop
update-desktop-database ~/.local/share/applications
rm ~/.local/share/mime/packages/x-wine*.xml
update-mime-database ~/.local/share/mime
}

View File

@@ -0,0 +1,17 @@
# SSH autocompletion
# ssh, scp, ping, host
# https://github.com/tehmaze/maze.io/blob/master/maze/_post/2008/08-03-remote-tabcompletion-using-openssh-and-zsh.md
zstyle ':completion:*:scp:*' tag-order 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:scp:*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns '*.*' loopback localhost
zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^*.*' '*@*'
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 -e ':completion:*:(ssh|scp):*' hosts 'reply=(
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
/dev/null)"}%%[# ]*}//,/ }
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
)'

View File

@@ -1,5 +0,0 @@
[user]
name = David Tomaschik
email = david@systemoverlord.com
[push]
default = simple

View File

@@ -1,5 +0,0 @@
use-agent
keyserver pool.sks-keyservers.net
personal-digest-preferences SHA256
cert-digest-algo SHA256
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed

View File

@@ -3,17 +3,43 @@
set nounset
set errexit
BASEDIR=${BASEDIR:-$HOME/.dotfiles}
BASEDIR=${BASEDIR:-$HOME/.skel}
if [ ! -d $BASEDIR ] ; then
echo "Please install to $BASEDIR!" &>2
echo "Please install to $BASEDIR!" 1>&2
exit 1
fi
function install_dir {
function prerequisites {
# Prerequisites require git
if ! which git > /dev/null ; then
echo 'No git, not installing extras.' 1>&2
return
fi
if which zsh > /dev/null ; then
if [ `getent passwd $USER | cut -d: -f7` != `which zsh` ] ; then
echo 'Enter password to change shell.' 1>&2
chsh -s `which zsh`
fi
if [ ! -d $HOME/.oh-my-zsh ] ; then
git clone https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
fi
else
echo "ZSH not found!" > /dev/stderr
fi
if which vim > /dev/null ; then
mkdir -p $HOME/.vim/bundle
if [ ! -d $HOME/.vim/bundle/Vundle.vim ] ; then
git clone https://github.com/VundleVim/Vundle.vim.git \
$HOME/.vim/bundle/Vundle.vim
fi
fi
}
function install_dotfile_dir {
SRCDIR="${1}"
find ${SRCDIR} \( -name .git -o \
-path ${SRCDIR}/private_dotfiles -o \
find "${SRCDIR}" \( -name .git -o \
-path "${SRCDIR}/private_dotfiles" -o \
-name install.sh -o \
-name .gitignore \) \
-prune -o -type f -print | \
@@ -24,5 +50,27 @@ function install_dir {
done
}
install_dir "${BASEDIR}"
test -d "${BASEDIR}/private_dotfiles" && install_dir "${BASEDIR}/private_dotfiles"
function install_basic_dir {
SRCDIR="${1}"
DESTDIR="${2}"
find "${SRCDIR}" -type f -print | \
while read file ; do
TARGET="${2}/.${file#${SRCDIR}/}"
mkdir -p `dirname "${TARGET}"`
ln -s -f "${file}" "${TARGET}"
done
}
function postinstall {
# Install Vundle plugins
if [ -d $HOME/.vim/bundle/Vundle.vim ] ; then
vim +VundleInstall +qall
fi
}
prerequisites
install_dotfile_dir "${BASEDIR}/.dotfiles"
test -d "${BASEDIR}/private_dotfiles" && \
install_dotfile_dir "${BASEDIR}/private_dotfiles"
install_basic_dir "${BASEDIR}/bin" "${HOME}/bin"
postinstall

28
vimrc
View File

@@ -1,28 +0,0 @@
" Allow full use of vim options
set nocompatible
" Autoindentation
set autoindent
" Use same indentation style as above file
set copyindent
" Proper tabs
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Display cursor position
set ruler
" Syntax highlighting and file types
syntax on
filetype plugin indent on
" Allow file modelines
set modeline
" Automatically re-read changed files
set autoread
" fsync() after writing files
set fsync
" Line numbering
set number
" Round indentation to multiple of shiftwidth
set shiftround
" Text width 80
set textwidth=80

29
zshrc
View File

@@ -1,29 +0,0 @@
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd extendedglob nomatch
unsetopt beep
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/david/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
setopt nohup autopushd
DIRSTACKSIZE=16
case $TERM in
xterm*)
precmd () {print -Pn "\e]0;%n@%m: %~\a"}
;;
esac
PS1='%n@%m:%32<...<%~%<<%# '
. ~/.profile
typeset -U path
alias ls='ls --color'