Suppliers

Comparison of sys.path on Python 2.3 and 2.5 framework builds

From Python 2.3.5, installed by default in Mac OS X Tiger:


>>> import sys
>>> print(sys.path)
['', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python']
>>> for z in sys.path:
... if '2.3' not in z:
... print(z)
...
>>>

From Python 2.5, built as a framework and available for download:


>>> import sys
>>> print(sys.path)
['', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages']
>>> for z in sys.path:
... if '2.5' not in z:
... print(z)
...
>>>

This simply means there are no directories in common in sys.path — the list of directories where modules can be installed — between these two versions of Python. I find that a bit annoying, since I can’t by default count on deploying one module to a single location that will work in both the default and upgraded versions of Python.

That lack of a default common location also has an impact if you’re managing the filesystem with Radmind.

Disk Utility, restoring images, and periods

Yesterday, I thought I’d came across a potential solution to a problem I’d been having with restoring disk images to target drives using Disk Utility. I keep getting error 22, “invalid argument,” when restoring images over HTTP, using Disk Utility on the original Tiger version of the Mac OS X Install DVD.

While there could be some form of image file corruption, restoring the same images locally — over FireWire target disk mode, for example — appears to succeed reliably and repeatedly. (See also this+Shirt+Pocket+Software+thread, where the core error was also not resolved.)

Let’s say that you have your images stored on a Web server — preferably one with some access controls, because you don’t want your system images open to just anyone. That should let you use Apple Software Restore’s HTTP-based image restore feature. You have already prepped the images for ASR, creating them appropriately (possibly through the use of shadow files) and applying the volume-level checksum that is required for block-level restores.

However, let’s assume that your naming convention for system images includes more than one period. After all, you’re creating images for Mac OS X versions like 10.3.9 and 10.4.8 … it’s natural to want to use those version numbers somewhere in your system image names. There’s no sense in changing those periods to some other character, right?

Well, I surmised there might have been a reason to change or remove those periods. I expected that removing — or encoding with %2e (as noted in this URL encoding reference) — the periods from a test image’s name would have a beneficial effect, to let me restore it successfully via HTTP. However, it was still a no-go with the encoded characters, so I’m now back where I started. The image restoration works until near the end of the process, and I get error 22 again. Grr.

I’m wondering out loud now whether there’s a problem with automount, since I’ve seen some search results that seem to mention error 22 in conjunction with it. I have no clue why it would fail only for HTTP-based ASR restores using a Tiger install DVD, though.

It seems I can recall the restore-via-HTTP feature working at some point in the past, but it certainly hasn’t done so to my recollection under Tiger.

A success story for resetting the Tiger printing system

I’d been having problems for several weeks, maybe months, with printing out some kinds of documents from my office MacBook Pro. I’d send the print jobs to our trusty Xerox WorkCentre Pro 55, and I’d get one copy of the document. This was okay when I only wanted one copy. But, I’d increasingly had a need for several … so defaulting to one just made it difficult to get multiple original copies (or “mopies,” I guess, if you subscribe to HP-lingo) when I needed them.

This problem seemed to spread from PDFs in Safari, to all PDFs, and then to other document types — including, most recently, documents printed directly from Microsoft Word 2004. At this point, I became aggravated enough that I tried some very minimal troubleshooting, which quickly led nowhere. I just wanted this to work.

So, I took the shotgun approach. I hate doing this, because I want to know the whys and wherefores of problems. I want to apply the scientific method to finding and resolving the issue at hand. I want to prevent the problem from appearing again. In this case, though, I just needed to print … and I resorted to the “Reset Printing System” menu command in Printer Setup Utility.

Voilá! That let me print multiple copies of my Word files again. Great!

I next tried a PDF that had failed to print completely before. I’ve had success with that, as well. Excellent.

Therefore, if you know the definitions for your printers — because the “Reset Printing System” command in Tiger will delete your print queues and force you to re-add them — then the reset option can resolve some strange problems and get you back in working order.

Updating a base Mac OS X system image using shadow files

When deploying system software with disk images, it is helpful to have various checkpoint images that you can revert to while you’re building up a fully-fledged template computer. This is something they teach you in school (really, I was taught it in a systems administration class) and it’s more or less encoded in the solution accelerator documentation for Microsoft’s Business Desktop Deployment 2007 for Windows.

However, if you’re updating images, keeping the base and intermediate images can strain your storage capacity. Mac OS X lacks the compelling live editing features of Microsoft’s new WIM image format — which if it had appeared first on the Mac, I’d be trumpeting loudly, so I feel compelled to at least give a nod to Microsoft here.

Since I’m always struggling with storage capacity and I prefer having an up-to-date base image, I thought about this problem a bit in the context of Mac OS X imaging and have come upon what seems to be a unique solution: the use of shadow files.

Here’s the basic idea:

  1. Create a base operating system install on a partition of your template computer’s disk
  2. Capture a compressed, read-only image of it immediately (go wild, save the extra percent or two, and compress it with the Tiger-only bzip2 scheme … you can afford to do this if you have time and are only deploying with a Tiger startup disk)
  3. Scan the base image for Apple Software Restore’s block-level checksums
  4. Attach that base image to the filesystem — honoring ownership and specifying a shadow file — so that it acts as if it is writable, using hdiutil
  5. Install the latest Mac OS X combo update on it
  6. Create a new read-only compressed image of the mounted volume
  7. Prep the new updated base image for ASR.

Congratulate yourself on this use of shadow files, because you’ve saved at least one intermediate step and the space required for a full read-write disk image — or worse, an extra local partition needed only for restoration and updating the base image.

Unmount that volume and throw away the shadow file at this point if you want, because you’ve now got two system images ready for deployment. One has the base system software, and serves as a checkpoint that you can return to later; it’s the base for all future updates of that major revision of Mac OS X. The other image has the latest version of Mac OS X. If you’re deploying that image with ASR, the result will be a more secure system because it’s closer to being fully patched — and it should take less time to update it with the additional security updates and application installs — whether you use installers or Radmind or another solution — because you’ve got the bulk of the operating system done.

Unfortunately, many updates can only be installed on the startup disk and thus cannot be included in the updated base image. Beyond the combo operating system updates, few of Apple’s other installers will work on a non-startup volume. But you can install them after deploying the updated base image, using your tool of choice. For reasons like this, Geoff doesn’t see updating the base image as valuable, but in some IT environments, it may be very worthwhile.

My next step is to script this process and tie it to a watched folder. Imagine dropping a combo update into a watched folder … and letting a script generate the new, updated image for you.

Pet peeves involving a company and product name

Nadyne writes about her pet peeve #1, which involves people writing “MAC” instead of “Mac.” This is also a frustration of mine, and others don’t always see it until you explain it to them in terms that are closer to their own experience.

My corollaries to Nadyne’s comments are:

  • I also dislike when people use “Mac” when they want to refer to the company, “Apple.” As in, “Why doesn’t MAC just sell the operating system to run on PCs?” I’ll forgive certain friends on this score, but the more casual the acquaintance, the more irritating it is.
  • It amused me immensely a few years ago when I made a Spell Catcher X substitution to change “Windows” into “WINDOWS” automatically every time I typed it. However, the Windows people didn’t get it and it rankled my sense of style, so I gave it up. (I’m almost sure I blogged about it and I’d like to link to that, but of course, that’s bogged down in my inability to properly import my Manila data into this new Drupal site. Sigh.)
  • I don’t think I could bring myself to substitute “WINDOWS” for “Microsoft” via Spell Catcher. I think that is one line I didn’t cross. (In distinct contrast to the self-proclaimed crosser-of-lines.)

[Via go ahead, mac my day.]

Happy sixth, Mac OS X

Today is the sixth anniversary of Mac OS X.

I can remember how excited I was to get Mac OS X 10.0. I picked it up early, before it was actually supposed to be sold, at Staples in Victor. I even got them to price match to a Web price of $99, but not all the way down to the academic price of $69. I bought it partly for the cachet of getting it early.

Geeky, but true.

Phantom directory services and home directory sync

I’ve been toying with the idea of using network home directories on my personal systems. I want to have the same home directory on every computer, but I don’t want to have to mount it entirely over my network. So, a mobile home directory, with home directory sync to my Infrant ReadyNAS NV+, sounds like an interesting solution.

Unfortunately, I lack a directory service that I could use as a data source for the right attributes. I simply don’t have an Active Directory or Open Directory at home. Nor, really, do I want to run one — especially since I’d have to explain to my lovely and far-too-understanding wife why I can’t recycle an old computer that she would love for me to get rid of. Grin.

On the other hand, I do have the ReadyNAS, so I do have storage for my home directories. Even if the ReadyNAS’ AFP support is not the fastest, it’s still there and running all the time. Actually, given the performance of AFP on it, home directory sync probably is a better solution than an all-out network home directory setup.

So, the idle thought hit me the other day: why not create a phantom directory service, using DirectoryService’s ability to handle static mappings? I’d just need to define a directory that has no directory server, create static mappings for the right attributes, and use the relatively new variable substitution feature for static mappings to get the home directory attribute set up correctly for each local user account on the system. The main trick, as I can see it, is that the UID and GID for my local accounts is not necessarily consistent between computers.

I haven’t tried it, but it suuure sounds promising when the idea is rattling in my head. Hm.

Bullstorm Keyword Manager plugin for iPhoto

Bullstorm’s Keyword Manager, a shareware iPhoto plugin, looks like a great addition to Apple’s consumer photo management application.

I’ve tried both alternatives — the built-in keywording UI, and the freeware Keyword Assistant — and neither has been entirely satisfactory. Of course, I now have those experiences to compare against the much more effortless tagging in the current Del.icio.us interface, which is one of the most fluid keywording interfaces I’ve used yet. I don’t know if Keyword Manager will be an improvement (especially one that is almost half my cost for the iLife suite), but it has promise that it could be.

Thoughts on Mac OS X 10.4.9 from the MacEnterprise extended KB article

Based on my reading of the MacEnterprise.org extended knowledgebase article on Mac OS X 10.4.9, some interesting changes have been made. Here are some of my comments on items listed in that article:

  • “Includes iChat support for USB Video Class webcams,” which seems to mean that UVC webcams will work without additional drivers on this version of the OS … so I doubt we’ll see a replacement for the standalone Apple iSight and I wouldn’t doubt we’ll just have to make do with the third-party opportunities this presents.
  • “Resolves an issue when using Kerberos authentication with Active Directory if the user is a member of many groups,” which may mean that my problem with binding to Active Directory over UDP using an account with a large TokenGroups attribute is resolved … presumably, if it is fixed, the kpasswd utility now supports TCP as well (although I do not see a change to /usr/bin/kpasswd in a Radmind transcript, the Kerberos framework did change).
  • “Adds support for WPA2 encryption in Network Diagnostics,” which is an option that is coming at just the right time for me.
  • “Includes updated security certificates,” which should mean that the root SSL certificates database has been updated (I note in a Radmind transcript that both X509Anchors and X509Certificates has changed with this update).
  • I’m not exactly hip with whatever change happened in /private/var/db/sudo. Based on what I’m seeing, a subdirectory for each sudo user will appear; so far, I’ve only seen this on Radmind model systems, and so I see one subdirectory with a blank “ttyp1” file inside. I think I might want to put this new directory in a negative transcript for Radmind.

[Via Philip Rinehart on the MacEnterprise.org list.]

Reunion 9 looks and feels new

I’ve been taking a semi-serious look at Reunion 9, since I have a passing interest in genealogy. (I’m not using tracking family relationships to the extent that Philip is, either personally or professionally.)

Reunion 9 was just released this month. It debuted a few days before I visited Leister Productions’ site, which was somewhat fortuitous for me.

The main drawback with Reunion on Mac OS X in the past, to my eye, was its dated Classic-style interface. It just didn’t feel like a Mac OS X application — a trap that many applications that came from those days share. (I live in Entourage, which feels old in some spots. And so many of the graphic design applications I once used have felt that way, leading me to look at other options.) I can appreciate that this is something software developers will often want to change, but that software development simply takes time. Besides that, as Apple adds new functionality to the OS frameworks, developers must decide whether to use those features (locking you more and more into Mac OS X, and specific versions of it) and perhaps remove their own code, which it may have replaced.

So this new version is invigorating to me. It seems like the developer has invested int the future. The application itself looks fresh and feels much more like a program that has both feet firmly planted in Mac OS X. I’m going to take the demo for a spin and see what it can do, but it may be one I end up registering.

Syndicate content