Computers Archives

29 November 2006

Memes

Every now and then a so-called "meme" catches my eye. The word meme is supposed to mean:
  meme
      n : a cultural unit (an idea or value or pattern of behavior)
          that is passed from one generation to another by
          nongenetic means (as by imitation); "memes are the
          cultrual counterpart of genes"
but in reality tends to take the form of a link to a vaguely amusing web-site, often hosting some kind of quiz or test. The spread of a meme through the blogosphere can often be very rapid. I tend to come across them on planet.debian.org. There is certainly no element of passing from generation to generation!

Some guy is attempting to measure this wildfire phenomena by encouraging people to link to his article on the subject. Join in if you like!


Posted by Robert Hart | Permanent Link | Categories:: Computers

21 September 2006

OSM wallpaper

Although I haven't blogged about it yet, I've been spending a lot of my free time lately working on the open street map project. This basically consists of wandering around with a GPS device, and then later tagging the recorded trace so that it can be used, for example, as a street map. The map for Bath is coming along well, and I'll probably post some images when it lacks some of the rather obvious holes that it has now (you didn't want to go to Weston did you?).

One thing that has fascinated me though is the little thumbnails the project generates for each trace uploaded to their website. These take various different forms depending on the type of journey being undertaken. I thought it would be fun to make some desktop wallpaper out of them. The standard colour-scheme is black on white but I imagine some people will prefer white on black.

I guess because the images use OSM data they are licensed under a CC BY-SA license.

Let me know what you think. I'm sure a bit more creativity wouldn't go amiss....


Posted by Robert Hart | Permanent Link | Categories:: Computers

Automatical Solitaire playing program

I've been working on an automatic solitaire playing program, that interfaces with Windows Solitaire.

To use it, launch Solitaire (it works with both the W2K and WXP versions of Solitaire, although currently it only does "deal one" and it can't cope with the Astronaut deck (because it doesn't have a black border)). Then press "Step" and it will play a single move, or "Run" and it will play for a maximum of 200 moves, or until it Resigns (after dealing 20 cards in a row with nothing else to do).

When it has finished, it will show a textual version of the game layout, and a log of the moves it made. In the text grid, C, D, H, S, stand for the four suits (Clubs, Diamonds, Hearts, and Spades respectively), R and B stand for unknown red or unknown black, and X, J, Q, and K, for 10, jack, queen, king, and so on. It isn't brilliant at detecting the suit of a card, but it doesn't (yet) use anything other than the colour and rank to work out moves.

Currently it plays using some fairly simple rules, so it will sometimes give up on winnable games. When it does win, it tends to complete the game in around 2 seconds, (Watching it play makes me ill, because the cards flicker around so much) however under the standard scoring scheme, the maximum bonus you can get is to complete in 30s (bonus = 700000/time if time >= 30). This gives a highscore of around 23833 (assuming 500 non-bonus points).

There are plent of bugs. e.g. It doesn't yet notice when it's won.

PlaySol.exe PlaySol.zip (includes runtime dlls) source


Posted by Robert Hart | Permanent Link | Categories:: Computers

12 April 2006

New home

As I am no longer at University of Nottingham it seems prudent to find an alternate place to host my web page. This page is therefore now being mirrored at www.bathterror.free-online.co.uk.

The new home has some advantages over the university hosting — statistics, php, cgi (and shell access to the cgi servers). Main downside is that I can't rsync the pages or ssh to the actual web server. I'm tempted to host the entire site on the cgi servers, but that would seem to be taking liberties.

The existing site will remain active for some time I guess.

UPDATE:

lftp seems to be able to fit the "rsync over ftp" gap. Obviously not as efficient, but does good enough for my needs. Also I'm interested in ideas for a better name/url for my site. Needs to be a bit more professional than "bath terror" or "brother rat"...

Posted by Robert Hart | Permanent Link | Categories:: Computers

02 November 2005

Spam, spam, glorious spam

My spam folder now contains 50,000 junk e-mail messages. This works out at 83 messages a day or one message everry 17 minutes, since I started automatically filtering spam messages back in March 2004 (600 days ago).

Posted by Robert Hart | Permanent Link | Categories:: Computers

23 October 2005

Just for fun

Well for various reasons, penrah has had a 3Gb /var which was followed (on disc) by an empty 10Gb partition that used to be /home (home got moved some time ago to a 30Gb partition that used to be that other operating system)

As /var would occasionally fill up (especially during large apt-get dist-upgrades) it seemed logical to extend /var to cover all that free space. However, I didn't want to disrupt my 202 day uptime record in the process did I?

