Something I wish I had time to do

Write a conversational IRC bot, lol.

I Figure, load two processes, a communications layer and an automation layer; in this case the communications layer would be a simple relay between an IRC channel and the automatas standard I/O streams; messages on the channel would get written to the automatas standard input, and messages to send to the channel would be read from the automatas standard output.

I would want the thing to have some concept of learning, maybe build a dictionary of language; perhaps start off with a limited knowledge of words; storing words it doesn’t know into a database for later analysis. And then once a number of words have been manually entered into it with attached meta data, program it to perform the analysis itself; trying to figure out what kind of words it sees but doesn’t know about yet, and then write out plugin code with the bots “best guess”, and if it gets it wrong, I could manually change it, and it would have to study the differences between my correction and it’s choice, and modify it’s guessing based on experience. (Implementing that would be fun in it’s own right, lol.).

That would logically be easy enough to design and study, the question is how to make it educating enough that you can actually have people chatter with it.

Haha, I always laugh when people mistake bots for humans on IRC xD

Man, I had a strange dream

It was like a cross between Metal Gear Solid and a bad action flick; last man standing of a recon team, trying to exfiltrate the mission area with news of a renegade officer (Gene Hackman) building a mechanical army…

I remember creeping though jungle, feeling the plant life on me; and very paranoid of trip wires and punji’fied traps (I hate punji sticks!); ended up rolling into a body of water in order to bypass a patrol. Only to sink like a stone when I realized I never finished learning to swim! Having realized I was dreaming quite awhile ago, I decided “this ain’t no dream about drownin'” and thought back to Tomb Raider and pushed off. Breaking the surface for air got the enemies attention.

Compromised greatly, made it into a building connected to a hanger like one: 1 vs 20 odds, but sufficiently close quarters that survival was possible: CQB tactics, solid use of cover, MK23 in hand, and Fragmentation grenades evening the odds ^_^. Blew the ever loving crap out of the place and ended up cappin’ a number of techs, hopefully before they could call in reinforcements via the computers… (also destroyed for good measure)

Gathered some supplies and climbed up to the exposed upper level, maybe find a way ontop to get my barrings: but no such luck. A tank rolled (or hovered?) into the hanger area and started deploying robot troops. Leapt off the overhang onto an L-shaped cage like door on the opposing side, cut the rope and rode it down with a crash — then made like a gust of wind, beading it out of there before the robots could catch up lol.

Forded a river and scurried up hill, looking for concealment — plan, wait for the enemy to pass by on a wild goose chase, an d make up the rest from there. Found a weapons cache stashed near by, that would even the odds quiet a bit, but something interesting was also there, a hatch leading down a short climb into a bunker of some sort.

