It’s interesting, coming back around here and reading my old posts, especially the latest ones: so random, and yet so full of enthusiasm. I’ve started my grown-up life a few months back, out of University and all tidy in a very corporate environment and… yeah. Not doing much outside of work in terms of coding and stuff and wondering if that’s all it’s about and all it’s gonna be about, forever. I need that bit of my soul back and remembering how much I used to do and how much fun it used to be, all of it, from discovering a problem to trying to solve it and learning all sort of things along the way and sideways while getting distracted… So much fun. Hopefully the next post will be about problems and solutions and the pain the solutions brought with them!

Mail::Thread
August 17, 2008The Mail::Thread created just as many threading issues at it solved, as some more testing proved. I got a bit bummed out about it (one step forward, three steps back), and I was wondering if I should still use it or try to fix the problem of the other module.
In the end, the truth is that for all the problems it creates, Mail::Thread makes it much simpler to find out about them as well, because there’ll be a empty contained as a top post, all the time. The threading problem I found with Mail::Box::Thread::Manager simply gave back a wrong threading order and I only noticed because I was reading in details my script output (I’m parsing interesting stuff!). So, well, that would mean I would have to DETECT and SOLVE, and “detecting” threading problems would basically mean rewriting a whole threading library, which is not something I’m so keen to try anymore. So I rewrote the script using the Mail::Thread, and I wrote a embarrassingly rough heuristic to try to find what may be the top post. The results look acceptable, I think. I’ll have to check more closely of course, and try to find out whatever New Obvious Problem I Missed this time! Stuff like disappearing messages is pretty annoying to try to discover, but I’m making progress

And all the threading problems were solved, and all was good
August 12, 2008OTOH, there *is* something to be said for avoiding the Not-Invented-Here syndrome and reusing great work done by smart people. Hey. So the jwz algo Perl implementation works and solves my problem, of course
Then my crappy, painfully limited, excruciatingly expensive 3G connection decided that I wasn’t deserving of an IP anymore after making this discovery last night, so I can only post this morning rather than adding a simple edit.
I still have to adapt some stuff to deal with Mail::Box::Thread::Node and Mail::Message in parallel (…or remove the former completely) but that’s gonna be ok. I see the light! And well, I’m sure there’ll be other future opportunities to become an expert at handling mail header issues
In the sweet light of morning I can’t believe that I thought for even a second that there was something NOT on CPAN. Maybe I should get my brain checked.
UPDATE: Not so perfect.

Perl Mail::Box thread manager disorder
August 11, 2008Ok, so the problem isn’t due to crappy code from my side but to a malformed header References field in one of the messages in that particular thread. To check I actually just removed the offensive reference, 2/3 of a line and bam, everything is threaded and in the right order and all are there. Hey. So easy.
Of course it’s not *correct.* It’s a messed up header but modifying the input to get my script to work as I want is just not right. And this is just one post that I noticed, I’ve got a huge heap of mboxes to process as well, what if there are others in there? Don’t they deserve to be well-threaded as well?
I’ve tried to think up a few dirty workarounds to bypass the problem but really, at the heart of this is the first threading call I make, $threads->sortedAll (or ->all, all the same) so I don’t have so much space and I can imagine how any fix could create just as many problems as it solves.
So I’ve decided to try it the “Let’s use a sledge hammer to knock a pin” way. I’m going to implement jwz’s threading algorithm and I think Step 1-B-2 and 1-C will take care of that particular issue. Step 4 should deal with some other problem I noticed today with the way dummies are currently handled in my side of the code — easy to work around, that one, but if I can knock 2 pins with one big fat huge sledge hammer, I’m gonna try that first
[EDIT: Of course as soon as I wrote this I realised there was already another Perl module that implements the algo, so all the sledge manoeuvring fun will probably not occur tomorrow as expected
Ah well, if I can solve the problem and get on with it...]

Git and Mail::Box thread issues
August 9, 2008I’m touching to a lot of stuff lately. I’ve become a huge, MASSIVE fan of Git, to the point where I’m pulling out old projects with joy because now they’re hosted somewhere on Git and it means I get to use it whenever I commit. Eh. Nuts. I’m also tip-toeing around the idea of looking closer at Git’s code and perhaps try to contribute a little, sharpen my crappy-crappy C skills but… er, there’s one mailing-list with 100 messages/day and I can’t deal with it at the moment, the Contributing documentation all link back to messages on the ML and the Documentation in the code doesn’t help me a lot. I have to look harder. I’ve started using Mutt (absolutely not proficient at all with it ATM, but as I become more and more reluctant to touch a mouse or a touchpad that’s my way of dealing with hand-moving laziness). When I’m better at it and learn how to filter well, I plan to subscribe to the ML and get a feel for the community and how things are done. Maybe it’ll go nowhere, maybe it will, I look forward to it in any case.
Otherwise I’m also working on a Perl script dealing with Mailboxes that’s giving me a bit of trouble with threads. From what I can tell, although the box is well-formed (and god knows that by now I’ve read a lot of mail RFCs and seen a fair share of properly and improperly formed mboxes) sometimes the parent message in a thread shows as a reply to one of its own children. There’s no reference, no reply-to in the parent, and there *are* reply-to and/or a reference field in the child, but still it shows first. Even when I don’t use my code but the theadToString method of Mail::Box::Thread::Node, the parent appears as a child so I’m tempted to think “Not my fault!” but I’d still like to deal with it, one way or another and er, the Mail::Box module is robust and strongly tested so it’s more likely there’s something obvious I’m missing. Irritating, been smashing my head against this one for a quite a few hours now.
And with no solution, I can’t give myself the reward of going through another round of the Git Experience
(I’m like an addict, it’s crazy.) Sometimes I feel guilty I get so enthusiastic about stuff… Other times I think, why not? It seems this is how I learn best and most, and sane people can stay away if they’re afraid it’s contagious.
Ok, one last round of skimming through RFC 2822 and I give up on this one for the day.

GUIs
March 2, 2008I’ve got this Postgres database, created during the LinuxChix Postgresql course, that’s all nice but would be more useful with a GUI or some other way to interact with it. I remember sucking at Java GUIs so I thought here’s an opportunity to suck less.
But urgh. Don’t know if I’ve gotten spoiled by Perl or if it’s just Swing and desktops GUIs in general that work like that but the busy work is driving me nuts. It feels like I’m spending 10x more time on setting up things to please the JVM than actually writing code that does something to help me reach my goal.
As long as I have some hair left to pull, I won’t give up, but writing a CLI is getting more appealing by the minute.

Girl Geek Dinners
March 2, 2008I went to the first Ireland Girl Week dinner last Wednesday night and I had a great time, although I wasn’t really able to talk about tech stuff, since the 7 people around me were working at Microsoft and I wasn’t in the mood to fight/argue. There was a couple of gasps when I mentioned I used Linux, and the temperature dropped a few degrees after I said something about OpenOffice (answer: “It’s just a copy.” — I need to prepare a neutral way to present my opinion next time this happens), but the people I spoke with were all very cool and it’s a good way to put things in perspective.
Overall a great night and I’m definitely looking forward to the next event.
What I have problems coming to terms with, is how hostile the reactions of people around me have been. I’d expected some teasing, since I’ve given up on my classmates sharing my passion for programming and other geeky things, but I was surprised by the harshness of the slagging. The looks and remarks… I don’t get why people would feel so strongly about something they obviously don’t give a damn about. Or maybe they just don’t care how their comments are received.
Anyway. I’ll keep trying to make sense of that piece of human behaviour in the background, but for now time to go back to Perl, and do the exercises of the latest chapter I read!

Reading and coding
February 21, 2008I’ve been reading like mad lately (and damn, it’s close to impossible to find a library with computer books in their catalogue, even the University one, unless the book focuses heavily on the business (eg Peopleware)… I’m ruined!), and writing Perl scripts the rest of the time to automate my life away.
I’ve taken out again a plug-in I wrote for Moodle last year and boo. The code is a mess, and now that I’ve started to read on refactoring I see the many ways in which it should be different. Guess I’m gonna have fun applying the principles while adding the new features my client wants.
(in a perfect world it would probably need to be redesigned and rewritten from scratch though… :/ I won’t do something crazy like this.)

SSH, again! And Postfix too.
January 3, 2008In the end I chickened out on letting the computer turned on while I was away with SSH open — I messed up with my crons about a week before leaving, which resulted in DynDNS cutting me out and just thinking of something like that happening again, my computer like a sitting duck on the Web while I can’t turn it off remotely was making me uncomfortable — just as well because I wouldn’t have had time to connect while away anyway. End of year celebrations are a bit crazy, and this one was… awkward, let’s say. Meh. While waiting for the plane (late of course), I started reading the SSH book and I love it. As soon as I came home last week I set up a pair of keys and damn, it really was that easy, took me like 2 minutes. I disabled authentication by password at the same time. I made a different key for my laptop as well. Don’t know what way would be the best, copying my desktop key all over the place or creating a different key for the three computers I connect with… I went with the second, feels righter — I’ll see.
After this I started toying with the idea of going back to port 22… More convenient… But I wanted to fix my cron problem first, so I could receive emails about what was going with sshd in the logs. Every message I see about cron and email in the Ubutu forums seem to be about people not wanting to receive those damn emails anymore, while I had the opposite problem, couldn’t receive anything.
I think one of the reasons I spent so many %£#@] hours on this is because that’s the third or fourth time I come back to it and all the stuff I messed with before messed up what I was doing now. For instance, I tried to use mailx with –verbose but my mailbox would remain empty of any status report, and the mail log would show <removed> or something like that. After two or three hours of just trying to change main.cf, purgeing and reinstalling and dpkg-reconfiguring postfix and mailx, I decided to flush my spam folder on Gmail for a break and what do I see… About 30 “Undelivered Mail to Sender” containing the messages I tried to send myself. I think my brain exploded about that time.
Then I remembered I’d set up a .forward file in my home folder with my gmail address. So instead of storing messages in my mailbox, they were directly forwarded to my email. Nice.
Now, why was I getting automatic Undelivered reports but when manually sending emails I would get ‘blablabla relay=none, delay=20, delays=0.12/0.03/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=mail1.eircom.net type=MX: Host not found, try again)’?
Well, I’ll spare the details because I spent so many bloody hours on this but the gist is this: when I read that relayhost should be smtp.isp.bla, I assumed that I should write down the smtp server address I use to send emails, i.e. mail1.eircom.net. Turns out I was wrong. Should just be relayhost = eircom.net — found that out while trying to telnet into eircom.net using port 25… I’d probably never have found it if I hadn’t reached the drone stage where I just try and try and try stuff, even the stupidest things that I’m sure won’t work but try anyway just-in-case. Knowing this, this post on Ubuntu-forums probably was enough to get the thing working in the first place. And the Undelivered report were there because in the lack of relay, I think Postfix tries to use the smtp server of the recipient (which gmail doesn’t like much).
I now receive a report every day that tells me that some dumb ass has tried 200 logins on my server, thus I’m off looking at how to configure ip tables to blacklist them automatically… This looks like a good starting point.

Subversion
December 18, 2007I installed Subversion on my desktop last Sunday, mixing the approach in this tutorial with stuff from the Subversion book (which I intend to fully read in the coming weeks, good stuff!). The tutorial on its own didn’t cut it for me because I program from my laptop just as often as from the desk box, so now I shouldn’t have to scratch my head any more as to where is the latest version of my code. There’ll probably be some problems with the University firewall comes next February but I’ll deal with it then. I’ve started reading the O’Reilly book on SSH and port forwarding might do the trick. I’m taking that one with me on the plane so I’ll know more tomorrow!
I’m such a sucker for O’Reilly books, can’t wait to be back from my Christmas holidays so I can use their “3 books for the price of 2″ discount. I want to buy the Llama book on Perl, the PHP Cookbook and I’m not too sure about the 3rd, probably an Apache book. The one that’s the closest to what I want is pretty outdated though, and I’m not sure I know enough to really benefit from a cookbook.
I’ll see.
To go back to svn, I’m not too sure I chose the best design for my infrastructure — created a user ’svn’ with close to no privileges that hosts my repositories, and is in charge of the cron that launches the svnserve daemon. It’s working fine, I’ll see in the long run what was wise and not-so-wise in doing it this way.