first commit
This commit is contained in:
+73
@@ -0,0 +1,73 @@
|
|||||||
|
!Xft settings
|
||||||
|
Xft*dpi: 96
|
||||||
|
Xft*antialias: true
|
||||||
|
Xft*hinting: true
|
||||||
|
Xft*hintstyle: full
|
||||||
|
Xft*rgba: rgb
|
||||||
|
|
||||||
|
!Xcursor
|
||||||
|
Xcursor.theme: gentoo-blue
|
||||||
|
Xcursor.size: 22
|
||||||
|
|
||||||
|
!xterm
|
||||||
|
xterm*termName: xterm-256color
|
||||||
|
xterm*locale: true
|
||||||
|
xterm*savelines: 4096
|
||||||
|
xterm*VT100.geometry: 80x32
|
||||||
|
xterm*faceName: incosolata-10
|
||||||
|
xterm*utf8: 1
|
||||||
|
|
||||||
|
#define S_base03 #002b36
|
||||||
|
#define S_base02 #073642
|
||||||
|
#define S_base01 #586e75
|
||||||
|
#define S_base00 #657b83
|
||||||
|
#define S_base0 #839496
|
||||||
|
#define S_base1 #93a1a1
|
||||||
|
#define S_base2 #eee8d5
|
||||||
|
#define S_base3 #fdf6e3
|
||||||
|
#define S_yellow #b58900
|
||||||
|
#define S_orange #cb4b16
|
||||||
|
#define S_red #dc322f
|
||||||
|
#define S_magenta #d33682
|
||||||
|
#define S_violet #6c71c4
|
||||||
|
#define S_blue #268bd2
|
||||||
|
#define S_cyan #2aa198
|
||||||
|
#define S_green #859900
|
||||||
|
|
||||||
|
*background: S_base03
|
||||||
|
*foreground: S_base00
|
||||||
|
*cursorColor: S_base1
|
||||||
|
*pointerColorBackground:S_base01
|
||||||
|
*pointerColorForeground:S_base1
|
||||||
|
|
||||||
|
!! black dark/light
|
||||||
|
*color0: S_base02
|
||||||
|
*color8: S_base03
|
||||||
|
|
||||||
|
!! red dark/light
|
||||||
|
*color1: S_red
|
||||||
|
*color9: S_orange
|
||||||
|
|
||||||
|
!! green dark/light
|
||||||
|
*color2: S_green
|
||||||
|
*color10: S_base01
|
||||||
|
|
||||||
|
!! yellow dark/light
|
||||||
|
*color3: S_yellow
|
||||||
|
*color11: S_base00
|
||||||
|
|
||||||
|
!! blue dark/light
|
||||||
|
*color4: S_blue
|
||||||
|
*color12: S_base0
|
||||||
|
|
||||||
|
!! magenta dark/light
|
||||||
|
*color5: S_magenta
|
||||||
|
*color13: S_violet
|
||||||
|
|
||||||
|
!! cyan dark/light
|
||||||
|
*color6: S_cyan
|
||||||
|
*color14: S_base1
|
||||||
|
|
||||||
|
!! white dark/light
|
||||||
|
*color7: S_base2
|
||||||
|
*color15: S_base3
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# /etc/skel/.bashrc
|
||||||
|
#
|
||||||
|
# This file is sourced by all *interactive* bash shells on startup,
|
||||||
|
# including some apparently interactive shells such as scp and rcp
|
||||||
|
# that can't tolerate any output. So make sure this doesn't display
|
||||||
|
# anything or bad things will happen !
|
||||||
|
|
||||||
|
|
||||||
|
# Test for an interactive shell. There is no need to set anything
|
||||||
|
# past this point for scp and rcp, and it's important to refrain from
|
||||||
|
# outputting anything in those cases.
|
||||||
|
if [[ $- != *i* ]] ; then
|
||||||
|
# Shell is non-interactive. Be done now!
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put your fun stuff here.
|
||||||
|
source /etc/profile.d/bash-completion.sh
|
||||||
|
source ~/todo.txt-cli/todo_completion
|
||||||
|
alias emacs='emacs -nw'
|
||||||
|
alias t='$HOME/Dropbox/todo/todo.sh -d $HOME/Dropbox/todo/todo.cfg'
|
||||||
|
alias nano='nano -w'
|
||||||
|
complete -F _todo t
|
||||||
|
PATH="/home/ewpt3ch/bin:${PATH}:./:"
|
||||||
|
export VMWARE_USE_SHIPPED_GTK="yes"
|
||||||
|
keychain -q ~/.ssh/id_ecdsa
|
||||||
|
. ~/.keychain/$HOSTNAME-sh
|
||||||
|
. ~/.keychain/$HOSTNAME-sh-gpg
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
# Conky sample configuration
|
||||||
|
#
|
||||||
|
# the list of variables has been removed from this file in favour
|
||||||
|
# of keeping the documentation more maintainable.
|
||||||
|
# Check http://conky.sf.net for an up-to-date-list.
|
||||||
|
|
||||||
|
# set to yes if you want Conky to be forked in the background
|
||||||
|
background yes
|
||||||
|
|
||||||
|
# X font when Xft is disabled, you can pick one with program xfontsel
|
||||||
|
#font 5x7
|
||||||
|
#font 6x10
|
||||||
|
#font 7x13
|
||||||
|
#font 8x13
|
||||||
|
#font 9x15
|
||||||
|
#font *mintsmild.se*
|
||||||
|
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
|
||||||
|
|
||||||
|
# Use Xft?
|
||||||
|
use_xft yes
|
||||||
|
|
||||||
|
# Xft font when Xft is enabled
|
||||||
|
xftfont DroidSansMono:size=10
|
||||||
|
|
||||||
|
# Text alpha when using Xft
|
||||||
|
xftalpha 0.8
|
||||||
|
|
||||||
|
# Print everything to stdout?
|
||||||
|
# out_to_console no
|
||||||
|
|
||||||
|
# MPD host/port
|
||||||
|
# mpd_host localhost
|
||||||
|
# mpd_port 6600
|
||||||
|
# mpd_password tinker_bell
|
||||||
|
|
||||||
|
# Print everything to console?
|
||||||
|
# out_to_console no
|
||||||
|
|
||||||
|
# mail spool
|
||||||
|
# mail_spool $MAIL
|
||||||
|
|
||||||
|
# Update interval in seconds
|
||||||
|
update_interval 2.0 #set to 30 or 60
|
||||||
|
|
||||||
|
# This is the number of times Conky will update before quitting.
|
||||||
|
# Set to zero to run forever.
|
||||||
|
total_run_times 0
|
||||||
|
|
||||||
|
# Create own window instead of using desktop (required in nautilus)
|
||||||
|
own_window yes
|
||||||
|
|
||||||
|
# If own_window is yes, you may use type normal, desktop or override
|
||||||
|
own_window_type desktop
|
||||||
|
|
||||||
|
# Use pseudo transparency with own_window?
|
||||||
|
own_window_transparent yes
|
||||||
|
|
||||||
|
# If own_window_transparent is set to no, you can set the background colour here
|
||||||
|
#own_window_colour hotpink
|
||||||
|
|
||||||
|
# If own_window is yes, these window manager hints may be used
|
||||||
|
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
|
||||||
|
|
||||||
|
# Use double buffering (reduces flicker, may not work for everyone)
|
||||||
|
double_buffer yes
|
||||||
|
|
||||||
|
# Minimum size of text area
|
||||||
|
minimum_size 280 5
|
||||||
|
|
||||||
|
# Draw shades?
|
||||||
|
draw_shades no
|
||||||
|
|
||||||
|
# Draw outlines?
|
||||||
|
draw_outline no
|
||||||
|
|
||||||
|
# Draw borders around text
|
||||||
|
draw_borders no
|
||||||
|
|
||||||
|
# Draw borders around graphs
|
||||||
|
draw_graph_borders yes
|
||||||
|
|
||||||
|
# Stippled borders?
|
||||||
|
stippled_borders 8
|
||||||
|
|
||||||
|
# border margins
|
||||||
|
#window.border_inner_margin 0
|
||||||
|
|
||||||
|
# border width
|
||||||
|
border_width 0
|
||||||
|
|
||||||
|
# Default colors and also border colors
|
||||||
|
default_color 268bd2
|
||||||
|
default_shade_color 859900
|
||||||
|
default_outline_color black
|
||||||
|
|
||||||
|
# Text alignment, other possible values are commented
|
||||||
|
alignment top_right
|
||||||
|
|
||||||
|
# Gap between borders of screen and text
|
||||||
|
# same thing as passing -x at command line
|
||||||
|
gap_x 1
|
||||||
|
gap_y 1
|
||||||
|
|
||||||
|
# Subtract file system buffers from used memory?
|
||||||
|
no_buffers no
|
||||||
|
|
||||||
|
# set to yes if you want all text to be in uppercase
|
||||||
|
uppercase no
|
||||||
|
|
||||||
|
# number of cpu samples to average
|
||||||
|
# set to 1 to disable averaging
|
||||||
|
cpu_avg_samples 2
|
||||||
|
|
||||||
|
# number of net samples to average
|
||||||
|
# set to 1 to disable averaging
|
||||||
|
net_avg_samples 2
|
||||||
|
|
||||||
|
# Force UTF8? note that UTF8 support required XFT
|
||||||
|
override_utf8_locale no
|
||||||
|
|
||||||
|
# Add spaces to keep things from moving about? This only affects certain objects.
|
||||||
|
use_spacer none
|
||||||
|
|
||||||
|
# Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
|
||||||
|
#max_port_monitor_connections 256
|
||||||
|
|
||||||
|
# Maximum number of special things, e.g. fonts, offsets, aligns, etc.
|
||||||
|
#max_specials 512
|
||||||
|
|
||||||
|
# Maximum size of buffer for user text, i.e. below TEXT line.
|
||||||
|
#max_user_text 16384
|
||||||
|
|
||||||
|
# Timing interval for music player thread, e.g. mpd, audacious
|
||||||
|
#music_player_interval (update_interval is default)
|
||||||
|
|
||||||
|
# variable is given either in format $variable or in ${variable}. Latter
|
||||||
|
# allows characters right after the variable and must be used in network
|
||||||
|
# stuff because of an argument
|
||||||
|
|
||||||
|
# stuff after 'TEXT' will be formatted on screen
|
||||||
|
|
||||||
|
TEXT
|
||||||
|
${battery BAT1} ${battery_bar 10,40 BAT1} ${alignr} ${addr wlp0s29f7u1} $time
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[user]
|
||||||
|
email = ewpt3ch@gmail.com
|
||||||
|
name = Eric Phillips
|
||||||
|
[credential]
|
||||||
|
helper = cache --timeout=3600
|
||||||
|
[push]
|
||||||
|
default = simple
|
||||||
+275
@@ -0,0 +1,275 @@
|
|||||||
|
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 = "6697";
|
||||||
|
use_ssl = "yes";
|
||||||
|
ssl_verify = "no";
|
||||||
|
autoconnect = "yes";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
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"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
channels = (
|
||||||
|
{ name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; },
|
||||||
|
{ name = "silc"; chatnet = "silc"; autojoin = "No"; }
|
||||||
|
);
|
||||||
|
|
||||||
|
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 = "no";
|
||||||
|
|
||||||
|
# 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"; };
|
||||||
|
act = { priority = "10"; };
|
||||||
|
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"; };
|
||||||
|
topic = { };
|
||||||
|
topic_empty = { };
|
||||||
|
topicbarend = { priority = "100"; alignment = "right"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
core = {
|
||||||
|
real_name = "Unknown";
|
||||||
|
user_name = "ewpt3ch";
|
||||||
|
nick = "ewpt3ch";
|
||||||
|
};
|
||||||
|
"fe-text" = { actlist_sort = "refnum"; };
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Freenode ewpt3ch sGaZmkSOLb9zqzWFG9u8 PLAIN
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
syntax enable
|
||||||
|
set background=dark
|
||||||
|
colorscheme solarized
|
||||||
|
set smartindent
|
||||||
|
set tabstop=2
|
||||||
|
set shiftwidth=2
|
||||||
|
set expandtab
|
||||||
|
iabbrev <// </<C-X><C-O>
|
||||||
Reference in New Issue
Block a user