From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <430b3d514e89f59a0e03b1329074bf23@sounine.nanosouffle.net> To: 9fans@9fans.net From: Akshat Kumar Date: Fri, 2 Jan 2009 02:20:22 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-hfbgiovxiigravmevigrmvnhpy" Subject: [9fans] couple of scripts - specific tasks Topicbox-Message-UUID: 7590a78e-ead4-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-hfbgiovxiigravmevigrmvnhpy Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Largely useless scripts that'll perhaps save someone a few minutes or at least a few keystrokes -- they've been done with simplicity, not conciseness or efficiency, in mind. No usage info (fn) is provided. convo/fmt is to be used with "generic" IRC logs like the one produced by andrey's irc7 (which does not include timestamps), in order to get some of the last lines of dialog, output in tabbed format for legibility. convo/fmt me nick /tmp/log 10 gets 10 latest lines of convo between 'me' and 'nick' convo/fmt '#channel' '' /tmp/log 10 gets 10 latest lines of convo in #channel chkill is a kill(1) equivalent for processes being run by, i.e., none -- to be used by hostowner it made restarting httpd happen in less keystrokes, and the excessive, imitative, output is enthralling. reminder for somethings, and a cry for help regarding others, ak --upas-hfbgiovxiigravmevigrmvnhpy Content-Disposition: attachment; filename=fmt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit #!/bin/rc j='' chan='' fn format{ if(~ $1 '#'*){ if(! ~ $1 $chan) echo $1 chan=$1 shift output $j $* | awk '{print " " $0}' | fmt } if not output $j $* | fmt j=$1 } fn output{ if(~ $1 $2){ shift 2 echo ' ' $* } if not{ shift echo echo $* } } grep -e $2^'.*PRIVMSG '^$1^'.*|^PRIVMSG '^$2^' :' $3 | tail $4 | sed ' s/^PRIVMSG ((#.*)?).* :/\1 ⇒ /g s/:(.*)!.* PRIVMSG ((#.*)?).* :/\2 \1→ /g s/ //g' | while(line=`{read}) format $line --upas-hfbgiovxiigravmevigrmvnhpy Content-Disposition: attachment; filename=chkill Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit #!/bin/rc for(i){ ps | grep $i | while(line=`{read}){ echo 'chmod 777 /proc/'^$line(2)^'/note && #'^$line(7)^' echo kill > /proc/'^$line(2)^'/note' } } --upas-hfbgiovxiigravmevigrmvnhpy--