Archive

Posts Tagged ‘mac’

Removing printing restrictions in 10.5

January 13th, 2010

I am trying to write a good one-liner for removing all restrictions on printing for Mac OS X 10.5. I had thought that sed would be perfect for this, but I can’t arrive at a simple syntax for appending new lines that works well when pasted into a terminal window. Here’s what I ended up with:

perl -p -0 -i '.bak' -e 's/(Policy default).*(Policy)/$1>\n<Limit All>\nOrder deny,allow\nAllow from all\n<\/Limit>\n<$2/s' /private/etc/cups/cupsd.conf

Rather brutal, it just guts the default policy and replaces it with the following:

<Policy default>
<Limit All>
Order deny,allow
Allow from all
</Limit>
</Policy>

Greg Neagle has a useful article about printing in the enterprise. Apple suggests adding the network group to the local lpadmin group, but points out that mobile users would need to be added individually. In my case most accounts are mobile accounts and we trust everyone to manage print queues on a Mac, so removing all restrictions is acceptable.

david ,

Snow Leopard: a reactionary writes

December 20th, 2009

Things I like about Mac OS X version 10.6:

(Mac OS X 10.6 is also known as Snow Leopard, although I dislike Apple’s use of the operating system codename in their publicity material because it leads to conversations where people talk about “Leopard” and “Tiger” and one has to stop for a second to translate those to actual operating system versions and no-one is ever going to refer to Mac OS X 10.3 as Panther these days, let alone 10.2 being Jagwire or heaven forbid Puma and Cheetah. What are the chances I’ll have to look up the codename for 10.5 by the time we reach 10.10? Version numbers are not so evocative but are less confusing than codenames. This doesn’t mean I will stop naming hard disks after Mac OS codenames – my desktop has Veronica, Gershwin, Harmony and Sonata connected at the moment, with Copland and Pink sitting on the shelf as appropriate…)

Things I like about Mac OS X Snow Leopard:

  • Apple’s drivers for my Epson all-in-one printer / scanner actually work. Epson’s drivers for the same printer / scanner only worked if you never used the scanner and promised to attend church more often.
  • Significantly snappier.
  • QuickTime Player’s minimal interface.

Things I dislike about Mac OS X Snow Leopard:

Everything else in 10.6 is good. However it strikes me that the de-emphasizing of old-style Mac metadata (type / creator codes) and the default of not showing your computer’s hard drive icon on the desktop are evidence of the triumph of old-school Next-ies within Apple.

I think the decision to cover-up the hierarchical filesystem is a bad thing.

P.S. Wouldn’t it have been awesome if, having released Mac OS X Cheetah, Apple had continued with naming their releases after other famous Hollywood animal actors? Why they stopped naming releases after disappointing Sylvester Stallone movies is beyond me – most any version of System 7 could have been named Lock Up.

david

Network users and Mac 10.5 archive and install

November 6th, 2009

When upgrading a Mac from Mac OS X 10.4 (Tiger) to 10.5 (Leopard), remember that network accounts are not included if you do an archive and install and choose to migrate existing users. If a network account had its home folder at /Users/jbloggs then it will have been moved to /Previous Systems.localized/2009-11-06_0346/Users/jbloggs (although the date portion will be the date that you did your install).

This applies to network accounts which authenticate against Active Directory and do not have a mobile account.

Why my place of work used to setup Macs with the option for create mobile account at login turned off is a mystery to me.

david , ,

Excel scroll bar bug

October 7th, 2009

Microsoft Excel 2008 for Mac has an irritating bug where only the active document window has scroll bars. If a second document is open, or even if you only have one document but Excel is not the front-most application then the window has no scroll bars and ignores scroll messages from the mouse. This happens in Excel 12.2.0 (and a couple of earlier revisions behave the same).

Excel scroll bars in inactive window

Excel scroll bars in an inactive window

The correct behaviour is for scroll bars in inactive windows to be drawn in an inactive state and to allow scrolling even when the window is not front-most.

I rather like Excel. I thought it was the least crashy of the assorted junk Microsoft released as Office 4.2 for Mac back in 1993. Fuck me that was a pile of shit.

david ,

10.5.7 fixes AppleShare speeds

May 20th, 2009
Comments Off

The recently-released Mac OS X 10.5.7 update fixes the atrocious AppleShare transfer speed bug that was introduced by 10.5.6. The problem was that copying files larger than a few hundred kilobytes to certain AppleShare servers (including Mac OS X Server 10.4.11) would go extremely slow, and usually fail after a minute.

