Getting passworded RSS feeds in Mail.app working

November 28th, 2007

Password-protected RSS feeds in Mail are a royal PITA to set up - basically Mail.app doesn’t support password authentication natively (or at least it doesn’t support entering the uid/passwords natively.) Here’s a sneaky work-around:

* Add the feed into Mail.app as normal, and let it whinge about not having a password
* Go to Safari, and set it to be the default RSS reader if it isn’t already
* Drop the feed URL into the address field, and respond to the authentication challenge - and allow the details to be saved into your Keychain
* Go back to Mail, where the feed will have automagically updated using the Keychain settings.

Apparently the “make Safari the default reader” step is optional, but your 1.609344 kilometerage may vary.

Technorati Tags: ,

More cat changes

November 24th, 2007

Ack. Another Leopard change that’s cost me half-an-hour of messing around: lookupd is gone, replaced instead by dscacheutil.

So now flushing the DNS cache is done by dscacheutil -flushcache.

Technorati Tags: , ,

What’s thrashing my Macbook disk?

October 28th, 2007

So far, my MacBook Pro has been running really well, with one or two very minor niggles. One of these was the speed of going to sleep - there would be a good 30 seconds elapsed between closing the lid and the sleep light “snoring”; and the other problem was that the disk seemed to be getting thrashed to bits for no apparent reason. Even when sitting quietly apparently doing nothing, the disk would be churning away. For all I knew, this might be something normal, but constant disk activity seems a bit odd.

The first step was to find out what was thrashing the disk. The built-in OS X Activity Monitor will show you the volume of disk activity, but there’s no way to work out what is doing the read/writing. So the next port of call is to work out which process is the cause. The easiest way of doing this is to use the fs_usage command, that monitors disk access and captures details of the process that’s doing the accessing.

If you run this on the command line, the data scrolls past until you stop it with ctrl-c - but that’s generally too fast to be useful, so you’re better piping the output into a file like this: sudo fs_usage -w > file1.txt The fs_usage command needs to run with root permissions, hence the sudo command.

Then you can open the file in a text editor, e.g. mate file1.txt and analyse at your own pace. The -w switch forces wide output, so you get all the data being reported - but you’ll need to widen your text editor window in order to be able to see this. In the right-hand column you’ll see the application names reading and writing to the disk.

In my case, the problem was obvious - at least 95% of the data being recorded in the file was caused by Google Desktop. I don’t know exactly what it was doing - indexing, presumably - but it was enough to thrash the disk and also as it turns out, slow down the process of going to sleep. I don’t know whether this constant disk activity is normal for Google, but I don’t use Google Desktop enough to make it worth while - so It Had To Go.

That turned out to be slightly less than straight-forward, due to the non-standard way that it gets installed. After several false starts where the same process would reappear after a reboot despite apparently uninstalling the software itself, I came across this set of instructions at Daring Fireball which outlines exactly what gets installed where. After working through this list and zapping the files, a final reboot resulted in peace and quiet, and a sleep as quick as I’ve been used to with a G4 Powerbook.

Tweaking MAMP Pro settings

October 4th, 2007

I’ve started using MAMP Pro to run local Apache and MySQL servers on my Macbook, mainly because they’ve got a rather more user-friendly front-end when it comes to controlling the most-commonly needed configuration settings. Being able to switch DocRoots and database directories is quite handy when you’re bouncing from project to project.

MAMP Pro is basically MAMP with a lot more of the configuration exposed through a GUI, and for $20 or so I figured it was worth it. Installation is the usual drag-and-drop Mac affair, and stopping and starting the servers is nothing more than a mouse-click.

The problem arose when I tried to run a MediaWiki install, whereupon it immediately fell over complaining of lack of memory available for PHP. By default PHP5 allocates a maximum of 8Mb, which is nowhere near enough for MediaWiki. Changing it is simply a matter of amending the php.ini file and restarting the servers - or so I thought. MAMP had other ideas - every time the server was restarted, it overwrote my amended file, started up PHP with the usual 8Mb and MediaWiki promptly fell over.

This was driving me nuts until I hit upon having a look inside the application itself. If you right-click an application in the Finder and select the ‘Show Package Contents’ option, you get to peer inside the app itself, or at least access the component and configuration files associated with it. In MAMP’s case, that allows you to get hold of the original version of php.ini and be able to edit it - it’s hidden inside the ‘Resources’ folder, but can be edited at will. Alter this to the required values, restart the servers again and away you go.

A minor wtf? moment

August 24th, 2007

A note to self, and for future reference - Javascript ‘month’ functions start at ‘0′ for January, though to ‘11′ for December. Which is why 2007,9,27 seems to be 64 days away…!

Blocking out your surroundings

August 16th, 2007

The advantage of working in an open-plan office is that it’s easy to interact with your colleagues; the downside to working in an open-plan office is that it’s easy to be distracted by your colleagues interacting. Short of locking yourself away in an empty closet or meeting room, the next best anti-distraction technique is to plug your ears with sound to block out the distractions, and with an iPod or iTunes running it’s really easy to do.

