East of the Sun, West of the Moon


Bah, humbug

Filed under: Humo(u)r — Erwin @ 6:18 pm

*grumble* Alias finished … *grumble* Bones cliffhanger … *grumble* Boston Legal cliffhanger … *grumble* Charmed finished … *grumble* Criminal Minds cliffhanger … *grumble* Lost cliffhanger …

Still have some Commander In Chief episodes (which apparently starts back up next week) we haven’t watched, and Doctor Who isn’t over yet… I think, and of course we record re-runs from several series, but hey Sci-Fi, hurry up with the episodes of Battlestar Galactica and the two Stargate series already!

*twiddles thumbs*


Need for speed

Filed under: General — Erwin @ 7:03 pm

It must be that time of the year already again, here’s yet another typing speed test:

The exercise was

A chicken dinner that you consumed en route from Columbus to West Palm Beach was probably not prepared at some monstrous kitchen at the airline’s hub in, say, Detroit..The idea is to keep the kitchens as local as possible..Selecting the proper catering services for international flights is of special concern when you consider that cultures vary on food standards.

You typed

A chicken dinner that you consumed en route from Columbus to West Palm Beach was probably not prepared at some monstrous kitchen at the airline’s hub in, say, Detroit. The idea is to keep the kitchens as local as possible. Selecting the proper catering services for international flights is of special concern when you consider that cultures vary on food standards.

Your accuracy was impressive.

Your speed was 72 WPM

Wheeee! Next!


Filed under: Humo(u)r,News — Erwin @ 6:12 pm

…good, or bad. See for yourself.

The Finnish (YouTube.com) submission to last weekend’s Eurovision Contest that walked away with the prize give you an indication why it is both considered horrifying and greatly amusing, to a lot of people. I’m almost sorry I couldn’t see it this time. 😉


Habla Ingles?

Filed under: News — Erwin @ 5:40 pm

This just caught my eye in the BBC News feed:

The US Senate has voted in favour of making English the national language. <…> But the Senate also approved a milder Democrat amendment describing English as the “common and unifying language”. Neither of the bills would bar the use of Spanish or other languages in government services.

Some will say that that was about 200 years overdue, others will glare at you for saying that and call you a racist. Frankly, I didn’t even know the US didn’t have an official language until a few years ago when M pointed it out to me. Supposedly this is something every US kid learns in school but having heard some statements from people calling into radio shows, that doesn’t always sink in apparently.

I’m going to go with the group that’s in favour of English being the official language of choice. I grew up (although I was born elsewhere) in Friesland, a province in the Netherlands where there are two official languages (Dutch and Frisian) and while at the time I picked up enough that I could understand and read Frisian, that was never enough to keep up with actual conversations and certainly don’t expect me to say (or worse, write) something in the language.

Where having two official languages goes awry is where you run into people stubbornly speaking the one you’re not fluent in or, not being from the Friesland province, don’t understand a word of it at all. If you’re a tourist in the area, that’s something you might expect and prepare for, but that isn’t always the case. Having no official language at all can only be worse, I would think.

Add to that the fact that, sure, a lot of people learn to speak some foreign language when they’re in school, but most of them will never be fluent in it and unless you practice regularly that only gets worse. Do you remember any of the French, German, Italian, Spanish, etc, that you took in high school (or its moral equivalent elsewhere)?


Scripting fun

Filed under: Software — Erwin @ 10:33 pm

My music (mp3, ogg) collection is in desperate need of cleaning up. In the past several years I’ve moved it, copied it, merged it, and the end result is that I have a ton of duplicate files filling up my harddisk and it’s nearly impossible to track them all down manually. Add to that the fact that iTunes has, in the past, been less than stellar about keeping obvious duplicates out, so I have a lot of Some Track Name.mp3, Some Track Name 2.mp3, etc.

To weed out the most obvious, I’ve taken the following approach:

Pass 1:

find iTunes/ -type f -iname '*.mp3' -print0 | xargs -0 -n1 md5sum > audio.iTunes.md5

That calculates an MD5 hash of every single file in the iTunes folder (which is NFS mounted so I could do this on the actual Linux server without slowing down the OS X desktop noticably).

Pass 2:

cut -d' '   -f1 audio.iTunes.md5 | sort | uniq -c | sort -nr > audio.iTunes.md5.dupes

This takes the first element of each line in the output of the previous pass, sorts them so that identical entries can be spotted in a row, then count how many there are of each, and finally sort the result by putting the ones with the most dupes at the top.

That gives you a file that looks like this:

      3 ff836b651908cced484d7b1da5d3257f
      3 f85e0cc4268fd65688f3cbfed683fe2a
      3 f5b0f3b3595b56285e60a4182e6c47c4
      3 f4bcde670ab14abaa2836e4b562f8a0f
      1 0023360976f48c6d71fd6e9e988d37a1
      1 00222cdd9cd524655caad5ad99976d0f
      1 001aa7e984e0f75d9fef22fa76ea3008
      1 0004e4b2dd2534a971314e1da21a5bf2

Exciting, huh!

