Skip to content

Instantly share code, notes, and snippets.

Created January 10, 2013 20:24
Show Gist options
  • Save anonymous/4505460 to your computer and use it in GitHub Desktop.
Save anonymous/4505460 to your computer and use it in GitHub Desktop.
#!/usr/bin/awk -f
{
if(/sramov/) {
printf("\a")
printf("\033[1;31m")
}
if(/^#somechannel/) {
sub(/[^:]*: /, "", $0)
}
printf("%s\033[0m\n", $0)
}
#!/bin/sh
IRCPATH=$HOME/irc
IRCFIFO=$IRCPATH/in
CHANNELS="#blah"
NICK=sramov
PORT=6667
SERVER=localhost
test ! -d $IRCPATH && mkdir $IRCPATH
test ! -e $IRCFIFO && mkfifo $IRCFIFO
ssh -f -N irc.sometin.invalid && sleep 1
while true; do
sic -h $SERVER -p $PORT -n $NICK -k pass < $IRCFIFO | tee -a $IRCPATH/out | irc.awk &
pid=$!
for chan in $CHANNELS; do
printf ":j %s\n" $chan > $IRCFIFO
done
wait $pid
done &
tmux split-window "cat > $IRCFIFO"
tmux resize-pane -D 100
tmux rename-window irc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment