August 28th, 2009 | Categories: Gentoo | Tags: , ,

When using trac under Gentoo, the location of the pre-commit and post-commit scripts changes every version. In addition, I have multiple repositories. Together this makes for annoying maintainance every time I create a new repo or upgrade trac. The solution? Shell scripting magic:

# Repo path is in format: /home/allenjb/allenjb.me.uk/svn/<project>
# Trac env path is in format: /home/allenjb/allenjb.me.uk/trac/<project>
# PROJECT contains the <project> name
PROJECT=`echo ${REPOS} | cut -d "/" -f 6`
TRAC_ENV="/home/allenjb/allenjb.me.uk/trac/${PROJECT}"
# TRAC_VER contains the trac version
TRAC_VER=`trac-admin --help | head -n 1 | sed -e 's/^\([^0-9]*\)\(.*\)/\2/'`

/usr/bin/python /usr/share/doc/trac-${TRAC_VER}/contrib/trac-post-commit-hook -p "$TRAC_ENV" -r "$REV"

August 18th, 2009 | Categories: Random Raves | Tags: , , ,

I can’t believe people are this stupid. I really can’t. My dad hit yet another broken mail server today.

The following is the error message recieved (culprit email server / addresses replaced with example.org for obvious reasons – server2.alteredperspective.co.uk and apserver.co.uk are both aliases for the same machine – the sending email server, which is a valid listed server for the sending domain):

This is the mail system at host mail.apserver.co.uk.
>
> I’m sorry to have to inform you that your message could not
> be delivered to one or more recipients. It’s attached below.
>
> For further assistance, please send mail to postmaster.
>
> If you do so, please include this problem report. You can
> delete your own text from the attached returned message.
>
> The mail system
>
> : host
> mailserver.example.org[xxx.xxx.xxx.xxx] said: 554 Service
> unavailable; Client host [server2.alteredperspective.co.uk] blocked
> using
> Barracuda Reputation;
> http://www.barracudanetworks.com/reputation/?r=1&ip=81.101.61.148 (in
> reply
> to end of DATA command)

Now, 81.101.61.148 isn’t the IP address of server2.alteredperspective.co.uk – it is the IP address of my dads home connection, which being a home connection had been automatically added to many blacklists and is also liable to change randomly and without warning.

Basically, the receiving mail server is blocking emails from a valid listed server for the sending domain because the mail was originally sent directly to the valid listed server, which is not an open relay, on an authenticated connection for the sole reason that the originating sending client is on a home connection.

This is sooooo broken I just don’t know where to begin ranting.

I can’t remove the IP of the home connection – I tried that before – it goes straight back on there, or the IP changes, and we’ll hit it again a short while later.

The only thing I can do is to ask the recipient mail server admins to fix their server configuration.

You’ll also notice that for extra bonus points, the admins haven’t even changed the mail server admins email from the default ‘postmaster’ in the error message. I have a sneaking suspicion that the request to fix the mail server is going to end up in /dev/null (or just as effective, a postmaster folder that is never checked).

Update: I have now learned that a particular peice of software, Barracuda Spam Firewall, is a main perpetrator of this breakage of the email system. I highly recommend nobody uses it, and anyone who does stop using it immediately. The stupid breakage described above will cause far more false positives than blocked real spam and will frustrate your business contacts. Fortunately for my father, he has me to sort out this crap. Others may not be so lucky.

August 17th, 2009 | Categories: Java, Linux, Programming | Tags: , , , , , ,

Some fun with my Trac installs today. First of all, I converted them all to use the inherited .ini file, which avoids fun with “Why isn’t this change having any effect – oh, it’s not even looking at that!”

I also set up non-SSL access to the trac installs, and with a bit of rewrite magick, have it force logged in users to use SSL. This is actually pretty easy – set “secure_cookies=True” in the trac.ini, then setup the following rewrite rule in the non-SSL virtual host:

RewriteEngine On
RewriteRule ^/([^/]+)/login https://trac.allenjb.me.uk/$1/login [L]

Logging in now always redirects to the SSL address, and the cookies are only valid for SSL. (Don’t forget to clear any existing cookies)

For some strange reason, the Icekap trac instance had decided to randomly corrupt itself – it continually claimed it needed upgrading while trac-admin said it didn’t. I solved this by, in the trac installs directory:

