Unfair criticism

October 31st, 2010

Friends and family sometimes tease me because of their belief that I can’t cook.  

This is of course ridiculous.

I have a 100% success rate on all recipes which begin ‘Remove outer packaging and pierce film lid’…

Flushing your DNS cache

October 31st, 2010

OK – a really geeky little tutorial, this one. If you’ve never felt the urge to flush your DNS cache, then don’t worry, that’s quite normal, many people live long and happy lives without ever doing so, and you should feel free to ignore this post and go about your other business.

A little bit of background…

DNS lookups, as many of my readers will be aware, are cached. The whole DNS system would crumble and fall if, whenever your PC needed to look up statusq.org, say, it had to go back to the domain’s name server to discover that the name corresponded to the IP address 74.55.156.82. It would need to do before it could even start to get anything from the server, so every connection would also be painfully slow. To avoid this, the information, once you’ve asked for it the first time, is probably cached by your browser, and your machine, and, if you’re at work, your company’s DNS server, and their ISP’s DNS server… and it’s only if none of those know the answer that it will go back to the statusq.org domain’s official name server – GoDaddy, in this case – to find out what’s what.

Of course, all machines need to do that from time to time, anyway, because the information may change and their copy may be out of date. Each entry in the DNS system therefore can be given a TTL – a ‘Time To Live’ – which is guidance on how frequently the cached information should be flushed away and re-fetched from the source.

On Godaddy, this defaults to one hour – really rather a short period, and since they’re the largest DNS registrar, this probably causes a lot of unnecessary traffic on the net as a whole. If you’re confident that your server is going to stay on the same IP address for a good long time, you should set your TTLs to something more substantial – perhaps a day, or even a week. This will help to distribute the load on the network, reduce the likelihood of failed connections, and, on average, speed up interactions with your server. The reason people don’t regularly set their TTL to something long is that, when you do need to change the mapping, perhaps because your server has died and you’ve had to move to a new machine, the old values may hang around in everybody’s caches for quite a while, and that can be a nuisance.

It’s useful to think about this when making DNS changes, because you, at least, will want to check fairly swiftly that the new values work OK. There’s nothing worse than making a typo in the IP address of an entry with a long TTL, and having all of your customers going to somebody else’s site for a week.

So, if you know you’re going to be making changes in the near future, shorten the TTL on your entries a few days in advance. Machines picking up the old value will then know to treat it as more temporary. You can lengthen the TTLs again once you know everything is happy.

Secondly, just before you make the change, try to avoid using the old address, for example by pointing your browser at it. This goes for new domains, too – the domain provider will probably set the DNS entry to point at some temporary page initially – and if you try out your shiny new domain name immediately, you’ll then have to wait a couple of hours before you can access your real server that way. Make the DNS change immediately, before your machine has ever looked it up and so put it in it cache and any intervening ones.

Finally, once you’ve made a change, you may be able to encourage your machines to use the new value more quickly by flushing their local caches. This won’t help so much if they are retrieving it via an ISP’s caching proxy, for example, but it’s worth a try.

Here’s how you can use the command line to flush the cache on a few different platforms. Please feel free to add any others in the comments:

On recent versions of Mac OS X:

sudo dscacheutil -flushcache

On older versions of OS X:

sudo lookupd -flushcache

On Windows:

ipconfig /flushdns

On Linux, if your machine is running the ncsd daemon:

sudo /etc/rc.d/init.d/nscd restart

If you’re actually running a DNS server, for example for your organisation’s local network:

On Linux running bind9:

rndc flush

On Linux running bind8:

ndc flush

On Ubuntu/Debian running named:

/etc/init.d/named restart

Know thine email recipient

October 30th, 2010

In an ideal world, you’d create and format your emails, send them off, and the recipient would see just what you meant them to see. Sadly, it’s not an ideal world. For simple messages, obviously, everything works fine, but for more sophisticated emails, it can be less straightforward.

For Mac users, in particular, it’s worth remembering that your recipients may well be using Microsoft Outlook or Outlook Express and so won’t be able to see some of the nice features that Mac users take for granted. A couple of examples:

Attachments in the middle of the email

