January 28, 2015

MacOS X Yosemite: How to mount a disk on startup


MacOS X Yosemite removed few capabilities that existed in previous versions of MacOS X. Notably the StartupItems feature which allowed you to run scripts when the system boots up.

On my machine I want to be able to mount an internal disk as soon as the machine boots up, but before a user logs in. A common solution in the past involved a custom StartupItems script, but this no longer works on Yosemite.

To solve this problem I created a LaunchDaemons script. My disk's volume name is BigDisk and is accessible via /dev/disk0s2. To mount it on startup I created a file named com.jollyturns.disks.plist in /System/Library/LaunchDaemons with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">




When the machine starts up, launchd will load the file since we have the RunAtLoad set to true. It then finds that /Volumes/BigDisk does not exist, since the disk is not yet mounted, so it executes the diskutil command to mount the directory.

Posted by ovidiu at 01:52 PM | Comments (0) |

June 07, 2007

MacPro disk access performance (take 2)


In a previous weblog entry I measured the disk access performance on MacPro. Few days ago I decided to change my two 750GB drives configuration from RAID 1 (mirrored mode) to RAID 0 (stripped mode).

I backed up the RAID disk on an external drive and I recreated the RAID setup. To destroy the old RAID disk I had to boot the machine in safe mode (hold down the "Shift" key during computer boot-up). Otherwise DiskUtil would not be able to unmount the drive. After creating the RAID 0 disk, I restored the disk from the backup.

I ran the same commands as I did few months ago:

$ time dd if=/dev/zero of=<file> bs=1024 count=1048576

$ time cat <file> | wc -c

One thing I did notice is that running the cat to /dev/null (as I did in the previous entry) yields a really low number on MacOS X 10.4.9. This indicates a possible optimization in the operating system. I changed the command to count the number of bytes using wc. This adds a negligible CPU load, and probably some inefficiencies in how the stdin data is read by wc, but overall should not influence much the result. Here are the results combined with those from the last run:

DriveRead time (seconds)Write time (seconds)
internal 160GB14.9014.64
internal, software RAID 0, 1.5TB7.6810.65
internal, software RAID 1, 750GB18.0521.94
external, hardware RAID, USB2, 400GB49.4357.30

So clearly setting up a RAID 0 disk improves the performance of your disk! In real life Adobe Lightroom takes a lot less time to start up than before. Other applications may benefit as well from this, but it's too early to tell. My previous recommendation remains: use an external USB or Firewire drive for backups only, and optimize the internal disk system for performance.

Posted by ovidiu at 10:15 AM | Comments (3) |

October 04, 2006

MacPro disk access performance


I was curious about the hard disk access performance on MacPro. I tested this on a dual core 3GHz machine with 4GB RAM. The machine has the 160GB hard disk that shipped with the computer, and two additional 750GB Seagate perpendicular drives. The Seagate drives are configured as RAID 1 (mirroring) using MacOS X's built-in software RAID. I also used a CoolGear external RAID enclosure (hardware RAID), using two 400GB drives configured as RAID 1, and connected via USB2 to the MacPro. The external enclosure also uses eSATA, but the computer doesn't have an internal PCI SATA extension card to use it with.

I ran a very basic test, writing and reading a 1GB file. The file is written by reading from /dev/zero. The reading is by doing a cat to /dev/null. The commands look like this:

$ time dd if=/dev/zero of=<file> bs=1024 count=1048576

$ time cat <file> >/dev/null

Here are the numbers:

DriveRead time (seconds)Write time (seconds)
internal 160GB14.9014.64
internal, software RAID, 750GB18.0521.94
external, hardware RAID, USB2, 400GB49.4357.30

I guess there's no surprise how slow the USB2 drive is compared to the internal drive, although an almost 400% increase in read and write times are fairly extreme. The biggest surprise was the 50% performance drop of the software RAID compared to the raw disk access. Albeit the comparison is not quite fair as the drives are not identical. I wouldn't be surprised however to see the same number for a similarly configured software RAID.

Perhaps the situation would improve with either Firewire 800 or eSATA-connected drives, but I doubt it would change the number significantly.

My take on this is that external RAID systems should only be used for backups, not regular access. If possible, don't use software RAID either, instead do regular backups on an external storage device.

Posted by ovidiu at 10:18 PM | Comments (3) |

August 26, 2006

Apple batteries fire hazard


Apple recently recalled some of the batteries in the laptops they shipped from 2003 to 2006. If you bought a laptop from them during this time, check the batteries to see they are recalled. There have been a number of reported fires started by defective batteries.

Check out Apple's web site for more information:

I have two Powerbooks 15inch, and out of three batteries that I have, two of them are recalled. Ouch!

Update: I just received a confirmation email from them:

It will take approximately 4 to 6 weeks for your replacement battery to arrive. Please note that shipping time may vary due to availability of your battery model.

Duh, not very encouraging! It means one of the laptops will need to stay powered all the time. Not a "laptop" at all.

Posted by ovidiu at 02:15 PM | Comments (1) |

December 17, 2005

Ringtones from your music

Apple | Cool gadgets
Millenium Park, Chicago

It bothers me that the music you legally own, perhaps stored on your computer, is not easy to get on your cell phone and make it available as a ringtone. Moreover, the cell phone companies require you to pay a hefty fee of $2 just to get 30 seconds of a song on your phone. Somehow they make you believe it's something special about their songs, so you have to pay for them.

Now I'm not the kind of person to download ringtones and change them periodically. I'm quite content with the default ones, although I must admit when my wife calls me, the phone's ringtone is AC/DC's Hell's Bells. My daughter however, being the teenager that she is, loves to continually tweak the sounds her phone is making. And the idea of having to pay $2 for a stupid ringtone just drove me nuts, so this evening I investigated a bit what could be done.

It turns out it's fairly easy to install new ringtones on your phone. If your phone has bluetooth, you can pair the phone with the computer and just upload the MP3 with the song on the phone. My Motorola V330 works this way, very easy.