But copying files from the server to your Mac was hunky dory! Fun.

I like to think the programmers at Apple refuse to consider allowing software to be released until they have written comprehensive tests for regression testing. I like to think I do the same (I don’t, but I respond faster when you want my attention).

david ,

Package installer wish

April 13th, 2009
Comments Off

Mac OS X administrators frequently need to build installer packages to help deploy and manage software on a network of Macs. The motive for creating a package is one of

  • Packaging software that does not have a dedicated installer. This applies to all the nice drag-and-drop applications like Firefox and Cyberduck.
  • Packaging your own site’s software, whether that is as simple as printer descriptions or as complex as a full-blown application.
  • Re-packaging some miserable piece of shit installer that either totally denies the harsh reality of Apple’s non-cross platform installer formats or which manages to make such a balls of an install package that you were better off before they bothered. Most everything by Adobe is in this category.

The first of those three is very common, and it ought to be easy to create packages for existing installed applications. Apple’s PackageMaker application provides a nice interface for creating packages, but it has two drawbacks:

  • PackageMaker is not installed by default on Mac OS X (it gets intalled as part of the Developer Tools).
  • Before PackageMaker 3 (part of Xcode 3, which requires Mac OS X 10.5) there was no simple method for quickly packaging an installed application.

What I want is a package creation tool that works on a 10.4 system without requiring the developer tools and which can be scripted. The packagemaker command-line tool requires an existing Info.plist file or .pmdoc file if you want to set a custom default installation directory – not the end of the world, but tedious.

Useful links

  • Iceberg is an excellent graphical tool for building packages, by Stéphane Sudre who also wrote up the…
  • PackageMaker how-to which is a very useful introduction to the details of .pkg files. Bit out-of-date these days.
  • Man pages for the command-line packagemaker and for the installer tools.
  • Apple’s software distribution documentation, which is very quiet on the subject of custom installer plug-ins. Xcode has a template project for an installer plugin, and the InstallerPlugins.framework headers have lots of information.
  • Installer-dev mailing list, where the people who wrote the tools and documentation help out a lot.
  • JAMF Composer which is part of the Casper management tools. Version 7 is no longer free.

david ,

Adobe’s download manager

February 3rd, 2009

I had to install a trial version of Adobe Flash CS4 the other day, and came across their latest tactic in making the world more complicated and hateful: the Adobe download manager.

adobe-download-manager

From the miserable user guide:

Adobe Download Manager is a stand-alone application that improves the process of downloading files from Adobe. Adobe Download Manager provides the following benefits:

Here the document explains the benefits point by point. I dislike those benefits.

  • Selects an Adobe product download destination

On a Mac, Adobe download manager ignores your download destination as set in the browser’s preferences. For Mac OS X 10.5 Apple went so far as to add a “Downloads” folder to the standard set of folders in an account. Adobe download manager prefers the “Desktop” and thinks you are wrong.

  • Allows you to pause downloads
  • Allows you to resume interrupted downloads

My browser already allows me to pause and resume downloads.

  • Allows you to download multiple files from a single links

I don’t see why clicking a single link and unexpectedly getting multiple downloads is good. Other single links don’t do that.

  • Allows you to download your products securely

As well as supporting HTTP, my browser supports an encrypted version known as HTTPS.

  • Verifies download integrity and completion

I accept that a regular download says nothing about the integrity of the file itself, and that this can be a problem. The geeky / secure way to fix this is to provide verifiable checksums for file downloads. But if the file is inadvertently corrupted then a disk image is likely to fail to mount (so you would know it was incomplete). If the file is maliciously corrupted then why would trusting Adobe’s Java download manager to verify the file be any better than trusting the file in the first place?

  • Leads you to the installation of your product

On a Mac there are existing guidelines for packaging software which do a better job of leading the user to the start of the installation process.

  • Provides a simple interface

It is simple. But the existing download methods are simple, and are familiar. Why would a new simple interface be necessary?

  • Provides System Tray downloading (Windows only)

Good for them. But irrelevant for Macintosh users, as is the helpful text on the download page that explains I will be downloading two files, an .exe and a 7zip archive, both of which are needed (unless you download the Mac version).

  • Provides background downloading

You mean even when I’ve explicitly quit my browser session your downloader ignores me and keeps working? Why?

  • Provides assistance with finding the download