mv icekap icekap.bak
../trac-create icekap "Icekap" nosvn
cp icekap.bak/db/trac.db icekap/db/
cp icekap.bak/conf/trac.ini icekap/conf/

trac-create is my own script which optionally creates an svn repo, then creates the trac instance for it – params are: directory “Project Name” [nosvn]

The PPF MediawikiRC plugin has been slowly progressing – it can now handle delete actions nicely, as well as marking minor changes and new articles. There’s probably lots it’s still missing (for example, user blocks is one thing I know it could have extra handling for), but I plan to implement these on a “when I can be bothered” basis now – it’s “good enough” for what I use it for at the moment and I’d rather move on to other projects.

August 10th, 2009 | Categories: Java, Programming | Tags: , , , ,

I’ve coded up a module for the Java IRC Bot framework PPF that uses Mediawiki’s api.php to provide live “RecentChanges” to an irc channel. It’s available in my Misc Projects repository.

It’s very rough at the moment, but I plan to make some improvements (for example, currently on the list are: moving stuff like frequency and output format to the config file, ability to have per-wiki configs, commands in the style of FeedReader for manipulating subscriptions).

I’d like to provide links (directly to the changes) as well, but I’ll have to look at how difficult this will be as they don’t appear to be provided nicely.

July 8th, 2009 | Categories: Random Raves | Tags:

Teacher write racy novel to gain interest of disaffected pupils – Seriously, we need more teachers like this!

The headline for this story should be something more along the lines of “Heroic teacher does a proper job! (and gets suspended for it)”

June 19th, 2009 | Categories: Uncategorized | Tags:

I now have a 2:2 in BSc Computer Science with a Year in Industry. Considering how badly I can do in exams, I am quite happy with this result. Won’t get full results for a short while yet, but getting that result is a weight off my mind.

Congrats to everyone else getting their results. Hope you get what you wanted.

Edit: CV updated. I’ve also fixed the broken download link on this site.

Rant: Why do Monster and other job sites not allow PDF uploads? I had to use a Windows machine to get test the RTF export to make sure it looked OK.

June 17th, 2009 | Categories: KDE, Random Raves | Tags:

I’m fed up! I’m sorry, but I just don’t buy it. MAYBE it worked with the .0 release, but anything above x.0 IS NOT a preview / beta / release candidate. KDE 4.2.4 is the real, proper, full up released version of KDE. Amarok 2.1 is the real, proper, full up released version of Amarok.

The KDE fanboi’s (and frankly, I think it is just the fanboi’s who are still trying to use this excuse – looking at the KDE blogrolls I don’t see the devs using it any more) need to stop falling back on this excuse. NO ONE else tries to use it, and I don’t understand why they insist on trying to use it. It’s really getting old now.

KDE had all the features and stability (from my point of view, as a user) and they went and decided to throw away almost the entire codebase in favor of SHINY! What’s worse is they concentrated on new features before getting the really basic stuff which KDE3 does really well right.

The same for Amarok 2 – the developers concentrated on their stupid shiny new UI which doesn’t even work properly before getting back even a tiny amount of the functionality that makes me use Amarok 1.4 over any of the other umpteen million other media players.

I don’t think I’ve seen anyone else do this to this degree with desktop software. The first thing developers do when they do a major rewrite (and thus a major version bump) is get the product roughly on par with its predecessor in terms of features. THEN they concentrate on shiny new features. Why is this so hard for the KDE devs to grasp?

Edit: I am not saying anything (major) is lacking in KDE 4.2 – this is basically a rant about the excuse used by many whenever someone does come up with something that’s missing.

For the record, the features I am noticably missing in KDE 4.2 are:
- Plasma still crashes occaisionally (I think this may be related to downloaded plasmoids, but plasma should still sanely handle issues so my entire desktop doesn’t stop responding with no messages telling me why)
- No ability to put spaces between icons placed on a panel
- No run panel widget
- No nice small, clear memory/cpu panel widget like the KDE3 system monitor applet (there doesn’t seem to be a memory usage widget at all. I wonder if that’s so the devs can keep perpetuating the (from my experience) myth that KDE4 uses less memory)
- Memory usage is noticably greater than KDE 3.5 (as measured at hibernate time on my laptop – My laptop may have been upgraded to 2G from 512M at xmas, but the memory usage affects the time it takes to hibernate/resume my laptop)