Also just to add a bit of spice to it, I decide to perform this "slight tweak" from home over ssh (and a wireless link for that matter -- what was I thinking!!)

Amazingly it turned out to be surprisingly easy:

  1. Close down programs using /var: This was virtually every service on the box, samba, cron, inetd, apache, ntp, and so on. Did require a bit of lsof | grep /var combined with some head scratching.
  2. umount /var and /usr/local (which was the only partition after /var and the defunct /home and would get a new number once the change was complete) and /usr/local/share/music (for obvious reasons)
  3. Use parted to resize the partition. Unfortunately parted thinks my /var partition has an unusual layout and refused to resize it. I therefore took careful note of the start and end sectors and deleted it and the old /home and created a new partition that started at the same place. The kernel even reread the partition table (bear in mind /, /usr and /home are all earlier on the same disk)
  4. edited /etc/fstab to reflect the new partition numbers. I suspect disk labels or such like would make this easier, but this box was installed four years ago now, and I don't think that was how things worked in those days.
  5. used ext2resize to grow /var to fill the new partition.
  6. fsck /var just to be sure. Actually the most time consuming part of the process.
  7. remount and restart everything I'd stopped. (except for all those things I didn't really need)
In total syslogd was down for 30 minutes, and it probably took longer to write this blog entry than do the resize. I now have (reordered for clarity):
Filesystem            Size  Used Avail Use% Mounted on
/dev/hdb5             958M  364M  546M  40% /
/dev/hdb7             7.6G  5.7G  1.6G  79% /usr
/dev/hdb1              28G   13G   14G  48% /home
/dev/hdb9              13G  2.4G  9.2G  21% /var
/dev/hdb8              63G   57G  2.8G  96% /usr/local
/dev/hda5              29G   26G  1.2G  96% /usr/local/share/music
/dev/hda1             9.8G  6.5G  3.4G  67% /mnt/windows
tmpfs                 633M  4.0K  633M   1% /dev/shm
none                   10M  2.6M  7.5M  26% /dev
//wenacl1/enxrah       95G   93G  1.8G  99% /mnt/wenacl1
//wenacl2/enxrah       95G   90G  4.6G  96% /mnt/wenacl2
Most of /usr/local is symlinked into /home/enxrah so I guess the situation still isn't perfect, but it'll do.

Posted by Robert Hart | Permanent Link | Categories:: Computers

17 October 2005

KDE vs. GNOME

GNOME logo KDE logo I got it into my head a week or two ago that I wanted to give KDE a proper try. I've long been dismissive of KDE for various reasons: QT was non-free, KDE was not part of Debian, it didn't look very pretty when I last tried it (for all of 5 minutes), its applications are slow to start and bloated with configuration options. That sort of thing.