But sometimes music is just as much of a distraction - a pounding beat or obtrusive vocals can be almost as bad as chattering colleagues if you’re trying to maintain a train of thought. So plain old noise can be better in these situations - but then the question is what kind of noise?

I’ve tried using noise generation software to mask out background sounds - pink or white noise is very effective at blocking out extraneous noise. But it’s not particularly pleasant - there’s a good reason why blasting victims with white noise is a favourite CIA interrogation technique.

An alternative I’ve come across is ChatterBlocker - it’s a small app that has a number of built-in soundtracks of things like running water, birdsong, random chillout-y music and indistinct voices. The clever part is that you can mix these sounds together at various volumes to create a custom soundscape that works for you - so currently I’ve got a babbling brook and birdsong with a smattering of airy chords blocking out the sound of colleagues talking and the street beyond. It helps that I’m using a pair of Sennheiser CX300 in-ear headphones, which help to cut down the outside noise with rubbery bungs.

It’s very effective, and I’m surprised by how quickly you manage to forget the fact that you’re wearing ear buds and that the noise is artificially generated. It’s not quite working by the banks of a stream in a forest glade, but it’s certainly an improvement on a busy office in the centre of London.

Facebook opening up (slightly)

August 14th, 2007

One of the reasons I’ve never really become that excited over Facebook is the fact that it’s pretty much a walled garden - the first rule of Facebook is never to talk (externally) about Facebook.

That seems to be changing slightly - there’s now RSS feeds available for your friends’ status updates, which plays nicely with a standard RSS reader.

Small steps, but ones which need to be taken…

Setting default routes with a VPN and OS X

August 12th, 2007

Setting up a VPN connection in OS X is incredibly simple - just use the Internet Connect wizard, and away you go. But if you use the wizard to set up a VPN connection, it assumes that you want all traffic to go down the VPN tunnel. That’s fine in some circumstances, but it can be a pain if the upstream connection to the Internet at the VPN end is slow - and in any case, it’s most likely to be adding additional hops to your destination if that destination isn’t at the VPN end. A much better scenario would be for normal traffic to go via the default Internet route, and only VPN-specific traffic to go via the VPN.

It’s quite easy to fix, but it does involve a certain amount of command line wrangling. The process goes like this:

  • Fire up a terminal session and go to the /etc/ppp directory with cd /etc/ppp Then create a subdirectory in here called peers if it doesn’t already exist. You’ll probably need to invoke sudo to do this so that you get root privileges - so the command will be sudo mkdir peers
  • Create a file in here with the same name as your VPN connection - so for example, my VPN connection is called ‘Headshift’, so I create a file called Headshift by using sudo touch Headshift (this is case-sensitive, so make sure that the case of your VPN connection name and the file agree)
  • Open up this file and edit it to include the line ‘nodefaultroute‘ - sudo nano Headshift, entering the line then saving the file will do the trick here.
  • Restart the VPN connection, and check that the default routes have changed. You can do this by using the netstat -rn command in a terminal window. This will throw back a whole chunk of data, but the part we’re interested in is right at the start. The top line is the default route which shows the gateway which all traffic will go through - this should show the IP address for your default network connection. In my case, it’s the Airport interface which is listed as en1, with a default gateway of 192.168.1.1, but this will change depending on the setup.
  • Further down the list will be the entry for the network at the other end of the VPN connection, and this will show it’s gateway as ppp0, which is the VPN link. So for example, if the network at the other end is 172.168.1.0, then you’ll see an entry for 172.168.0 in the list with a gateway of ppp0
  • You can also check this by doing a traceroute to a host on the VPN-connected network, which should show that the packets are passing across the VPN link; then tracerouting to an Internet host, which will go via the default LAN connection.

21st Century SDK

June 22nd, 2007

I completely missed the announcement of this, but Web21C is a series of APIs for BT’s 21st Century Network, the next-generation IP-based telecomms network that’s being rolled out.

It’s a number of APIs to core 21CN services - SMS, voice calls, conference calls, location, authentication and so on.   They’ve created an SDK which allows these services to be embedded into web apps, as well as test environment - in a particularly nice touch, there are seven virtual SIP phones for testing, each one with it’s own particular quirks.   And to distinguish each one from the other, they’ve been given names from Snow White - so Happy will answer the call normally, but Sneezy will accidentally disconnect the call after 10 seconds.  Genius!

Previewing IE mangling

June 13th, 2007

Falling into the category of “useful tools that there wouldn’t be any need for in a perfect world”, here’s a neat site that renders a url to preview how badly your lovingly-crafted CSS gets mangled by IEs 5.5, 6 and 7.

NetRenderer

Of course, if standards actually meant standard, then this wouldn’t be needed - but in the meantime it could save some wailing and gnashing of teeth.   Basically you bang in the URL of your page, and then you can preview the effect of rendering in each of the versions.   There’s also an overlay mode which shows the pixel-by-pixel differences between 6 and 7.