Stay Hungry, Stay Foolish

October 6, 2011

Steve Jobs is dead. Headline news on Radio 4 as I woke up this morning. It feels deep. This is not because of the loss of a technology genius – hell, we all know Apple wouldn’t exist without Woz, the Mac was really Jeff Raskin, Pixar was really Jeff Lasseter etc. Its not just that he was an amazing business visionary – as Jonathan Fay tweeted this morning, “Steve Jobs championed design, pushed the limits of his people, and believed in dreams long enough to see them become reality.”

No. Its the story, the arc of a life lived in public that we all shared – the kid in the garage, the billion dollar success, the casting out into the darkness, the crossing of the Rubicon back into Rome as victor, the battle against cancer. Orbiting Frog quoted from his 2005 commencement address at Stanford. “Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.”

I hadn’t seen this clip before. Its fifteen minutes but well worth a look. He tells Stanford students that the best thing he ever did was to drop out of college, and the second best thing was to get fired and re-think life. And then he tells these bright young things, on a sunny day, at the start of their adventure in Life, that the really important thing is to remember that you will die. He also recalls the Whole Earth Catalog (remember that ?). On the back cover of the final edition it had a picture of a country road, and the words “Stay Young, Stay Foolish”.

If you want a  lighter  Steve moment,  try this.  As ever, timing is all.

Unix hair tearing

September 3, 2011

I have a Mac because you get nice easy-peasy pretty stuff and proper Unix all in the same machine. Some days when you crack open the terminal you feel a great sense of power and flexibility. Other days you want to strangle the people responsible for Unix. (Anybody for a bring-back-VMS campaign ?)

I use iTerm rather than the Mac-supplied Terminal. It has stopped development, so today I updated to the successor project, imaginatively entitled iTerm2 (strongly recommended – check it out). Suddenly a whole bunch of my alias-ed commands bombed. For example, to check what tunnels I have running I type “tunnels” defined as

alias tunnels=’ps -uaxww | grep ssh’

This gave an error message along the lines of “no such user” whereas when I re-started the old iTerm, it still worked. I narrowed this down to “ps -u” behaving differently in the two apps. In the old iTerm this adds a column to a ps listing which shows the UID owner of processes; in the new iTerm2 the -u switch is for filtering by UID, and so the command expects you to specify that UID. (The regular Mac Terminal behaves the same).

I thought I must be going crazy. In both cases I was simply running a dumb terminal, with the same login command, running the same shell, on the same hardware, running the same version of unix, issuing the same very simple unix command. Wuh ?????

After much hair tearing and some Googling, I found this blog post. It seems that the problem is an environment variable called COMMAND_MODE. When iTerm starts a terminal it sets this to “legacy” whereas iTerm2 and Terminal set it to “unix2003”.

Unix03 is an attempt at Unix standardisation by a body called the Open Group (see here). The other standardisation attempt is POSIX. According to this article no Linux or BSD vendor has achieved full compliance.

So… typical dilemma … do I leave my stuff as it is and set COMMAND_MODE=legacy, or do I try to update my stuff ?

Anyhoo. Sorry for boring you, but ain’t that just bloody typical unix ?

OSX sidebar orphans annoyance / binary XML whinge

February 21, 2010

I have circled around the Mac-Sun-Windows-Linux loop since the 1980s. Currently I am part of what Keith N calls the “invasion of the Mac brain snatchers”. Mac market share is slowly increasing amongst the general populace, but amongst astronomers its probably already the majority. If the gods that reside at One Infinite Loop have noticed this phenomenon, they maybe assume its because we appreciate and understand the power, flexibility, and beauty of OSX. Well Steve, it aint bad, but actually ITS THE UNIX. If Gnome and KDE keep improving, and Apple keep being commercial control freaks, it could be Ubuntu for me next time. (Unless there are Android laptops or something by then of course.) I just spotted  a worrying development on OSX – binary XML. Begin digression …