As a long time GNOME user (5 years I reckon) I've been reasonably happy with it, but recently I've been becoming aware of some of its deficiencies, and given that free software is about "freedom" rather than blind faith, figured it would be good to get an proper understanding of what the other side has to offer.

  • First impressions — to be honest I was a little overwhelmed. The first thing I needed to do was configure a few things so that they suit me. For anybody used to GNOME, the KDE Control Centre is like a very bad dream - it actually needs a special "search" facility to let you find the options you want to change! It does however have all those options that you wish they hadn't got rid of in GNOME.
  • Applications — so far I've really used three: juk (in place of Rhythmbox), akregator (in place of liferea) and konqueror (in place of firefox). The are other programs for which I couldn't find a direct replacement (e.g. gaim) or for which I'm less keen to jump in at the deep end with (i.e. evolution) but these seem to run adequately within the KDE setup.
    • Juk: I like juk a lot. It does everything Rhythmbox does and all those things that I want that Rhythmbox doesn't do: displays a pop up on track change; it has a jukebox style of operation (i.e. play through this list of tracks, which I might be adding to, but then revert to random play of the whole collection); and it does something reasonably sane with album art (just a shame it doesn't have an option to look for jpeg files in the same folder as the mp3s!)
    • akregator: I'd be hard pressed to notice the difference between this an liferea. It was a simple matter of importing my liferea feed list, and it's basically `just worked' ever since. I think it displays the html better than the gtkhtml backend for liferea, and the viewer is better integrated than the mozilla backend. I do slightly miss the virtual folder support, but it was never that great anyway.
    • konqueror: The nice thing about konqueror is that it is better integrated than firefox is (but that's obvious because firefox isn't a gnome application). Haven't really had time to delve into it much. I will need to work out how to import (and preferably sync) my bookmarks and how to enable type-ahead find, which I don't see how anybody can live without.
  • Overall — I intended to run the trial for one week, and fully expected to be switching back to my beloved GNOME at the end. As it turns out, it's been a lot longer than a week since I started this experience, and although I wouldn't say I'm hooked, I am finding myself growing used to KDE. I installed it at work (just to get juk) but whenever I next get around to logging out (according to w my gnome-session has been around for nearly two month!) I will probably give KDE a go there as well.

Well, that's it for now. I may post an update at some point.


Posted by Robert Hart | Permanent Link | Categories:: Computers

04 October 2005

uptime

penrah (my work computer) has now been up for over six months!
$ uptime
 11:26:33 up 182 days, 18:56, 14 users,  load average: 1.99, 1.85, 1.29
This beats my previous record of 180 days, and unlike that time, there are no pressing reasons for a powercycle anytime soon. (In the last four years I've moved office on three occasions, and the power to the building has been cut at least 3 times)
$ ud -d
One  : 182 day(s), 18:56:20 running Linux 2.6.11.6, ended Tue Oct  4 11:25:57 2005
Two  : 180 day(s), 18:00:11 running Linux 2.6.0-test1, ended Wed Jan 21 16:36:17 2004
Three: 170 day(s), 00:11:45 running Linux 2.4.18, ended Fri Aug 16 13:16:00 2002

Posted by Robert Hart | Permanent Link | Categories:: Computers

07 September 2005

Image reconstruction

Reconstituted poster

This is my attempt to solve the LGP competition where an extra pixel is revealed in this image every second.

I'm not sure what it is. It appears to be a 4x4 grid of sub-images that I haven't worked out exactly how to rearrange, but there are various things that looks sort of "space flight-ish" could be my imagination tho.


Posted by Robert Hart | Permanent Link | Categories:: Computers

10 June 2005

penrah gets cracked

I discovered that my work computer (known cryptically as penrah) had been broken in to by a cracker coming from a Romanian ISP.

The situation was partly my fault. I had sometime ago created an account to allow my brother to ftp some large files to me, and left it with an insecure password. The intruder was in the process of scanning for further vulnerable accounts, and setting up an IRC bot of some kind. I think they would have been thwarted by the university firewall, and I discovered the intrusion pretty quick.

The moral of the story is never ever choose easy passwords.


Posted by Robert Hart | Permanent Link | Categories:: Computers

10 June 2005

kcachegrind

kcachegrind screenshot

Had a little bit of fun optimising gnuplot for reading large matrices of numbers. To cut a long story short, the existing code uses sscanf() which turns out to be up to ten times slower than strtod(). The whole situation is made IMHO overly complex due to the need to support a wide range of legacy platforms, and the unusual (by ANSI C standards) number formats of FORTRAN. I think I saw an article on slashdot not so long ago, that seemed to think that sort of thing will be the death of free software.

In the process of doing all this, I discovered kcachegrind which is a graphical utility for examining the call profile of an application. This made it incredibly easy to narrow the hotspot down to a single line of code in gnuplot.


Posted by Robert Hart | Permanent Link | Categories:: Computers

02 June 2005

liferea

Screenshot of liferea For a while recently, I've been aware of the number of sites that now provide RSS feeds. Since starting this site, I've become all the more aware of the phenomenon, and wanting to get onboard. Today's LWN had a bit of a roundup of linux RSS aggregators, so I've apt-get install liferea and am giving it a go.

Posted by Robert Hart | Permanent Link | Categories:: Computers

28 May 2005

ndiswrapper

I've been using ndiswrapper on my two machines at home (euclid and mobius without too much hassle, however after rebooting euclid today, the ndiswrapper kernel module simply failed to start.

The problem turned out to be something to do with some kind of mismatch between the kernel module and the userland utils, although the error message was completely cryptic (as usual). Thankfully I happened to have the source code for the debian packages lying around, so I avoided the usual Catch-22 with getting network drivers.


Posted by Robert Hart | Permanent Link | Categories:: Computers

Thu May 26 20:16:26 BST 2005

Time to smarten up my website

Well, I've had a rudimentary website since 1996 I reckon, long before the term blog even came into being. I've always been happy to do it the homebrew way, but I thought I'd give something a bit more polished a go. This is nanoblogger which seemed to meet my requirements.
we shall see....

Posted by Robert Hart | Permanent Link | Categories:: Computers