If you know you’re sending to a Mac user, you can be reasonably sure that their email app will support the standards that allow you to insert and refer to images, documents and other attachments inline as part of the text. Microsoft users, on the other hand, will probably just see these bunched together at the top or bottom of the message. More importantly, if you put any text after them in your message, it may become a text attachment in Outlook. I have seen conversations get very confused when Mac users didn’t realise that PC users had only seen the first half of an email.

Inline PDFs

Since Macs are native speakers of PDF, some graphics apps will naturally output that format and use it, for example, when copying and pasting to other apps. Remember that a PDF, unless it has multiple pages, will embed in an email like any other image on a Mac. On Windows, even if the mail program can display inline images, PDFs will probably appear as attachments, so it’s best not to use them for putting your logo in your signature, for example.

I’m not purely criticising Outlook here; Gmail has some of the same limitations, for example, but Outlook does seem to cause more than its fair share of problems. (See the TNEF issues, for example). Nor am I saying that Apple Mail is perfect – I wish, amongst other things, that it allowed more manipulation of HTML styling. But the Apple Mail/MS Outlook differences are the ones that most people are likely to see most often, so that’s why I’m highlighting them here.

Anyway, Apple users who know they are sending to PC users should therefore probably take advantage of the options under Mail’s ‘Edit > Attachments’ menu, which let you send attachments in a more Windows-friendly way, and force them to be at the end of the message.

If, on the other hand, you’re using a Mac and you know your recipient is also likely to be using a Mac, then you can take advantage of some of these features and, for example, put explanatory paragraphs around your attachments:

But how, other than through your estimate of the recipient’s, or their organisation’s, general level of street cred, can you guess what kind of a mail program they’re using?

There are one or two things that will give you a clue immediately. If they have mysterious ‘J’ characters in their messages, for example, it’s because Outlook uses a somewhat strange, or at least very dated, method of encoding smileys, which seldom displays correctly elsewhere. For ‘J’, read :-).

But you can almost always get a definite answer by asking your mail app to show you the full headers, or perhaps the raw text, of the email message. (On Apple Mail, go to View > Message > Long Headers.)

Most email programs will insert a header named X-Mailer which will identify the source as being, for example, ‘Microsoft Outlook 14.0′, or ‘Apple Mail (2.1081)’.

If a message doesn’t have that header, then it probably didn’t come from a desktop app, and you may get a clue from other headers that it came from Hotmail, GMail, or a mailing list. The iPad Mail app doesn’t add X-Mailer, but it does identify itself in the Mime-Version, so take a look at the other headers too.

In addition to helping you plan complex email messages, I’ve used this in the past to guess whether somebody is using a Mac, Windows or Linux machine before recommending a piece of software that might not work on their platform.

Oh, for a beaker 1/4-full of the warm south…

October 30th, 2010

It seems to me that beverage manufacturers have cottoned on to how profitable homeopathy can be.

Bottled drinks seem increasingly to be pure water with hints of flavour or claims of added vitamins. And the more dilute they are, the more they cost. Isn’t it wonderful that the language provides us with positive words like ‘purity’, indicating the absence of anything else? A marketer’s dream…

[Aside: I had a drink today which boasted about its levels of antioxidants. People should know by now that antioxidants are not necessarily a good thing...]

Anyway, I sometimes wonder if you could take it to extremes and leave out the water?

I think I’ll try that. I’m going to start a company which sells vacuums in little containers. It won’t be a total vacuum, of course, because we know nature abhors that, and it must, of course, be Natural. It’ll be a vacuum which echoes the purity of the outer edges of Earth’s atmosphere. There’ll be a few oxygen and nitrogen molecules in there, just the way nature intended…

You can take it home, open it up and release a little bit of outer space into your room. Breath deeply, focus on your inner energies, and meditate on starlight…

Old and Creeky?

October 23rd, 2010

One of my treasured possessions is my old Creek Audio CAS 4040 amplifier, which I bought as an undergraduate. It was something of a classic for low-budget hi-fi enthusiasts like me when it was launched in the eighties. For £99 it had an excellent sound, and it was from a small and little-known British company, which gave owners a pleasant feeling of being cognoscenti discovering a fine wine at a budget price. You can get a feel for its vintage from the fact that all the audio connections are made via DIN sockets – remember them?