If the download was saved in the expected folder and used the recommended install behaviour then I wouldn’t flipping need your assistance you arrogant twats.

Ugh.

Download managers were genuinely useful ten years ago when large file transfers were likely to be interrupted either because the server was at capacity or the client’s connection was unreliable (i.e. dial-up modems being forcibly disconnected every hour by your ISP). But I don’t need a download manager in 2009, not even when downloading a 1.36 gigabyte disk image file. I have a 40 megabit pipe and I don’t want to download another piece of software just so I can download a piece of software.

However Adobe’s download manager is not optional. If you want to download the Flash CS4 trial then you are required to use their downloader. Other Adobe patches and updaters are available without having to install the download manager, but this one absolutely will not work without you running a Java application in your browser!

But it is unnecessary. My browser is perfectly capable of saving the file to disk in a timely fashion, and it even knows how to pause and resume a transfer because it understands how to send the Range header in an HTTP request.

I wish Adobe would put the right people back in charge. The Java downloader is a pretty minor thing, but it smacks of a disregard for the simple and standardized mechanisms provided by a platform. In this respect it is much like Adobe’s continued refusal to kill their terrible custom Mac installers.

Once I got Flash CS4 up and running I found myself wondering why it kept crashing. And then I realized that Adobe has changed the behaviour for Flash CS4 so that closing the final window quits the application…

My spirits sank lower.

david , , , ,

Setting Mac Office 2008 default save formats

January 29th, 2009
Comments Off

Microsoft Office 2008 for Mac uses the new Office Open XML formats by default which is a pain in an office where many staff will be using previous versions for some time.

You can easily change the default save format within the preferences for Word, Excel and PowerPoint, but the simplest thing when deploying Office 2008 to a whole bunch of machines is to set the default format once and have every user pick up that setting.

Fortunately Microsoft Office 2008 uses the system defaults database and even honours preferences from the Library domain.

Here’s the preference files in /Library/Preferences for Excel, PowerPoint and Word:

computer:~ david$ ls -al /Library/Preferences/com.microsoft.*
-rw-r--r--  1 root    admin  256 29 Jan 14:21 com.microsoft.Excel.plist
-rw-r--r--  1 root    admin  301 29 Jan 14:21 com.microsoft.Powerpoint.plist
-rw-r--r--  1 root    admin  257 29 Jan 14:14 com.microsoft.Word.plist

Contents of the Excel plist to save in Excel 97-2004 Workbook (.xls) format by default:

computer:~ david$ cat /Library/Preferences/com.microsoft.Excel.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>2008\Default Save\Default Format</key>
    <integer>57</integer>
</dict>
</plist>

I wonder what the significance of 57 is… Probably meaningful in hex or something.

PowerPoint plist to save as PowerPoint 97-2004 Presentation (.ppt) by default:

computer:~ david$ cat /Library/Preferences/com.microsoft.Powerpoint.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>2008\Default Save\Default Save\Default Format</key>
    <string>Microsoft PowerPoint 98 Presentation</string>
</dict>
</plist>

Word plist to save as Word 97-2004 Document (.doc) by default:

tfg02215-2:Preferences dbuxton$ cat /Library/Preferences/com.microsoft.Word.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>2008\Default Save\Default Format</key>
    <string>Doc97</string>
</dict>
</plist>

Let’s create these all using the defaults command in one go:

defaults write /Library/Preferences/com.microsoft.Excel "2008\Default Save\Default Format" -int 57
defaults write /Library/Preferences/com.microsoft.Powerpoint "2008\Default Save\Default Save\Default Format" "Microsoft PowerPoint 98 Presentation"
defaults write /Library/Preferences/com.microsoft.Word "2008\Default Save\Default Format" "Doc97"

Sweet.

Now any new user on that machine will pick up these preferences and will use the old formats by default (but can choose to use the new formats by changing preferences if necessary).

david ,

My Mac is broken: Spotlight example 1

June 10th, 2008
Comments Off

Gah.

Just thinking about having to find files on a Macintosh fills me with dread. Spotlight is useless for finding anything unless you know where it is already. I am in the half of the Venn diagram labelled believes names of files and folders have meaning. In the other half are the interface designers of Apple’s Spotlight technology.

Here’s a plum example of how a Spotlight window in Mac OS X 10.5.3 does an alphabetic sort-by-name of results when searching for files using File Name criteria.

Spotlight's notion of an alphabetical sort

I hate Spotlight. Makes me wonder what the point of all that amazing search engine technology is.

david , ,