The OSX interface is pretty good, and the terminal interface is v.useful. (I use iTerm in preference to the standard Terminal – this is because it has tabs you can rename.) But there are some occasional annoyances. One that has hit me a few times is the issue of sidebar orphans.  You can drag aliases for frequently used folders and other items to a sidebar in the Finder, which is nice. Occasionally, as I re-organise my folders I end up with aliases for items that no longer exist, and I can’t even remove them, as when you click on the alias, you just get a message that says “can’t find this volume” or similar. I am a tad confused, as I have been trying to produce these orphans deliberately in the last few minutes and failing – moving and deleting folders seems to work ok. I just know it happens sometimes, and I have been getting a slowly longer list of them ! (I found a forum discussion here, but its a bit out of date.)

So I thought, this list has to be stored somewhere. I will find the file and edit it . Sure enough, there is a file called “” in Users/name/Library/Preferences. If I click on this file, it opens up in the Property List Editor. This has a mixture of the obvious and the gobbledygook, but its not hard to locate the item concerned and do “Delete Item”.

But its a tad mysterious. Finder says that this plist is an XML file, but it aint text; it seem to be a binary file, and the Property List Editor unpacks and formats it, as well as acting as a dedicated editor. If you try the Help menu, although it says “Property List Editor Help” it jumps straight to Xcode Help, way above my head. I isn’t a developer. I installed Xcode because I wanted Macports, which requires the X11 SDK, which comes bundled with Xcode.I just did what the nice folks at Macports told me too. I think the Property List Editor comes with Xcode, so in fact without this I would not have been able to edit this list at all.  Apparently you can change items on the command line with the “defaults” utility, or use the “plutil” utility for converting back to text – see this forum page.

This brought home to me that OSX is not just a GUI written in Unix. The OS itself, and the developer framework,  are also highly specialised constructs. Its maybe a lucky accident for us that the Unix layer is still visible and useable so that we can write shell scripts, install IRAF or whatever. This short wikipedia article explains the evolution of plist files. The original NeXTSTEP version was plain text. OSX 10.0 changed this to an XML format, defined by a public DTD; OSX 10.2 changed this to binary XML, which a normal user can’t inspect at all, and a geeky user can only inspect afer installing the Apple Developer Tools package (aka Xcode).

And there was me thinking that the point of XML was that it was an open plain text format, and that the Mac, being based on Unix, was transparent, modular, and flexible, in beautiful contrast to the incomprehensible gargantuan tangle that is the Windows Registry.  Well in relative terms, it still is.. but its a worrying trend.

For those of you who don’t want to install Xcode, there are some lightweight third party plist editors listed in the above wikipedia article, and the web page for this one also has a nice rant about binary XML.

Oh, and because I am a responsible parent, I should say “Before Using the Property List Editor, do a Back Up“, and could you all sign the disclaimer firm please ?

Astro widgetery

August 28, 2008

Apologies to all you PC and Linux folk – this one is for Mac fans. It was no surprise to find that the Fermi first light sky map was today on Astronomical Picture of the Day (APOD). However I didn’t need to go to the web site to check it out. I have a Widget that sucks down the latest APOD every day. For the non-Macees, widgets are tiny little applications (few hundred K typically) that run inside the Dashboard. They are apparently dead easy to write (not that I have tried yet …) as they are basically web pages, written with HTML and Javascript, but instead of being run by a browser, they run inside the Dashboard runtime environment.

As a result, there are now hundreds of these things, including a whole bunch of astro related ones. As well as APOD, you can get several different planetarium style viewers, including a free version of Starry Night, widget versions of the Vizier catalogues and ADS literature search, two different solar image viewers, and the latest Astronomical Telegrams. Those links are to the web-pages. To find the widgets, go to the Apple download page, browse, and enjoy. Its rather addictive, as they are so easy to download and try out. As well as all that astro stuff, there are lots of amusing things, like a Universal Translator, a Roman Numeral Clock, and regular stuff like weather forecasts etc.

A lot of this stuff you can of course also get with VO tools like VODesktop, Aladin, or PaperScope. The advantage of the widgets is they take about 3 minutes to understand.  The advantage of the VO tools is that you can carry on and do some real work with what you find.

If you want to know how to develop widgets, go here.