Refactor to include non-dotfile files.

This commit is contained in:
David Tomaschik
2015-09-03 18:02:48 -07:00
parent 562697a2a7
commit 5577ee29b4
49 changed files with 17 additions and 4 deletions

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 &"

47
dotfiles/bashrc Normal file
View File

@@ -0,0 +1,47 @@
# History settings
HISTCONTROL=ignoredups:ignorespace
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=0
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Fancier outputs
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
fi
# Bash completion
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi

View File

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

View File

@@ -0,0 +1,6 @@
enable-ssh-support
use-standard-socket
default-cache-ttl 7200
default-cache-ttl-ssh 7200
max-cache-ttl 86400
max-cache-ttl-ssh 86400

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-----

396
dotfiles/irssi/config Normal file
View File

@@ -0,0 +1,396 @@
servers = (
{
address = "ircs.overthewire.org";
chatnet = "overthewire";
port = "6697";
use_ssl = "yes";
ssl_verify = "no";
autoconnect = "yes";
},
{
address = "irc.secfo.org";
chatnet = "secfo";
port = "7000";
use_ssl = "yes";
ssl_verify = "no";
autoconnect = "yes";
},
{
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";
}
);
chatnets = {
OFTC = {
type = "IRC";
max_kicks = "1";
max_msgs = "3";
max_whois = "30";
};
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 = (
{ name = "#kali-linux"; chatnet = "freenode"; autojoin = "yes"; },
{ 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 = "#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 = {
J = "join";
WJOIN = "join -window";
WQUERY = "query -window";
LEAVE = "part";
BYE = "quit";
EXIT = "quit";
SIGNOFF = "quit";
DESCRIBE = "action";
DATE = "time";
HOST = "userhost";
LAST = "lastlog";
SAY = "msg *";
WI = "whois";
WII = "whois $0 $0";
WW = "whowas";
W = "who";
N = "names";
M = "msg";
T = "topic";
C = "clear";
CL = "clear";
K = "kick";
KB = "kickban";
KN = "knockout";
BANS = "ban";
B = "ban";
MUB = "unban *";
UB = "unban";
IG = "ignore";
UNIG = "unignore";
SB = "scrollback";
UMODE = "mode $N";
WC = "window close";
WN = "window new hide";
SV = "say Irssi $J ($V) - http://irssi.org/";
GOTO = "sb goto";
CHAT = "dcc chat";
RUN = "SCRIPT LOAD";
CALC = "exec - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
SBAR = "STATUSBAR";
INVITELIST = "mode $C +I";
Q = "QUERY";
"MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save";
EXEMPTLIST = "mode $C +e";
ATAG = "WINDOW SERVER";
UNSET = "set -clear";
RESET = "set -default";
};
statusbar = {
# formats:
# when using {templates}, the template is shown only if it's argument isn't
# empty unless no argument is given. for example {sb} is printed always,
# but {sb $T} is printed only if $T isn't empty.
items = {
# start/end text in statusbars
barstart = "{sbstart}";
barend = "{sbend}";
topicbarstart = "{topicsbstart}";
topicbarend = "{topicsbend}";
# treated "normally", you could change the time/user name to whatever
time = "{sb $Z}";
user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
# treated specially .. window is printed with non-empty windows,
# window_empty is printed with empty windows
window = "{sb $winref:$tag/$itemname{sbmode $M}}";
window_empty = "{sb $winref{sbservertag $tag}}";
prompt = "{prompt $[.15]itemname}";
prompt_empty = "{prompt $winname}";
topic = " $topic";
topic_empty = " Irssi v$J - http://www.irssi.org";
# all of these treated specially, they're only displayed when needed
lag = "{sb Lag: $0-}";
act = "{sb Act: $0-}";
more = "-- more --";
};
# there's two type of statusbars. root statusbars are either at the top
# of the screen or at the bottom of the screen. window statusbars are at
# the top/bottom of each split window in screen.
default = {
# the "default statusbar" to be displayed at the bottom of the window.
# contains all the normal items.
window = {
disabled = "yes";
# window, root
type = "window";
# top, bottom
placement = "bottom";
# number
position = "1";
# active, inactive, always
visible = "active";
# list of items in statusbar in the display order
items = {
barstart = { priority = "100"; };
time = { };
user = { };
window = { };
window_empty = { };
lag = { priority = "-1"; };
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
};
# statusbar to use in inactive split windows
window_inact = {
type = "window";
placement = "bottom";
position = "1";
visible = "inactive";
items = {
barstart = { priority = "100"; };
window = { };
window_empty = { };
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
};
# we treat input line as yet another statusbar :) It's possible to
# add other items before or after the input line item.
prompt = {
type = "root";
placement = "bottom";
# we want to be at the bottom always
position = "100";
visible = "always";
items = {
prompt = { priority = "-1"; };
prompt_empty = { priority = "-1"; };
# treated specially, this is the real input line.
input = { priority = "10"; };
};
};
# topicbar
topic = {
type = "root";
placement = "top";
position = "1";
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 = {
core = {
real_name = "Matir";
user_name = "matir";
nick = "Matir";
log_timestamp = "%Y%m%d %H%M";
};
"fe-text" = { actlist_sort = "refnum"; };
"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";
};
};
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,294 @@
# When testing changes, the easiest way to reload the theme is with /RELOAD.
# This reloads the configuration file too, so if you did any changes remember
# to /SAVE it first. Remember also that /SAVE overwrites the theme file with
# old data so keep backups :)
# TEMPLATES:
# The real text formats that irssi uses are the ones you can find with
# /FORMAT command. Back in the old days all the colors and texts were mixed
# up in those formats, and it was really hard to change the colors since you
# might have had to change them in tens of different places. So, then came
# this templating system.
# Now the /FORMATs don't have any colors in them, and they also have very
# little other styling. Most of the stuff you need to change is in this
# theme file. If you can't change something here, you can always go back
# to change the /FORMATs directly, they're also saved in these .theme files.
# So .. the templates. They're those {blahblah} parts you see all over the
# /FORMATs and here. Their usage is simply {name parameter1 parameter2}.
# When irssi sees this kind of text, it goes to find "name" from abstracts
# block below and sets "parameter1" into $0 and "parameter2" into $1 (you
# can have more parameters of course). Templates can have subtemplates.
# Here's a small example:
# /FORMAT format hello {colorify {underline world}}
# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; }
# When irssi expands the templates in "format", the final string would be:
# hello %G%Uworld%U%n
# ie. underlined bright green "world" text.
# and why "$0-", why not "$0"? $0 would only mean the first parameter,
# $0- means all the parameters. With {underline hello world} you'd really
# want to underline both of the words, not just the hello (and world would
# actually be removed entirely).
# COLORS:
# You can find definitions for the color format codes in docs/formats.txt.
# There's one difference here though. %n format. Normally it means the
# default color of the terminal (white mostly), but here it means the
# "reset color back to the one it was in higher template". For example
# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would
# print yellow "foo" (as set with %Y) but "bar" would be green, which was
# set at the beginning before the {foo} template. If there wasn't the %g
# at start, the normal behaviour of %n would occur. If you _really_ want
# to use the terminal's default color, use %N.
#############################################################################
# default foreground color (%N) - -1 is the "default terminal color"
default_color = "-1";
# print timestamp/servertag at the end of line, not at beginning
info_eol = "false";
# these characters are automatically replaced with specified color
# (dark grey by default)
replaces = { "[]=" = "%K$*%n"; };
abstracts = {
##
## generic
##
# text to insert at the beginning of each non-message line
line_start = "%B-%n!%B-%n ";
# timestamp styling, nothing by default
timestamp = "$*";
# any kind of text that needs hilighting, default is to bold
hilight = "%_$*%_";
# any kind of error message, default is bright red
error = "%R$*%n";
# channel name is printed
channel = "%_$*%_";
# nick is printed
nick = "%_$*%_";
# nick host is printed
nickhost = "[$*]";
# server name is printed
server = "%_$*%_";
# some kind of comment is printed
comment = "[$*]";
# reason for something is printed (part, quit, kick, ..)
reason = "{comment $*}";
# mode change is printed ([+o nick])
mode = "{comment $*}";
##
## channel specific messages
##
# highlighted nick/host is printed (joins)
channick_hilight = "%C$*%n";
chanhost_hilight = "{nickhost %c$*%n}";
# nick/host is printed (parts, quits, etc.)
channick = "%c$*%n";
chanhost = "{nickhost $*}";
# highlighted channel name is printed
channelhilight = "%c$*%n";
# ban/ban exception/invite list mask is printed
ban = "%c$*%n";
##
## messages
##
# the basic styling of how to print message, $0 = nick mode, $1 = nick
msgnick = "%K<%n$0$1-%K>%n %|";
# message from you is printed. "msgownnick" specifies the styling of the
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
# whole line.
# Example1: You want the message text to be green:
# ownmsgnick = "{msgnick $0 $1-}%g";
# Example2.1: You want < and > chars to be yellow:
# ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
# (you'll also have to remove <> from replaces list above)
# Example2.2: But you still want to keep <> grey for other messages:
# pubmsgnick = "%K{msgnick $0 $1-%K}%n";
# pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
# pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
# ownprivmsgnick = "%K{msgnick $*%K}%n";
# privmsgnick = "%K{msgnick %R$*%K}%n";
# $0 = nick mode, $1 = nick
ownmsgnick = "{msgnick $0 $1-}";
ownnick = "%_$*%n";
# public message in channel, $0 = nick mode, $1 = nick
pubmsgnick = "{msgnick $0 $1-}";
pubnick = "%N$*%n";
# public message in channel meant for me, $0 = nick mode, $1 = nick
pubmsgmenick = "{msgnick $0 $1-}";
menick = "%Y$*%n";
# public highlighted message in channel
# $0 = highlight color, $1 = nick mode, $2 = nick
pubmsghinick = "{msgnick $1 $0$2-%n}";
# channel name is printed with message
msgchannel = "%K:%c$*%n";
# private message, $0 = nick, $1 = host
privmsg = "[%R$0%K(%r$1-%K)%n] ";
# private message from you, $0 = "msg", $1 = target nick
ownprivmsg = "[%r$0%K(%R$1-%K)%n] ";
# own private message in query
ownprivmsgnick = "{msgnick $*}";
ownprivnick = "%_$*%n";
# private message in query
privmsgnick = "{msgnick %R$*%n}";
##
## Actions (/ME stuff)
##
# used internally by this theme
action_core = "%_ * $*%n";
# generic one that's used by most actions
action = "{action_core $*} ";
# own action, both private/public
ownaction = "{action $*}";
# own action with target, both private/public
ownaction_target = "{action_core $0}%K:%c$1%n ";
# private action sent by others
pvtaction = "%_ (*) $*%n ";
pvtaction_query = "{action $*}";
# public action sent by others
pubaction = "{action $*}";
##
## other IRC events
##
# whois
whois = "%# $[8]0 : $1-";
# notices
ownnotice = "[%r$0%K(%R$1-%K)]%n ";
notice = "%K-%M$*%K-%n ";
pubnotice_channel = "%K:%m$*";
pvtnotice_host = "%K(%m$*%K)";
servernotice = "%g!$*%n ";
# CTCPs
ownctcp = "[%r$0%K(%R$1-%K)] ";
ctcp = "%g$*%n";
# wallops
wallop = "%_$*%n: ";
wallop_nick = "%n$*";
wallop_action = "%_ * $*%n ";
# netsplits
netsplit = "%R$*%n";
netjoin = "%C$*%n";
# /names list
names_prefix = "";
names_nick = "[%_$0%_$1-] ";
names_nick_op = "{names_nick $*}";
names_nick_halfop = "{names_nick $*}";
names_nick_voice = "{names_nick $*}";
names_users = "[%g$*%n]";
names_channel = "%G$*%n";
# DCC
dcc = "%g$*%n";
dccfile = "%_$*%_";
# DCC chat, own msg/action
dccownmsg = "[%r$0%K($1-%K)%n] ";
dccownnick = "%R$*%n";
dccownquerynick = "%_$*%n";
dccownaction = "{action $*}";
dccownaction_target = "{action_core $0}%K:%c$1%n ";
# DCC chat, others
dccmsg = "[%G$1-%K(%g$0%K)%n] ";
dccquerynick = "%G$*%n";
dccaction = "%_ (*dcc*) $*%n %|";
##
## statusbar
##
# default background for all statusbars. You can also give
# the default foreground color for statusbar items.
sb_background = "%4%w";
# default backround for "default" statusbar group
#sb_default_bg = "%4";
# background for prompt / input line
sb_prompt_bg = "%n";
# background for info statusbar
sb_info_bg = "%8";
# background for topicbar (same default)
#sb_topic_bg = "%4";
# text at the beginning of statusbars. sb-item already puts
# space there,so we don't use anything by default.
sbstart = "";
# text at the end of statusbars. Use space so that it's never
# used for anything.
sbend = " ";
topicsbstart = "{sbstart $*}";
topicsbend = "{sbend $*}";
prompt = "[$*] ";
sb = " %c[%n$*%c]%n";
sbmode = "(%c+%n$*)";
sbaway = " (%GzZzZ%n)";
sbservertag = ":$0 (change with ^X)";
sbnickmode = "$0";
# activity in statusbar
# ',' separator
sb_act_sep = "%c$*";
# normal text
sb_act_text = "%c$*";
# public message
sb_act_msg = "%W$*";
# hilight
sb_act_hilight = "%M$*";
# hilight with specified color, $0 = color, $1 = text
sb_act_hilight_color = "$0$1-%n";
};

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

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

View File

@@ -0,0 +1,272 @@
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
# $Id$
use MIME::Base64;
$VERSION = "1.3";
%IRSSI = (
authors => 'Michael Tharp and Jilles Tjoelker',
contact => 'gxti@partiallystapled.com',
name => 'cap_sasl.pl',
description => 'Implements PLAIN SASL authentication mechanism for use with charybdis ircds, and enables CAP MULTI-PREFIX',
license => 'GNU General Public License',
url => 'http://ircv3.atheme.org/extensions/sasl-3.1',
);
my %sasl_auth = ();
my %mech = ();
sub timeout;
sub server_connected {
my $server = shift;
$server->send_raw_now("CAP LS");
}
sub event_cap {
my ($server, $args, $nick, $address) = @_;
my ($subcmd, $caps, $tosend);
$tosend = '';
if ($args =~ /^\S+ (\S+) :(.*)$/) {
$subcmd = uc $1;
$caps = ' '.$2.' ';
if ($subcmd eq 'LS') {
$tosend .= ' multi-prefix' if $caps =~ / multi-prefix /i;
$tosend .= ' sasl' if $caps =~ / sasl /i && defined($sasl_auth{$server->{tag}});
$tosend =~ s/^ //;
$server->print('', "CLICAP: supported by server:$caps");
if (!$server->{connected}) {
if ($tosend eq '') {
$server->send_raw_now("CAP END");
} else {
$server->print('', "CLICAP: requesting: $tosend");
$server->send_raw_now("CAP REQ :$tosend");
}
}
Irssi::signal_stop();
} elsif ($subcmd eq 'ACK') {
$server->print('', "CLICAP: now enabled:$caps");
if ($caps =~ / sasl /i) {
$sasl_auth{$server->{tag}}{buffer} = '';
if($mech{$sasl_auth{$server->{tag}}{mech}}) {
$server->send_raw_now("AUTHENTICATE " . $sasl_auth{$server->{tag}}{mech});
Irssi::timeout_add_once(5000, \&timeout, $server->{tag});
}else{
$server->print('', 'SASL: attempted to start unknown mechanism "' . $sasl_auth{$server->{tag}}{mech} . '"');
}
}
elsif (!$server->{connected}) {
$server->send_raw_now("CAP END");
}
Irssi::signal_stop();
} elsif ($subcmd eq 'NAK') {
$server->print('', "CLICAP: refused:$caps");
if (!$server->{connected}) {
$server->send_raw_now("CAP END");
}
Irssi::signal_stop();
} elsif ($subcmd eq 'LIST') {
$server->print('', "CLICAP: currently enabled:$caps");
Irssi::signal_stop();
}
}
}
sub event_authenticate {
my ($server, $args, $nick, $address) = @_;
my $sasl = $sasl_auth{$server->{tag}};
return unless $sasl && $mech{$sasl->{mech}};
$sasl->{buffer} .= $args;
return if length($args) == 400;
my $data = $sasl->{buffer} eq '+' ? '' : decode_base64($sasl->{buffer});
my $out = $mech{$sasl->{mech}}($sasl, $data);
$out = '' unless defined $out;
$out = $out eq '' ? '+' : encode_base64($out, '');
while(length $out >= 400) {
my $subout = substr($out, 0, 400, '');
$server->send_raw_now("AUTHENTICATE $subout");
}
if(length $out) {
$server->send_raw_now("AUTHENTICATE $out");
}else{ # Last piece was exactly 400 bytes, we have to send some padding to indicate we're done
$server->send_raw_now("AUTHENTICATE +");
}
$sasl->{buffer} = '';
Irssi::signal_stop();
}
sub event_saslend {
my ($server, $args, $nick, $address) = @_;
my $data = $args;
$data =~ s/^\S+ :?//;
# need this to see it, ?? -- jilles
$server->print('', $data);
if (!$server->{connected}) {
$server->send_raw_now("CAP END");
}
}
sub timeout {
my $tag = shift;
my $server = Irssi::server_find_tag($tag);
if(!$server->{connected}) {
$server->print('', "SASL: authentication timed out");
$server->send_raw_now("CAP END");
}
}
sub cmd_sasl {
my ($data, $server, $item) = @_;
if ($data ne '') {
Irssi::command_runsub ('sasl', $data, $server, $item);
} else {
cmd_sasl_show(@_);
}
}
sub cmd_sasl_set {
my ($data, $server, $item) = @_;
if (my($net, $u, $p, $m) = $data =~ /^(\S+) (\S+) (\S+) (\S+)$/) {
if($mech{uc $m}) {
$sasl_auth{$net}{user} = $u;
$sasl_auth{$net}{password} = $p;
$sasl_auth{$net}{mech} = uc $m;
Irssi::print("SASL: added $net: [$m] $sasl_auth{$net}{user} *");
}else{
Irssi::print("SASL: unknown mechanism $m");
}
} elsif ($data =~ /^(\S+)$/) {
$net = $1;
if (defined($sasl_auth{$net})) {
delete $sasl_auth{$net};
Irssi::print("SASL: deleted $net");
} else {
Irssi::print("SASL: no entry for $net");
}
} else {
Irssi::print("SASL: usage: /sasl set <net> <user> <password or keyfile> <mechanism>");
}
}
sub cmd_sasl_show {
#my ($data, $server, $item) = @_;
my $net;
my $count = 0;
foreach $net (keys %sasl_auth) {
Irssi::print("SASL: $net: [$sasl_auth{$net}{mech}] $sasl_auth{$net}{user} *");
$count++;
}
Irssi::print("SASL: no networks defined") if !$count;
}
sub cmd_sasl_save {
#my ($data, $server, $item) = @_;
my $file = Irssi::get_irssi_dir()."/sasl.auth";
open FILE, "> $file" or return;
foreach my $net (keys %sasl_auth) {
printf FILE ("%s\t%s\t%s\t%s\n", $net, $sasl_auth{$net}{user}, $sasl_auth{$net}{password}, $sasl_auth{$net}{mech});
}
close FILE;
Irssi::print("SASL: auth saved to $file");
}
sub cmd_sasl_load {
#my ($data, $server, $item) = @_;
my $file = Irssi::get_irssi_dir()."/sasl.auth";
open FILE, "< $file" or return;
%sasl_auth = ();
while (<FILE>) {
chomp;
my ($net, $u, $p, $m) = split (/\t/, $_, 4);
$m ||= "PLAIN";
if($mech{uc $m}) {
$sasl_auth{$net}{user} = $u;
$sasl_auth{$net}{password} = $p;
$sasl_auth{$net}{mech} = uc $m;
}else{
Irssi::print("SASL: unknown mechanism $m");
}
}
close FILE;
Irssi::print("SASL: auth loaded from $file");
}
sub cmd_sasl_mechanisms {
Irssi::print("SASL: mechanisms supported: " . join(" ", keys %mech));
}
Irssi::signal_add_first('server connected', \&server_connected);
Irssi::signal_add('event cap', \&event_cap);
Irssi::signal_add('event authenticate', \&event_authenticate);
Irssi::signal_add('event 903', 'event_saslend');
Irssi::signal_add('event 904', 'event_saslend');
Irssi::signal_add('event 905', 'event_saslend');
Irssi::signal_add('event 906', 'event_saslend');
Irssi::signal_add('event 907', 'event_saslend');
Irssi::command_bind('sasl', \&cmd_sasl);
Irssi::command_bind('sasl load', \&cmd_sasl_load);
Irssi::command_bind('sasl save', \&cmd_sasl_save);
Irssi::command_bind('sasl set', \&cmd_sasl_set);
Irssi::command_bind('sasl show', \&cmd_sasl_show);
Irssi::command_bind('sasl mechanisms', \&cmd_sasl_mechanisms);
$mech{PLAIN} = sub {
my($sasl, $data) = @_;
my $u = $sasl->{user};
my $p = $sasl->{password};
join("\0", $u, $u, $p);
};
eval {
require Crypt::OpenSSL::Bignum;
require Crypt::DH;
require Crypt::Blowfish;
require Math::BigInt;
sub bin2bi { return Crypt::OpenSSL::Bignum->new_from_bin(shift)->to_decimal } # binary to BigInt
sub bi2bin { return Crypt::OpenSSL::Bignum->new_from_decimal((shift)->bstr)->to_bin } # BigInt to binary
$mech{'DH-BLOWFISH'} = sub {
my($sasl, $data) = @_;
my $u = $sasl->{user};
my $pass = $sasl->{password};
# Generate private key and compute secret key
my($p, $g, $y) = unpack("(n/a*)3", $data);
my $dh = Crypt::DH->new(p => bin2bi($p), g => bin2bi($g));
$dh->generate_keys;
my $secret = bi2bin($dh->compute_secret(bin2bi($y)));
my $pubkey = bi2bin($dh->pub_key);
# Pad the password to the nearest multiple of blocksize and encrypt
$pass .= "\0";
$pass .= chr(rand(256)) while length($pass) % 8;
my $cipher = Crypt::Blowfish->new($secret);
my $crypted = '';
while(length $pass) {
my $clear = substr($pass, 0, 8, '');
$crypted .= $cipher->encrypt($clear);
}
pack("n/a*Z*a*", $pubkey, $u, $crypted);
};
};
cmd_sasl_load();
# vim: ts=4

54
dotfiles/profile Normal file
View File

@@ -0,0 +1,54 @@
# Sourced by zshrc as well as bash.
umask 027
ulimit -c unlimited
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
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 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`
if test -f $GPG_AGENT_INFO_PATH && kill -0 `cut -d: -f 2 $GPG_AGENT_INFO_PATH` 2>/dev/null ; then
. $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
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 -,)

3911
dotfiles/reverser-gdbinit Normal file

File diff suppressed because it is too large Load Diff

13
dotfiles/ssh/config Normal file
View File

@@ -0,0 +1,13 @@
# Universal Settings (can't override)
# Never fall back to protocol 1: it's broken
Protocol 2
# Defaults (May be Overridden)
Host *
ControlMaster auto
ControlPath ~/.ssh/master/%r@%h:%p
ControlPersist yes
ForwardAgent no
ForwardX11 no
ForwardX11Trusted no
ServerAliveInterval 120

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=")"

2
dotfiles/zshenv Normal file
View File

@@ -0,0 +1,2 @@
# ZSH specific environment
DEBIAN_PREVENT_KEYBOARD_CHANGES=yes

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 }:#*\**}:#*\?*}}
)'