That’s when all hell officially broke loose, security systems came online: gun equipped cameras with laser sights popping out of the sealing, robots coming on line armed to the teeth, and even worse… turning invisible! Got out of there quickly, just ahead of a grenade launched my way lol. Ran faster then I’ve IRL done in many a year, like a mad spider, following the rivers path: now being pursued by droid-patrol boats and shock troops moving for a better shot; the boats were also fitted with cloaking devices :-(. Comendeered a fishing boat in the name of “national security” and went about sinking those things… imagine an aerial dog fight, but in 2D and below 30knots lol.

I really have some crazy ass dreams, but the only time I worry is when I have a ‘sane’ dream instead of an adventure or nightmare like one +S.

Miracally off work today, but the working schedule is a shambles :-/

14 months from purchase to setup?

Not so long ago a thread came up on DF, dealing with printing. That reminded me…. I baught my printer in what, February of 2007 and it’s just been gathering dust?

That’s gotta be a new record: for either laziness or being to fsckin’ busy lol.

The reason I bought it, I knew this model was usable with most OSes. Honestly, I _hate_ ink jet printers (and printers in general, but yeah… especially ink jets). Sadly, a decent PostScript printer is harder to find in this place then an affordable laser printer; having to use an inkjet makes me very happy that I rarely print anything.

Around OpenBSD 4.3 or so, I stripped off all printing related packages off my server: the shitmark hasn’t worked in years. So I had to setup the format filtering magic anew: ghostscript (no_x11 flavour), hpijs, foomatic-filters, and foomatic-db-hpijs. Several years ago it was my intention to run a networked printer off the box, but the printer I had at the time more or less stopped functioning under FreeBSD+CUPS, so I haven’t paid much attention since then. Most distributions use the Common Unix Print System (CUPS) these days; but I’m just old at heart, I like the Berkeley Line Printer Daemon (lpd). CUPS, only way I ever know wth is going on is going cross eyed with log files; with lpd, at least you know it’s brainlessly simple to sort out.

My only complaint about the printer, ‘lptest | lpr’ resulted in 2 pages of ~60 lines before I decided to dequeue the 200 line job: and the some-bitch isn’t smart enough to eject the darn 3rd sheet of paper ^_^. (whether this has to do with my PPD file or hpijs support for my printer is not interesting to me, lol). On top of that, the thing prints about as slow as I can write text by hand. I could just imagine if I fed tpsh’s ~3000 lines of text though it, probably take a week and 50 sheets of paper.

Chuckle of the day, 2009-04-13 in #vim

   viking | "Viper, an emacs package providing Vi
emulation on top of Emacs." i don't know what
to say
jamessan | Vimacs : Vim-Improved eMACS: Emacs emulation
for Vim
SAS_Spidey01 | HAHAHA
SAS_Spidey01 | thank you jamessan, I haven't laughed like
that in a while xD

Worthless router

Ended up woken up around 0930 (yippee, 3 hours sleep) due to a power outage; then dragged out shopping 🙁

When I got home and finally on the computer, I noticed for the first time in a LONG time my laptop couldn’t get a wireless connection: usually my BSD system is queen of the WLAN. A quick bit of investigation showed that during the power outage, the router reset itself totally. It’s a good thing my laptops Ethernet port has been supported since ~FreeBSD 6.4. Dug up an old Ethernet cable and plugged into the router. Sure enough the piece of crap got reset to factory defaults during the power outage stuff this morning.

Reconfigured the router and upgraded the encryption: only to find out my mothers PC couldn’t handle it, despite having the same hardware as my desktop. A quick search of Google turned up what I suspected, menu option added in an update; and her box was running XP Home SP2 / IE6 / .NET 1.1 lol. Updates are almost finished, and now every machines back on the network

My mothers been badgering me to try charters atypical power cycle suggestion: which I know could be done for years and years and wouldn’t change jack shit; she’s got no logical concept of networks. Some how, I think understanding helps troubleshoot stuff then trying the Microsoft Ritual Solution (MSRS). In my experience it works fine for Win32, but UNIX and networking equipment in general seems to follow a more sane pattern 😉

Tom Knight and the Lisp Machine; The Jargon File, version 4.4.7

A novice was trying to fix a broken Lisp machine by turning the power off and on.

Knight, seeing what the student was doing, spoke sternly: “You cannot fix a machine by just power-cycling it with no understanding of what is going wrong.”

Knight turned the machine off and on.

The machine worked.

I always think about that old koan when having such trouble lol.

What I hate about programming

Some months ago when it reached Kris Moore’s attention (late as usual) that I had brought up security issues with his Firefox3 PBI, he changed it to something almost as bad. A couple weeks ago, I heard back from Kris that he had [naively] changed the code for making Fx3 the users default browser would no longer run as “root”. After a little more conversation he split it off to something better.

Originally it was a part of the script that runs during PBI installation (and worse then the below script), probably tired of my replies he made an extra wrapper around the Firefox3, that asks the user if they want Firefox3 set default or not, rather then workin’ the user database at install time. (I refuse comment on the following scripts predecessors: if you want to know more, read his SVN). The solution he came up for that wrapper, was to invokes the following code as the user when necessary:

#!/bin/sh
# Helper script to make FF the default browser for a user
##############################################################################

# Get the users homedir
USER="`whoami`"
HOMEDIR="`cat /etc/passwd | grep ^${USER}: | cut -d ":" -f 6`"

if [ -e "${HOMEDIR}/.kde4" ]
then
KDEDIR=".kde4"
else
KDEDIR=".kde"
fi

if [ ! -e "${HOMEDIR}/${KDEDIR}/share/config/kdeglobals" ]
then
echo "ERROR: No kdeglobals file for $USER"
exit 1
fi


TMPKFILE="${HOMEDIR}/.kdeglobals.$$"
TMPKFILE2="${HOMEDIR}/.kdeglobals2.$$"
rm ${TMPKFILE} >/dev/null 2>/dev/null

cat ${HOMEDIR}/${KDEDIR}/share/config/kdeglobals | grep -v '^BrowserApplication' > ${TMPKFILE}

rm ${TMPKFILE2} >/dev/null 2>/dev/null
touch ${TMPKFILE2}
while read line
do
if [ "$line" = "[General]" ]
then
echo "$line" >> ${TMPKFILE2}
if [ "${KDEDIR}" = ".kde4" ]
then
echo "BrowserApplication[$e]=!/Programs/bin/firefox3" >> ${TMPKFILE2}
else
echo "BrowserApplication=!/Programs/bin/firefox3" >> ${TMPKFILE2}
fi
else
echo "$line" >> ${TMPKFILE2}
fi
done < ${TMPKFILE}

# all finished, now move it back over kdeglobals
rm ${TMPKFILE}
mv ${TMPKFILE2} ${HOME}/${KDEDIR}/share/config/kdeglobals

exit 0

which is more secure then the original implementation, and more efficient also. Tonight I sent Kris a casual (read: adapt to need, don’t take as is) suggestion from yours truly:

#!/bin/sh
# Helper script to make FF the default browser for a user
# Should work for KDE3 and KDE4.
##############################################################################

PROG="!/Programs/bin/firefox3"
FILE="./share/config/kdeglobals"

for D in "${HOME}/.kde" "${HOME}/.kde4"
do
cd $D 2>/dev/null || break;

if [ ! -e "$FILE" ]
then
echo "ERROR: No kdeglobals file, unable to set $PROG as default"
exit 1
fi

ed -s "$FILE" <<EOF
/[General]/
/BrowserApplication.*=/
s/=.*/=${PROG}/
wq
EOF
# write your own error handlers
done

exit 0

which should work as far as I can test; since I lack a working KDE install (compiling KDE4.2+ is on my todo list). It’s not perfect, but it sure is nicer then what he had a few months back. I included the a diff of the two scripts in my last message, which may very well go against my decision to “never” send these people patches. But I really don’t care if he accepts it or not, because while I believe in being helpful, I also I do not like doing peoples jobs for them.

I’m a lazy good for nothing creep, but I am lazy of muscle – not lazy of mind. The most productive code I have ever written, is the code I was smart enough /not/ to write in the first place.