A decade and a half later, when I started delving into DVDs and surround sound, I paid a very great deal more for an all-singing, all-dancing Sony amp, which weighs about the same as a small truck, and which has optical fibre and coax digital inputs, but doesn’t sound as good as the Creek. The Creek gets less use now, though, because it’s in the sitting room and connected to a CD player, and, like most people, that’s not how I listen to most music these days.

Skip forward to the present day, when I’m setting up my new study, have fixed some nice Tannoy speakers to the wall, and am wondering how to connect my iMac to them. I’ve experimented in the past with small computer audio amps from people like Griffin, often powered from USB or Firewire, but have never been really happy with them. I don’t want to go out and buy a shiny, flashy, expensive modern amp – remember, I only need to amplify one single line-level output. Someone, I thought, must make a small monitor amp for this sort of thing, but I couldn’t find one, and certainly not at a reasonable price.

What I really need, I thought one day, is something like the old Creek: that would be perfect! So I headed over to eBay and did a search, and sure enough, manage to find some Creek amps and a few days later was the proud owner of a second CAS 4040. This is the newer Series 3 model, with phono sockets(!), and dates, I think, from about 1990. It sounds great, does just what I wanted, and even fits neatly under the iMac.

And the price I paid on eBay? £99. So my two Creek amps cost the same, despite quarter of a century between purchases! I couldn’t be happier.

iA Writer

October 19th, 2010

Now, this looks like an interesting app. Called iA Writer, it is almost like a typewriter for the iPad. Formatting is definitely not included. I have several of these basic editors (Elements and Droptext, for example). Writer shares many of the standard features, including the now ubiquitous sync-with-Dropbox.

But what piqued my interest was the fact that it’s the first app I’ve seen to extend the standard iPad keyboard: it adds a few basic punctuation characters, simple left and right cursor keys, and previous/next word keys. Very handy if you sometimes find the process of selecting a precise point with your big fat fingers a little tricky, as I do, though even that is easier here thanks to the large and well-spaced font the developers have chosen.

So far, I’ve only written – let’s see – 170 words with it (it tells me that too), but I can see I could get to like it for any situation where I’m trying to do real writing on the ‘Pad.

More info here.

Quote of the day

October 15th, 2010

This one comes from Rita Mae Brown:

Good judgment comes from experience, and often experience comes from bad judgment.

Noel Coward and Facebook

October 3rd, 2010

I still find Facebook a bit confusing. Non-intuitive. And I don’t have this problem with other networks. I’m wondering whether this is because I can’t be bothered to spend much time there, so it’s unfamiliar territory, or whether it really is badly designed, or whether I’m just getting old!

I was an early Facebook user and was rather put off by the invitations I would get to sign up for a plethora of pointless apps. “John Smith has just slapped you on the cheek. Click here to add CheekSlap to your profile…” That’s all handled much better now, but I never really got the FB habit.

This is partly because creating blog posts and web sites was already second nature to me by then, and I preferred publishing in a format over which I had more control, and which was more open. Stuff I write here gets found by Google and is accessible to everyone. Stuff in Facebook doesn’t, and isn’t. When I post on my blog, I can notify my FB friends automatically and the post is only one click away. And I can be pretty confident it will still be accessible in decade or two’s time, which is important for me, to the degree that this is a personal diary.

I also started to use Twitter fairly early and my tweets are similarly cross-posted to FB. You can’t conveniently do this the other way around because of Twitter’s 140 char limit. Yes, I suppose you could tweet a link to new FB content, but again, that link would only be of any use to those with FB accounts. Facebook is a closed, walled garden, though admittedly with rather a lot of people inside the walls now! But as Jason Kottke eloquently put it, Facebook is AOL 2.0.

All of this means that I tend to think of FB as a secondary, write-only medium. I actually post quite a bit there, but almost never directly, and I usually only open the site when I get an email notification that a friend has responded. Is this antisocial? People who take from networks and never contribute anything back are sometimes called leeches. What about the other way around?

I prefer to think that I’m just following Noel Coward’s excellent advice about the new medium of his day, television.

Television, he said, is something for appearing on, not for watching.

Well, exactly, dear boy.