Follows pass 3:

egrep -v '^      1 ' audio.iTunes.md5.dupes  | cut -c9- > audio.iTunes.md5.dupes.2

This first To filter out the ones that start with ” 1″ which aren’t actually duplicates, while at the same time narrowing it back down to just the MD5 checksums.

Now the last pass:

while read md5; do
    echo "$md5:"
    grep $md5 audio.iTunes.md5 | cut -c33-; echo ''
done < audio.iTunes.md5.dupes.2 > audio.iTunes.md5.dupes.list

I actually did this on one line originally but for readability (ahem) I spread it out a bit. It takes the list of MD5 checksums of actual duplicates, then for each one of those finds which files matched.

This is where I stop scripting things because I don’t want to accidentally remove the wrong duplicate, but I could imagine that someone would take the above while-loop and instead of creating an overview file, remove all but the first grep result for each MD5. I’ll leave that as an exercise to the reader. 😉



Filed under: Software — Erwin @ 1:19 pm

Kalle wrote in a comment:

Btw, funny that your thing claims CLI is “Common Language Interpreter”. It’s also Command Line Interface, and that’s an official acronym IIRC.

Unfortunately there’s no such thing as an official acronym. For instance here’s a few picked from online dictionaries:

  • Command Line Interface
  • Call-Level Interface (database lingo)
  • Class Library
  • Clear Interrupt (assembly)
  • Common Language Interpreter

And then some that turn up from a bit of online searching:

As for my thing, that’s the Acronym Replacer that I picked up from Huddled Masses and CLI must have been on its initial list, I wouldn’t have chosen that definition myself. 🙂

Edited: Fixed stupid typo.



Filed under: Software — Erwin @ 4:11 pm

I’m trying out Pastor, an OS X application for keeping track of passwords (and other things, but I’m not, yet) for various accounts I have online. So far, so good.

Yesterday I ran into a bug(let) and was pleasantly surprised by the turn-around time of my emailed bug-report. Here’s the time-line:

8:58 AM My email sent.
9:04 AM Initial reply from programmer.
9:06 AM Confirmation of bug behaviour.
11:39 AM New version available for testing.

Keeping in mind that the programmer of this piece of software is located in Germany, making it 7 hour later where he lives, that was very nice response time. Thumbs up!


In debt

Filed under: News — Erwin @ 3:34 pm

Reading an article in The Guardian:

On an individual and a government level America is spending way beyond its means. The average American household now owes $8,000 in debt on credit cards alone. Meanwhile the government equivalent of credit card spending has seen the deficit hit a record $423bn. With the war in Iraq showing no sign of ending and the imminent retirement of millions of baby boomers, there is little ability – or some might say, will – to pay that money back.

Eight thousand on average! Ouch.

I haven’t checked recently but I’m quite sure that putting car loans and retirement savings and such opposite of eachother, M and I are in the clear. We certainly are if we only look at credit cards. Are you, or are you one of these average American households?


Time is on my side

Filed under: OS X,Software — Erwin @ 10:49 pm

Large parts of the internet are kept in sync with eachother using NTP which stands for Network Time Protocol. Ideally you will point to one or two servers that are (in network terms) nearby and those will either rely on other servers, and so on, until you end up with one that actually keeps track of time with an atomic clock or by listening to its signal.

The general idea behind the protocol is that starts with checking the upstream servers relatively often, then slow down as the software figures it is approaching what it considers the ideal line. The default setup for the Debian ntp-server package is to use a lower limit of 64 (26) and an upper limit of 1024 (210) seconds, but if your machine is on all the time anyway it should eventually be stable enough to only check every couple of hours, and the package supports that! All you have to do is add maxpoll <value> to your server entries in the /etc/ntp.conf file where the value given is the power of 2. So the default is 10, but you can go as high as 17, which will eventually give you a poll interval of a day and a half (36.4 hours)!

I’m actually surprised that the Debian package doesn’t even ask about a higher maxpoll value as that would’ve been the first thing I would’ve increased if I’d realized it was there sooner.

Compare this to Apple (whose OS X installs default to using ntp.apple.com and they probably want to avoid having it be flooded with NTP queries) uses a minimum poll interval of 12 (or 4096 seconds) and the highest possible maximum poll interval. Apparently they still need 4 servers to keep up with all the OS X installs actually doing so!

Oh, and if you pick a server to sync with this way, be sure to choose it The Right Way ™ and not the way Netgear, SMC and D-Link did (or still do, until the firmware of these devices are updated, if ever). The right way would be to pick one from the appropriate pool, of course. In my case, since I’m in the US, that means I use this bit in my /etc/ntp.conf file:

server 0.us.pool.ntp.org maxpoll 17
server 1.us.pool.ntp.org maxpoll 17

I didn’t look for documentation on it but I assume that the numbered sub-pools are because they split them. That will prevent the situation (which I actually ran into a few times) where you use two or more entries like server us.pool.ntp.org in your configuration for increased reliability and (un)helpfully get the same server twice. 😉

Ok, time for dinner, later!

Powered by WordPress