June 16th, 2009 | Categories: KDE, Random Raves | Tags:

So I’ve just installed Amarok 2.1. Configured my collection location easy enough, downloaded the alarm script from the scripts library (haven’t tried it yet) and now I set about making it look how I want. I know exactly how I want Amarok 2 to look: Exactly like Amarok 1.4.

I like my spreadsheet layout. It works perfectly for music management. I skipped 2.0 because it had no spreadsheet layout and we were promised it in 2.1. Except it isn’t there. You’re still forced into the 3 pane layout that tries to shove everything the world knows about the currently playing track down your throat.

I almost got rid of the 3 pane layout. When the left pane (collection / playlists / etc) is hidden, you can drag the splitter bar all the way to the left and the “now playing” pane disappears. Then I opened the collection pane again. *poof* The “now playing” pane rears its ugly head again.

I hope this is a bug, and that it’ll be fixed in the next update, but at this point I wouldn’t bet my life on it.

I then went to the playlists to set up the same dynamic playlists I have in Amarok 1.4 (”Everything” and several label-based lists that I switch between depending on my mood). While looking around, I did something which made Amarok very angry (whoring the CPU) and froze the UI. This is 2009 people: USE ANOTHER THREAD AND INFORM ME WHAT YOU’RE DOING!

After several long minutes, Amarok finally came back to life and I continue my investigations. There’s no “entire collection” playlist. There’s no label based dynamic playlists. What we have instead is some weird bias stuff I don’t understand (and have no inclination to learn).

On a hunch, I get a track into the playlist and get into the “Edit track details” window. There is no labels tab. I check the other tabs. There are no labels. Well done devs. Another useful feature dropped.

So I won’t be moving my main desktop to Amarok 2 yet, because yet again the KDE developers have delivered something that’s half finished and missing useful features which were there in previous incarnations. To me it seems they’ve gone all gooey-eyed over how shiny it looks without a care in the world that people actually want some functionality out of it.

I really wish I had the time to fork some of these projects (or rebuild them from scratch) and do it right. Amarok joins the KDE desktop on the list of projects I’d fork if I had time, both for the same reasons: OOOOHHHHHHH SHINY! What? You want to actually use our application? You don’t need to use it! Just sit back and enjoy the SHINY!

Edit: All posts which recommend any media player which doesn’t have label-based dynamic playlist support will be deleted. This is the one key feature that I love about Amarok 1.4 and I won’t be moving to any media player that doesn’t have it.

May 13th, 2009 | Categories: Gentoo | Tags:

Came up with a short script that returns the last time @world is mentioned in /var/log/emerge.log.

date -d "1970-01-01 `grep @world /var/log/emerge.log | tail -n 1 | sed -e 's/:.*//'` sec" +"%Y-%m-%d %T %z"

Obviously you may want to modify this slightly (for example, to ignore –pretend), but I hope this will give anyone looking to script this sort of information a good starting point.

For people who use the –ask option, you’ll want to use the following, which filters out occasions where “emerge –ask @world” was run, but the user then cancelled the actual merge (answered with “no”). As you can see I also split out the command which greps the timestamp to use, for easier reading:

TIMESTAMP=`grep @world /var/log/emerge.log -A1 | grep '>>>' | tail -n1 | sed -e 's/:.*//'`
date -d "1970-01-01 ${TIMESTAMP} sec" +"%Y-%m-%d %T %z"

Also note that this version relies on users using the set notation (@world instead of just world) – but once 2.2 is out everyone will be doing that anyway (and I think set notation does work for current stable portage for the built-in sets).

May 11th, 2009 | Categories: Gentoo | Tags:

The Gentoo developers are doing one of their regular-ish status report runs. I’ve summarised the reports at http://en.gentoo-wiki.com/wiki/Projects_Status

This is a great way to get an idea of what different development teams are currently working on and where they need help.

Direct links to the original thread and project homepages can be found on the above mentioned article. There’s a forum thread at http://forums.gentoo.org/viewtopic-t-763205.html