My daughter has a Samsung E315, which has no bluetooth, so the above is not an option. The phone doesn't support MP3, but a format called SMAF/MA-2. In addition, she has a lot of songs bought from the iTunes Music Store, which are of course encrypted. So to get them on the phone is quite challenging. Here are the steps I followed and the programs used to accomplish the task (programs are MacOS X specific, I have no clue about Windows, as I don't run it at home):

  • Get WireTap Pro. This program will record the sound sent to your computer's audio output by various programs, including iTunes. With this program recording, play the portion of song you're interested in in iTunes.
  • When you're done recording, open the resulting .aifc file in QuickTime Pro and convert the file to a .wav file. I used Quicktime Pro version, but you could most likely find a free AIF to WAV converter.
  • Once you have the WAV file, open it up in Audacity and select the exact portion from the song you want to become the ringtone. This allows you to really fine tune how the ringtone will sound. Then save the selection as WAV under a new name.
  • You now need to convert this final WAV file to a SMAF/MA-2 file. Download the Wave to SMAF Converter from Yamaha, and convert the file. You'll end up with a .mmf file. For the file to be recognized by the Samsung E315 phone, I had to rename it to have a .mid extension. Also make sure the file is under 40Kb or so, and it has no more than 20 seconds.

    The WAV->SMAF converter allows you to choose either 4KHz or 8KHz as sampling rate. Both will work on the phone, but the sound for the 4KHz version is just terrible, so I ended up using 8KHz. This reduced in half the length of the ringtone, compared to the 4KHz version.

  • Once you have the .mid file, upload it on a web site in a known location (you do have one, don't you?), and send the phone an SMS message containing the link to the .mid file. For T-Mobile, I just send an email to containing the link.
  • Once you receive the message, follow the link and download the ringtone. If you get error messages like Bad Gateway or something else, the file might be too large, or the song lasts too long. Experiment a bit with the sizes and see which ones work for you.

Using the above, my daughter and I created few ringtones from some of the songs she likes. Needless to say, she was very excited about it! You get the ringtone exactly the way you want them to be, and you don't get stuck with choices made by somebody else. Not to mention I was happy I avoided paying the hefty ringtone tax imposed by the cell phone company.

Posted by ovidiu at 11:08 PM | Comments (2) |

June 10, 2005

MacOS X on Intel


There was a rumor dating back to mid-2002 about such a thing already happening. Back then I posted a comment on this blog saying that for this to happen they need to have most of the applications ported to the Cocoa API, and also prepare to change the business model.

The technical part is relatively easy. Back in the OPENSTEP days their operating system ran very nicely on Motorola 68040, Intel Pentium, HP's PA-RISC and Sun's Sparc. The operating system had support for the so-called "fat" binaries, which could bundle in a single executable code for multiple processors. I haven't seen the new porting toolkit, but I guess a similar approach is employed for supporting Intel processors. Back then you could choose to build fat binaries by simply enabling some switches in the development environment. With most of the applications now implemented in Cocoa, this should be an easy transition.

On the business side I wonder how their hardware business will change. I think on Intel platforms is very hard to keep your hardware proprietary: sooner or later people will find a way to either build their own, or modify the operating system software to run on their hardware. The only reason to switch to Intel chips is to take advantage of all the commodity hardware out there, and have the manufacturers support their components on your operating system. I guess they can build a proprietary chipset, and make their operating system support only that chipset. But even that is very hard, with Darwin out there in source code, people will find a way to compile the necessary drivers and/or the kernel to make MacOS X run on non-Apple chipsets.

I think the only viable long-term strategy is for Apple to sell their operating system for generic hardware, just as NeXT did with OPENSTEP, when it was first released for Pentium. At that time NeXT went out of the hardware business entirely, and became a software company. Will this signal the same shift for Apple? This could mean a head to head competion with Microsoft, which won't probably allow it.

Nevertheless, interesting times ahead...

Posted by ovidiu at 04:10 PM | Comments (1) |

March 27, 2005

Creating JNI libraries on MacOS X

Apple | Linux

Building JNI libraries is a bit of black magic, especially when you're dealing with different platforms like Linux and MacOS X. I found the following two references very helpful in understanding of how to build and run a JNI library on MacOS X:

Now that I figured out the MacOS X part, I hope the Linux part to be very similar.

Posted by ovidiu at 11:37 PM | Comments (1) |

March 26, 2005

Apple mini as print server

Apple | Cool gadgets

I just got an Apple Mini, it's simply adorable! Installing it was a breeze: I just copied my files and settings from a Powerbook via Firewire. I got the machine to have it act as a server for the printers, to replace an aging HP JetDirect 500x server. But it's so small that I'll probably leave it hooked up to the LCD screen, for my young boy to play games from time to time.

I need to figure out how to make the printers visible to an old Redhat 6.2 laptop, running LPRng. So far I tried the regular LPR settings, but the CUPS server on the mini complains that there's no file being posted for printing. I've also investigated Samba printing, for which I had to enable sharing the printers on samba. I cannot find the exact instructions I followed, but I had to add few lines in /etc/smb.conf, like below:

In the [global] section, add these lines:

  load printers = yes
  printing = cups
  printcap name = cups

Then add a new section, reading like this:

  path = /var/spool/samba
  printable = yes
  public = yes
  guest ok = yes
  writeable = no
  printer admin = root, @admin, @staff

I found these instructions to also be quite helpful in how to set things up so that older Linux systems can access the printers on the server.

Posted by ovidiu at 11:50 PM | Comments (1) |

May 28, 2004

More on XEmacs for MacOS X

Apple | Emacs

Hooray! I managed to get XEmacs' internal buffer structure hooked up into Cocoa's text system!

The first step was to build a library from the XEmacs source code, which I could link against my Cocoa-based project. This was pretty straightforward, adding a couple of defines and ifdefs to remove the main function from the library. I also added some rules to the makefile to build the actual library.

Then I built a very simple editor application using Cocoa's default text classes. Once this worked, I replaced the default NSTextStorage class with my own subclass that uses XEmacs' buffer internal structure to hold the characters. Since NSTextStorage's API makes use of NSString to get the string to be displayed, I also created a simple subclass of it, that accesses the characters directly from the buffer structure.

I can now edit my .bashrc file, insert, replace and delete characters in a window on screen, and have these operations reflect directly in the associated buffer structure.

One problem I need to solve is with Unicode characters. MacOS X APIs use unichar, a 16 bit short integer to represent Unicode characters, while XEmacs uses IChar, a 32 bit integer. I need to find a way to normalize XEmacs' multibyte characters to MacOS X's unicode characters. I haven't poked yet in the MacOS X's Foundation header files to see if there is anything that would do the job. If you know of something, please let me know.

The next step is to hook-up the XEmacs Lisp engine in the system. This is the first real challenge, since the important stuff in Emacs is done in Lisp.

Posted by ovidiu at 10:41 PM |

May 23, 2004

NSTextStorage bug


This seems to be a well-known bug, but it took me three days of hunting to figure out what was going on :(

If you're trying to subclass the NSTextStorage class, you need to override one more method, in addition to the 4 methods described in Apple's documentation. The additional method is addAttribute:value:range::

- (void)addAttribute:(NSString *)name value:(id)value range:(NSRange)range;

Here is a simple NSTextStorage subclass that works in MacOS X 10.2, and hopefully in 10.3 as well:

@interface MyTextStorage : NSTextStorage {
  NSMutableAttributedString* string_;

@implementation MyTextStorage

- initWithAttributedString:(NSMutableAttributedString*)string
  [super init];
  string_ = [string retain];
  return self;

- (void)dealloc {
  [[NSNotificationCenter defaultCenter] removeObserver:self];
  [string_ release];
  [super dealloc];

- (NSString*)string
  return [string_ string];

- (void)addAttribute:(NSString *)name value:(id)value range:(NSRange)range
  [string_ addAttribute:name value:value range:range];

- (NSDictionary *)attributesAtIndex:(unsigned)index effectiveRange:(NSRangePointer)range
  return [string_ attributesAtIndex:index effectiveRange:range];

- (void)setAttributes:(NSDictionary *)attrs range:(NSRange)range {
  [string_ setAttributes:attrs range:range];

- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)string
  int origLen = [self length];
  [string_ replaceCharactersInRange:range withString:string];
  [self edited:NSTextStorageEditedCharacters range:range changeInLength:[self length] - origLen];


Update: This is strange. It looks like removing the call to [super init] in the -initWithAttributedString: method makes the system crash. The class works just fine with the super call, and the addAttribute:value:range: method definition removed. Really weird!

Posted by ovidiu at 07:08 PM |

May 18, 2004

XEmacs on MacOS X

Apple | Emacs

For the past week I've been investigating porting XEmacs over MacOS X using the Cocoa, using the not-so-new text system, which is incredibly powerful.

All the previous attempts to port GNU Emacs or XEmacs to MacOS X have used the Carbon API, a lower level API used for compatibility with the older MacOS operating systems. The approach I have in mind plans to use the powerful display framework available in Cocoa.

So far I've investigated the internal organization of XEmacs and reviewed the major data structures. I don't have a rigorous plan yet, at this point I'm experimenting with different options available.

The best options so far seem to be the following:

  • provide an Objective-C wrapper on top of XEmacs' buffer structures, that make these appear as an NSTextStorage subclass.
  • for the display part, the NSTextView class provides most of the methods needed to implement the right display functionality. A proper Objective-C subclass would be able to intercept the mouse and keyboard events and update XEmacs' buffer structure with point information and new content.

Cocoa's display technology makes the display code in XEmacs redundant. One thing I'm worried about is the charset management and how to deal with different (and I think incompatible) methods for entering characters in different languages.

Nice to have, but non goals for this project:

  • Expose XEmacs' internals to languages other than Emacs Lisp: Python, Ruby etc. would be really nice. This way even more people would be exposed to this great editor.
  • port to GNUstep. Many years ago I contributed major components to this project. I don't know what is the status of the text system port in GNUstep.
Posted by ovidiu at 01:20 AM |

December 15, 2003

How long does a Powerbook G4 last?


About 1 year and 6 months.

That's how long my (then brand new) Powerbook G4 lasted. Today its screen went blank as I got home from work. I opened it up, hooked up the power supply, connected the Logitech wireless keyboard and mouse to it and waited for the Apple screen saver to show me the login panel. Nothing appeared for a while, then the Apple logo on the screen started to shake left and right in an abnormal way. Much like a TV when it's losing its synchronization. The display then went grayish, like water spreading on the ground. Then black and nothing else.

I removed the battery and the power plug. I put them back and booted the machine. I could hear the hard-disk spinning, but the screen was still black. I powered it off by holding the power button, and it did so perfectly. I repeated this sequence several times, but the LCD was still black.

Luckily the network was setup from office to use DHCP, instead of wireless. I hooked up an Ethernet cable from my router and booted up the computer. After some time, I tried ssh-ing into the laptop from a Linux desktop at home. This went perfectly! I decided to backup the drive, just in case. So I scp-ed my home directory to the Linux box. At least now I'm safe with the data.

But what a bummer! I have another really old laptop, a Pentium II running Linux that my wife is using just fine for more than 4 years. A cheap laptop too, not on the upscale as my Powerbook.

Tomorrow I'll take it to a local Apple Store to see if they can send it for repairs somewhere. Hopefully I don't need to shell out a lot of money for it, otherwise I will seriously consider switching back :( Oh well...

Posted by ovidiu at 08:56 PM |

October 26, 2003

GNU Emacs on Panther

Apple | Emacs

I've been told that the Emacs binary package I packaged does not work on the new MacOS X 10.3 Panther. Unfortunately, until I get a copy of the new operating system, I won't be able to produce a new package.

Posted by ovidiu at 11:44 AM |

June 11, 2003

Apple WWDC


Got this in my mail:

Steve Job's invitation to WWDC
Posted by ovidiu at 03:35 PM |

JavaOne - MacOS X Java session

Apple | Java
Marratech Pro collaboration for MacOS X

10:55am I'm now in the MacOS X Java Technology Overview session - The Ultimate Java Development Plan - presented by Alan Samuel, a "Java Technologies Evangelist" at Apple. Pretty good attendance, the room although small, is packed (more than 100 people I think).

11:02am It started. Most of the people in the room develop in Java on MacOS X, a lot more since few years ago, when the presenter asked the same question and got only 4-5 people doing Java development on MacOS X. Lots of talk about why use Apple hardware and software and develop Java on it. Tools: Apple's ProjectBuilder as well as third-party tools. Enterprise applications: Oracle 11i, SAP etc. Server strategy: WebObjects, Tomcat, 3rd party tools and J2EE servers running on Xserve. JDK 1.4.1 had over 1 million downloads to date.

In 1.3.1 there were 1842 Java classes and 900 custom Apple classes. In 1.4.1 there are 2991 Java classes and only 300 custom Apple classes. The AWT is re-implemented in Cocoa (rotated tabs, translucent windows). The JDK plug-in is now supported in Safari. MacOS X supports both JVM versions at the same time, with 1.3.1 being the default one. The JVM could be specified on a per-application basis.

JDK is optimized for MacOS X: Aqua look-and-feel, access to Quartz Extreme using just the standard Java APIs. The result is more responsive UIs, live re-sizing, smoother scrolling and snappy feedback. The Java Internet Plug-in has faster loading of applets, enhanced applet caching, integrated with Keychain and printing. Java WebStart updated to version 1.2, works with Keychain and adds automatic app creation. Keychain implemented using Secure Transport (?), certificates stored in Keychain. Good accessibility support, no need for Java Access Bridge: full screen reader support, full keyboard access and visual notification (hm, I wonder why the Tab key doesn't work to switch between most controls, including buttons). Support for handwriting support using Inkwell and for sound input. The new JDK version includes AppleScript support: scriptable UIs widgets. Shared system jars with system objects being shared between each VM (I guess very similar to shared libraries in the C world). This saves 3-6Mb per application with savings mainly in Swing and AWT-based apps - even more optimizations coming.

11:32am He's now giving a demo using Marratech Pro 3.4, an impressive Java collaborative tool that integrates video and a board for sharing documents. The software is built by a Swedish company. The presenter is Serge Lachapelle and he's talking from Sweden together with two other people, Magnus, Rolf and Rickard also online. The communication protocol is encrypted using 128bit keys. The application ran initially only on expensive Solaris boxes, but was easy to port to MacOS X on Java 1.4.1, including the native libraries written in C. (BTW, the sound quality is great, even though the video stream is pretty crapy, only 1-2fps).

11:42am Back to the presentation. Few tips on how to write Java apps for MacOS X, all of them documented on the ADC Web site. Don't use modifier keys directly, use Toolkit.getMenuShortcutKeyMask(). Not all look and feels are the same: use layout managers instead of explicitly placing the components. Query UIManager, toolkit for colors and icons.

Few words on Panther: we'll be "shocked" by the new operating system. It will be announced two weeks from now at WWDC at Moscone Center in San Francisco (the same location as JavaOne).

Posted by ovidiu at 01:47 PM |

April 29, 2003

iTunes Music Store rocks!

iTunes4 Store Music

Apple's iTunes Music Store is impressive! Using the very simple and familiar user interface of iTunes, Apple has created a very powerful application, which blurs the line between the locally stored music and the online stored music.

It is a very nice integration between a desktop application and an online Web service. Listening and buying music cannot be done easier than this!

I still need to experiment with the ability to rip CDs, encode using the AAC format and listen to them on my now old iPod. The MP3 playback quality on iPod is quite good, I'm curious to see how much improvement AAC brings.

Posted by ovidiu at 11:09 PM |

April 09, 2003

Starting a new instance of an application


I remember that in the old NeXTSTEP/OPENSTEP systems that MacOS X is based on, you were able to start a new instance of an application by holding the Alt key down (I think) while double-clicking on the application's icon in the file manager. This way you could have the same application running multiple times.

I tried different key combinations, but it seems this is not possible. Is this functionality available in MacOS X Jaguar?

Posted by ovidiu at 10:46 PM |

January 28, 2003

Jaguar reinstall


Odly enough, Jaguar on my Powerbook decided to no longer do drag-and-drop. I noticed it first in, where I couldn't move emails to a different folder. Then I noticed that in Finder I couldn't move icons off the desktop. The situation got really bad when I noticed I cannot create bookmarklets in my Web browser. So I decided to reinstall Jaguar on my 9 months old Powerbook, which I've upgraded from 10.1.2, successively up to 10.2.3.

I backed up everything in my home directory, /private and /usr/local on an external Firewire hard-disk. I used a simple shell script based on rsync:

rsync -av --copy-unsafe-links -H --delete /private /Volumes/WD40
rsync -av --copy-unsafe-links -H --delete /Users /Volumes/WD40
rsync -av --copy-unsafe-links -H --delete /usr/local /Volumes/WD40

I reinstalled Jaguar, logged in as root and restored the settings using another shell script which reads like this:

rsync -av --copy-unsafe-links -H /Volumes/WD40/private /
rsync -av --copy-unsafe-links -H --delete /Volumes/WD40/Users /
rsync -av --copy-unsafe-links -H /Volumes/WD40/local /usr

I then rebooted the machine from the terminal using the reboot command, to avoid any data being saved on the above directories by the GUI applications. When the machine restarted, I had all the settings I had prior to the reinstall, minus some add-on applications I had installed.

I also had to reinstall a lot of commercial applications, which was a pain. I felt like back in the days I was installing Windows over and over again because of registry corruption or who knows what :(

One thing which surprises me at MacOS X is the fact that you need to reboot your system when you upgrade certain applications. I assume these applications update shared libraries, but nevertheless this should not be required. I certainly don't have to do this on Linux when I upgrade glibc or any other system library. Having to do it on MacOS X is really a bad thing: how is it better than Windows then other than a nice GUI? If this also happens on OS X Server then it's really bad.

Anyways, my laptop is now much faster than it used to be. Most applications start up much quicker, and there isn't so much disk access going on. I guess the previous file system was very fragmented.

Posted by ovidiu at 12:14 AM |

January 08, 2003

Safari and Chimera


The rumors about Apple releasing its own branded browser circulated for some months now. With the hiring of David Hyatt at Apple, one of the main developers of Chimera and Mozilla, the expectation was the new browser will be based on Gecko. It now turns out Safari is based on Konqueror's rendering engine. Quite interesting!

It would be very interesting to see the evolution of Safari. One major feature missing from Safari is tabbed browsing, which was designed and implemented by David. His description of the story and how it was seen by marketing people at that time is rather amusing.

What are the long term implications for Mozilla of Apple's decision to go without Gecko? With the current polarization of developers around Apple's new MacOS X, is Mozilla going to loose its relevance as the "other" browser on the market? Can Apple fight this browser battle they've just entered? What will be Microsoft's response to this?

I think this year will be an interesting one to watch...

Posted by ovidiu at 12:43 AM |

December 22, 2002

Updated Emacs binary for Jaguar

Apple | Emacs

I've updated the binary package for Jaguar with a new version from CVS which seems to fix the crash problem that appeared in the previous version on each update of the operating system. Emacs would just segfault on each startup after the operating system would be updated.

Andrew Choi pointed out to me that some time ago Steven Tamm found a fix for this problem on emacs-dev. His fix seems to indeed solve the problem: I've compiled the package on 10.2.2 and it successfully survived the upgrade to 10.2.3, recently released.

So if you're running on MacOS X Jaguar and like Emacs, download the new Emacs binary package now!

Posted by ovidiu at 01:06 AM |

November 13, 2002

New release of WebObjects


Apple quietly released a new version (5.2) of their WebObjects Web application product. Interesting new features include ability to provide a Web services interface to your business logic. They apparently use Axis as the Web services engine. Pretty cool!

The ideas behing WebObjects are fairly interesting, and their tools seem very nice to develop with. They have a very easy and intuitive Object/Relational mapping tool called EOF. Long time ago, together with a friend I built a clone of an earlier Objective-C only version.

Posted by ovidiu at 11:23 AM |

November 11, 2002

Jaguar 10.2.2 breaks Emacs package

Apple | Emacs

I've just upgraded my machine to 10.2.2. After the install, I've noticed the Emacs for MacOS X package I've put together breaks with segmentation fault on startup. I have no clue why this happens, so I recompiled the binary and everything seems to be working fine again. I'm uploading the new binary as we speak, and it should be up on the Web site shortly.

Posted by ovidiu at 07:09 PM |

November 10, 2002

NetInfo problems


My Powerbook, running MacOS X 10.2.1, suddenly decided to stop working because of NetInfo problems. Everything would take forover to start, from opening a new window in Chimera, or a new Terminal window to starting a new application. Looking at the /var/log/system.log and /var/tmp/console.log I could see messages like DirectoryService: NetInfo connection failed for server

The solution was to restore the Netinfo database. A starting point was I removed the /var/db/netinfo/local.nidb Netinfo database and rebooted. At this point MacOS X went through all the registration process it does the first time you boot a pristine system. This step creates a new Netinfo database. Once I logged in, I became root by running sudo su in Terminal, and ran the command to restore the Netinfo database from an earlier backup: niload -r / -t localhost/local < /var/backups/local.nidump.

Quick procedure, but I wonder what caused the problem in the first place, and why is Netinfo so fragile. I remember this used to be a problem in the old NeXTSTEP and OPENSTEP systems as well. I think a newcomer not familiar with all these hacks, would simply want to reinstall the system. The system is essentially unusable for a non-techie, you don't get the login window when you start the computer, so a non-suspecting user will think the system is dead.

Posted by ovidiu at 02:10 AM |

November 05, 2002

Jaguar Cache Cleaner

Bill Bumgarner writes:

Ugh. I was stuck in "IE really really insists on being the default browser" mode. Nothing would unstick the damned thing; couldn't use OW or Chimera as my default browser.

The solution was simply to run Jaguar Cache Cleaner and clean all caches in the 'lite' mode. I made sure that the browser I wanted was set as the default browser prior to cleaning the caches.

I had the same issues and this little application fixed the problem. One small hicup though was the firewall settings on my machine. After I rebooted I was not able to connect using ssh to any machine. Soon I discovered was not connecting either. It took me a while to figure out something is wrong with the networking in general. It took even longer to realize the firewall was the problem.

I disabled the firewall and everything started to work again. After I reenabled it, everything is still working. So I'm happy now. I can now use Chimera as my default browser. Yupee!

Posted by ovidiu at 11:40 AM |

October 15, 2002

GNU Emacs package for MacOS X 10.2 Jaguar

Apple | Emacs

Since there was interest in this, I've created a binary package for GNU Emacs, ready to be installed on MacOS X Jaguar. You can find all the necessary installation bits on my Emacs on MacOS X Web page, together with some hints on how to set it up so it integrates nicely in the MacOS X environment.

Posted by ovidiu at 03:51 PM |

October 08, 2002

Making Java/Swing apps look good on MacOS X


MacSlash has an article about how to make Java Swing applications look native on MacOS X. The developer, Sven Van Caekenberghe even includes a couple samples to show how the applications look. Very nice!

Posted by ovidiu at 10:36 AM |

September 18, 2002

MacOS X 10.2.1 released


I'm installing it right now on my machine. Let's see if some of the issues I've seen are fixed by this update.

Another update delivered by Apple's Software Update is for iTunes, which is now at version 3.0.1.

Posted by ovidiu at 10:51 PM |

September 17, 2002

MacOS X Jaguar update


Mark Pilgrim has a story about an upcoming update to Jaguar. The list of changes, captured from a document posted by Apple, and since then retrieved from their site, shows several changes to the basic operating system. Among them, it appears Jaguar will finally be able to burn Windows CDs, a feature missing from MacOS X for an incredibly long time.

My favorite is placed in the category Networking and Mail Enhancements:

Addresses a situation in which, if the connection fails when transferring email to your computer via your network or an Internet connection, all mail not transferred is lost.

Ops! It's funny how serious bugs are suddenly presented as enhancements.

Posted by ovidiu at 11:46 AM |

September 11, 2002

Even free, iCal isn't worth the price


Apple released iCal.

RandomMaccess has a comment: Even free, iCal isn't worth the price [via Matt Croydon].

The most compelling feature is the ability to publish your calendar online on a WebDav-enabled Web site, and share it with your peers. However I couldn't yet do it on the Apache instance running on my Powerbook, because of some WebDav setup issues I have.

In the first five minutes of playing with iCal, I found this bug. The window which pops up when you select Calendar -> Publish... consistently forgets to ask the URL of the site to post to, if the first time you use it you cancel the action.

To reproduce, choose Calendar -> Publish..., select Publish on a Web server. Don't enter any data, and select Cancel. Repeat the same steps again, you'll notice you're no longer asked for a site where to publish your calendar. To get back the text field to enter your URL, restart iCal.

Posted by ovidiu at 12:40 AM |

September 09, 2002

Jaguar's not very effective fighting spam


Mail screen capture showing lots of junk mail. Click to get a larger image.

It looks like the Mail application that ships with MacOS X 10.2 Jaguar is not very effective in identifying my junk mail. After more than 2 weeks in training mode, I still get lots of junk. Today for example, after a normal week-end, when I came back to office I had 160+ messages, out of which only 3 were legitimate. As you notice in the attached picture, Mail was unable to mark most of them as junk.

Microsoft Entourage had similar problems in identifying junk mail, so I'm happy with neither of them.

The only successful spam killer I've found is SpamAssasin, a collection of Perl scripts to be used in conjunction with procmail. I used to run this tool very successfully on my Linux desktop, until I moved to MacOS X. In MacOS 10.1 it was impossible to run procmail with, because of the mailbox format used by Mail.

A more MacOS-X-ish solution would be to have the ability to have run an AppleScript when email is received. doesn't have this ability however. Interestingly enough, Microsoft Entourage has it. In many respects, Entourage feels a more mature application than

Posted by ovidiu at 02:27 PM |

September 08, 2002

Jaguar and per session SSH agent


Richard Johnson points out SSH Agent by Xander Schrijen, which could be used to access a global SSH agent process per login session, which keeps track of all your identities. This is a replacement for SSHAgentServices, which as I reported earlier no longer works on MacOS X Jaguar.

The only caveat with this application is that you need to have it running all the time during your login session for the SSH agent to be running. But other than is a perfect replacement for SSHAgentServices, and a clean one since is not dependent on Apple's, which seems to refuse loading of custom written plugins.

I've spent half a day trying to see why SSHAgentServices doesn't work, and I believe is doing some nasty checks to avoid loading custom written plugins. Neither SSHAgentServices, nor a little plugin I wrote as a test were loaded successfully inside

Is MacOS X becoming one of those poor platforms from Apple that Joel is talking about?

Posted by ovidiu at 11:48 PM |

September 03, 2002

MacOS X on x86 hardware?


Apple reportedly has builds of MacOS X 10.2 running on Intel compatible hardware. Don't hold your breath yet, as explained in the article and as I previously noted, Apple needs to move its customers to use the new Cocoa APIs instead of the Carbon ones, which provide an easy migration from the old MacOS. The business model has to also change, which is a major undertaking.

But a switch to Intel or Advanced Micro Devices Inc. processors is probably not in the cards for tomorrow's Macs, sources said. Such a move would require a massive revision of Apple's closed hardware architecture and a fundamental rethinking of its business model, which is founded on tight integration between its proprietary system software and hardware. Apple would have to also coax most of its third-party developers to rewrite their applications from the ground up in the company's Cocoa application environment. (Most major vendors have instead tuned their applications to Carbon, a set of Mac OS X-compatible APIs originally culled from the classic Mac OS and rooted in the PowerPC architecture.)

Posted by ovidiu at 05:47 PM |

August 27, 2002



This evening I've upgraded my Powerbook 800MHz to Jaguar: overall it's been a pleasant experience.

In the past 5 years the desktop I used was Linux, and each update meant a complete reinstall of the system, with little being reused other than some personal data. Over these years I think I installed Linux on more than two dozen times on various desktop and laptop systems. This was driven primarily by my curiosity in playing with new desktop applications, just to get a feeling of how things evolve on Linux. Each time I would end up sticking to my favorite tools, WindowMaker as the window manager, XEmacs for editing, a highly customized version of exmh for mail reading, and a custom compiled version of rxvt as the terminal application. Each time I felt the quality and extensibility of the new tools was far less than what I wanted to have.

When I first switched to MacOS X, on 10.1.2, I was surprised to see how many applications were still in their infancy. As I noted in my first report on MacOS X, one of the primary tool I needed,, was very poor in features and capabilities. In the past months, I was essentially forced to use, ahem, Microsoft Entourage, which was surprisingly powerful and well designed.

Given my past experiences with system upgrades, I liked how easy and smooth the update to Jaguar was. I chose to maintain the current filesystem and upgrade to the new OS. After the installation, I had to do some minor changes of the global settings, as I inadvertently stopped the installation midway through, which caused these settings to not be transferred in the new system.

After the new system was installed, I configured my HP DeskJet 970Cxi printer, which is accessed over the network using an HP JetDirect 500x using AppleTalk. The printer installation was really nice and smooth, as opposed to the installation on MacOS X 10.1, for which I had to search for drivers and figure out how to install the network printer.

I found Jaguar's to be a much more improved application. It finally has good email sorting capabilities. It would be good if it had also the option to run an AppleScript as action when a message is selected. This could give even more power in the hands of demanding users.

But even as it is, it's quite usable, and I think I'll switch to using it. It was able to import all my Entourage email without any problems (about 20,000 messages in the past 3 months). One thing I don't know how well it handles, is the ability to connect to external POP3/IMAP/SMTP servers living outside of a firewall, by tunneling through a Web proxy (Entourage has this). I'll find this out tomorrow at work.

One thing I really like about is the fact that it doesn't use a proprietary file format to maintain its emails. With Entourage I was really worried that in only 3 months of using it, its database file grew to almost 2Gb in size, and the app was crashing quite frequently lately. I suspected the size of this database might have something to do with it, so I started to delete emails. This fixed the problems for a while, but they kept reappearing.

I'll check the much praised junk mail filtering tomorrow at office, where I receive about 100 junk mail messages per day. is a very good application, very similar to the one I'm used to from the old NeXTSTEP days and to rxvt. No surprises here.

The biggest problem is that initially I couldn't get XFree86 to start-up. I depend on XFree86 to run my favorite editor, which unfortunately is not yet ported to MacOS X.

I had installed the XTerm upgrade to prevent X11 from crashing, but it would still not run. I then discovered that in the process of upgrading, the /usr/X11R6 and /usr/local were not moved to the new location. I had to manually move them from their location in /Previous Systems/Previous System 1, and reinstalled the XTerm patch. I managed to get OroborOS X up and running, but my XEmacs would not startup because of missing symbols in shared libraries. I need to recompile it.

Mozilla works just fine, no problems so far. I haven't tried IE yet, but I'm not too worried about it.

One problem is that SSHAgentServices does not work on Jaguar. I rely on this little hack to enter the password for my SSH keys only once per login session. I tried recompiling the login plugin, without success. I need to investigate more what's going on.

ProjectBuilder seems to have been improved a lot. I've noticed it now has the ability to run shell scripts on the selection, a crude way of scripting, but better than nothing. I'll give it a try as my development editor for a while, to see if I can switch to using it.

I didn't have time to investigate whether I could write an AppleScript that gets notified each time the network location changes. I've found the /System/Library/Core Services/System Events application, but this doesn't seem to generate any notifications when the network location changes. I'll do some more research.

DiskCopy seems to be still hopeless in the ability to burn Windows CDs. I may be missing something however, many other people would have complained so far.

I'll come back with some of my findings in the next days.

Posted by ovidiu at 02:58 AM |

August 22, 2002

MacOS X 10.1 doesn't burn CDs for Windows!


Last night I wanted to put some pictures on a CD to be used on Windows. To my great surprise and dismay, I discovered that DiskCopy, standard MacOS X 10.1.5 application, does not know how to burn CDs running on Windows! At least not if you have long file names, not the dreaded 8.3 MS-DOS file names, which is useless today.

This is really unexpected from a system which wants to be compatible with both Windows and Linux/Unix. I hope this problem is fixed in Jaguar, I don't want to rely on my Linux box to burn CDs for Windows. And I don't want to buy any third party application to do this either!

Posted by ovidiu at 11:16 AM |

August 21, 2002

Bash customization for Terminal

Apple | Linux

If you're using bash as your login shell on MacOS X, you can setup Terminal windows to display the username, the machine and the pathname where of the shell is. Just add the following in your ~/.bashrc file:

case $TERM in
        TITLEBAR='\[\033]0;\u@\h: \w\007\]'

export PS1="${TITLEBAR}\u@\h:\w> "

Just make sure you disable all the "Title Displays" in the "Window" section of the preferences in

This works fine also on Linux and Windows under Cygwin.

Posted by ovidiu at 07:15 PM |

Macworld Jaguar review


Macworld has a good review of the new MacOS X 10.2 release, nicknamed Jaguar. The new system looks fairly promising, especially the improved speed and the new Mail application.

I'm curious to see if the control panel application is now scriptable through AppleScript. I'd really love to have an AppleScript script take care of reconfiguring my Web browser, mail and SSH settings each time I switch my laptop between home and work. Today, I have to do this manually, but I hope in Jaguar there's a way to run an AppleScript each time the location changes, which would allow me to do what I need.

Anyways, I've ordered my Jaguar copy from today. They have a special $99.95 for Jaguar if you pre-order it before August 24th. I hope to have the system by Saturday, so I can install it on my PowerBook.

Posted by ovidiu at 05:39 PM |

August 09, 2002

MacOS X on Intel hardware


There are many rumors flying around about whether MacOS X will be ported or not to Intel hardware.

If one looks back at the roots of the main technology on MacOS X, the old OPENSTEP system, and the fact that it was available on four different architectures (Motorola 68040, Intel, PA-RISC and Sparc), you'll have no doubt that this is possible from a technological point of view.

However for this to happen, Apple has to gradually phase out the old MacOS, and have the majority of the software vendors, at least the important ones, port and write new applications using the new platform. The faster this process happens, the quicker we'll probably see MacOS X being used on Intel platforms. Without the third-party software, Apple cannot make this transition.

Posted by ovidiu at 06:11 PM |

August 06, 2002

SSH behind a firewall

Apple | Linux

I've finally figured out how to cleanly access hosts outside my company's firewall using OpenSSH.

OpenSSH has a way to specify an external program that performs the TCP/IP connection, instead of doing it directly. This allows you to specify an external program that connects to a Web proxy, and tells it to connect to the external machine you want to connect to, using the CONNECT method.

The following connect.c program does exactly this. Just compile the program on your machine, put the resulting binary in a convenient place (like /usr/local/bin), and add the following line at the top of your ~/.ssh/config file:

ProxyCommand /usr/local/bin/connect -H web-proxy:port %h %p

Each time you run ssh host, OpenSSH will spawn off connect and pass to it in the command line the host and port number you want to connect to. connect will take care of connecting using the supplied Web proxy information.

You may want to configure the ProxyCommand line to be on a host basis, instead of being globally applied to all the hosts you connect to, including those inside the firewall. Read the OpenSSH configuration manual to understand how to do this.

Posted by ovidiu at 06:55 PM |

July 29, 2002

iTunes, custom HTML templates, and CD burning


Over the weekend I played with my PowerShot S30 digital camera and iPhoto. The program is really nice, but I wish it could allow me do few more things.

I installed the BetterHTMLExport plugin in iPhoto, which allows you to customize the look of your pages. Next step is to write the templates to look the way I want them to.

I then need to find or write a small plugin which allows the generated HTML to be published on a Web site of my choice, and not on, which is going away anyways. It's a shame the BetterHTMLExport plugin doesn't come with the source code, I need to reverse engineer the plugin API myself. I've used class-dump to do the initial investigation of the plugin API.

Another thing I'd like to be able to do in addition to publishing the pictures on the Web, is to save them on a CD. I did find a plugin on the Web that does it, but it requires an external program, Toast Titanium to be able to do it (the program itself is ~$90). I think burning the CD can be done easily with the help of the MacOS X included hdiutil, a command line program for burning CDs.

Posted by ovidiu at 02:29 PM |

June 27, 2002

Apple ad


I found this advertisement for MacOS X. Really cool, I haven't seen it before!

I wonder why Apple doesn't put these ads online, as well as in newspapers. I for one, and I'm sure many other professionals, don't read the press very much nowadays. There's just too much stuff on the Internet to read daily.

Posted by ovidiu at 12:48 PM |

June 25, 2002

How much time would take to port XEmacs to MacOS X?

Apple | Emacs

Today I spoke with Christophe de Dinechin about his work on porting GNU Emacs to the MacOS X user interface. His job was a lot easier since he started with an old NeXTSTEP port of GNU Emacs. There is no such thing for XEmacs, everything would have to be written from scratch.

Fortunately, XEmacs is already ported to the Gnome and WIndows user interfaces, so the system must be well designed for cross-platform UI toolkits. Porting to a different UI widget kit requires a lot of work: run loop management, event notification, windows, menus, fonts, various GUI classes and their Lisp binding.

One thought I had is that most of the work being done here is quite generic, and can probably be reused by other GUI free software programs out there. Why not then come up with a port of the Gnome toolkit to native MacOS X AppKit classes? Not only XEmacs could benefit from this, but other programs too. There would still be a lot of fine-tuning required by each program, but I think this is a better approach in the long run.

I'll have to think about this a little more. And find the time to do it too...

Posted by ovidiu at 11:14 PM |

Missing XEmacs

Apple | Emacs

One month in MacOS X exclusively. One program I badly miss on MacOS X is Xemacs. On my Linux desktop, I used to do pretty much everything in Xemacs. My mail program was setup to compose and reply to messages in Xemacs. All my development work, C, Objective-C, Java, XML and XSLT happened in Xemacs.

I tried several alternatives. I tried the editor from ProjectBuilder 1.1.1, which comes with the development tools on 10.1.5. Unfortunately PB cannot be customized through a scripting language; if you ask me this is a real shame not to have this capability in the development environment of the nicest operating system (this is what MacOS X is, right?).

Next, I tried JEdit, which looks really promising; however it is too slow and not as customizable as Xemacs. In Xemacs if you take the time to print the developer documentation and use it both as a learning tool and as a reference, you get really productive after just few months of using the editor. In JEdit this documentation is not yet there, but I think/hope it will be there soon. The fact that's written in Java and uses the BeanShell for scripting makes it a great platform. Unfortunately, Java 1.3.1 on MacOS X is still too slow for a really nice and fast editor: JEdit feels slow compared to XEmacs, which is just fast.

So I decided to compile XEmacs for X-Windows. I installed XDarwin, a free software and really nice X-Windows server. I ended up compiling a bunch of other libraries (libjpeg, libpng, ungif, pspell, libtiff), a decent and fast window manager WindowMaker, before I could compile XEmacs 21.4.8. The compilation went just fine, no problems whatsoever. The resulting binary however seems to lack the buttons in customization buffers. I think it's related to the lack of Motif libraries. I'll compile LessTif and recompile XEmacs, see if I get the buttons.

The integration between XEmacs running in X-Windows and the rest of MacOS X is just awful however! The copy/paste mechanism is terrible and convoluted. The Cmd-S keybinding for the save operations doesn't work in XEmacs. There are many other things which are simply not MacOSX-ish.

Posted by ovidiu at 10:54 PM |

Migrating from Linux to MacOS X


It's been a month since I'm on MacOS X.

The consumer part is really nicely done. I love the integration with iPod for example, it's really easy to update this little device with the MP3 you just ripped by plugging in the music CD in the laptop.

I guess any user of any operating system, gets into habits which are hard to accomodate on the other operating system he/she would really like to run. At least this is my case migrating to MacOS X from Linux.

After more than 5 years on Linux, I really miss few things on MacOS X. I miss the freedom I have to hook into almost every application, by cracking it open and extending it to fit my needs. This is the case for example with the mail application: I used Exmh for a long time on Linux. I modified it to add various customizations I needed. I also used procmail quite a bit to sort out all the email I'm receiving daily.

As I mention in an earlier post, I found MacOS X's Mail application to be quite a poor replacement to the above setup. There is no way, at least in 10.1.5 to specify multiple criterias to filter on, specify multiple actions to be taken on a message, and to filter junk mail. The last one is getting even more important nowadays with the number of junk emails reaching 100 in some bad days.

Surprisingly I found Microsoft Entourage to be quite good at the above tasks. The only thing missing is the ability to remove duplicate emails, which are messages posted across multiple mailing lists. I believe it can be fixed through the use of an AppleScript action, but I still need to learn that. Unfortunately Entourage comes with Office v. X, which is quite pricey (over $400 last time I checked).

In fact this is one of the first things you notice when you change a free software operating system, and move to a proprietary one, regardless of how nice it is: you have to pay for good programs, because the free software ones are not yet ported. At least not the good GUI programs.

Another program I badly miss on MacOS X is XEmacs. More on this topic in my Emacs log.

Posted by ovidiu at 02:54 PM |

June 09, 2002

New to MacOS X


This is the second week since I bought my PowerBook 800Mhz, a really nice machine. There are some crude things about its hardware, like the lack of a track point, delete and function keys that work without having to press the "fn" key.

The software is very nice, as it reminds me of the old days of NeXTSTEP/OPENSTEP.

However I found some programs to be really crap, especially, which is really surprising, given the state of in NeXTSTEP (but then this was written using the old APIs, and Apple couldn't probably convert the application easily). Its filtering capabilities need a lot of improvement. I read they're fixing this for the next Jaguar release, I can't wait for it. Since I receive about 2000 messages a day from various mailing lists, adequate filtering is essential. My procmail rules have grown so much in the past five years, I cannot manage my email without them. Unfortunately I couldn't figure a way to hook up procmail with In the old NeXT days, there was a command line tool, appnmail to append a new message to a mailbox. This doesn't seem to be available anymore...

Posted by ovidiu at 12:00 PM |
Cool stuff
  Arduino TinyWebServer: part 3 and part 2
More from me
Picture gallery
Copyright © 2002-2016 Ovidiu Predescu.