blog advertising is good for you


blog advertising is good for you
User login

CUPS is the name of the service that handles printing in Mac OS X 10.3 to 10.5. It has a lot of features that aren’t really pushed in the GUI in Mac OS X, but users are able to get at those features by using the special administrative interface at http://localhost:631/.

One of those features is classes. A class, in this context, is a group of printers that can be made to look as if it were one printer. This is great in lab settings where you have half a dozen printers of the same type as you can add them all to a class on a print server and have everyone print to that queue. Then whichever printer is free (or round-robin) will print the job. There's more »

If you move the Leopard dock to the side of the screen you get a dock with a gray background rather than the glassy surface. If you want that dock on the bottom of the screen as well, simply run the following:

defaults write com.apple.dock no-glass -boolean YES
killall Dock

This sets a hidden default on the Dock and then forces it to restart.

For the Tooltip Guy

I went to the GUI feedback session at WWDC last year and in the midst of all the yelling and screaming over the new dock and menu bar there was one guy with a wholly different mission: be able to turn off tooltips. His complaint (a valid one, I feel) is that every time he wants to sit and think about what’s on-screen, a little yellow box comes up where the mouse is, and there’s no real “safe spot” for the mouse that doesn’t do this in most applications.

So, I present a little tip I discovered shortly afterwards and appear to have not written up. I dedicate this to Tooltip Guy, wherever he is.

defaults write -g NSInitialToolTipDelay 99999

You now have 99.999 seconds to think at a given time. Replace -g with the ID of any application to change it in that application.

I was at WWDC this last year and went to a lot of sessions that were interesting, but didn’t really grab me and tell me that I absolutely had to learn the technology and use it. It was all interesting, of course, but … eh.

Then I went to a session on using Xray (now Instruments) and DTrace to debug things. Yes, things. It’s not just for developers and their programs, but also for sysadmins and their systems. After I saw what it could do, well, let’s just say I had a domain name registered and a site up before the next session (I love Drupal). That site is DTrace Scripts. There's more »

NetInfo is dead. It’s gone. It’s a part of the past. It’s like that ghost of a bad dream you have in the morning where you can’t quite remember why you’re shaken, but you just remember that you were and that it was horrible.

Leopard ate NetInfo.

In its place is a new native Directory Services store based on folders and XML property list files. Yep, a replacement for flat files that uses … flat files. Kind of. There's more »

Cleaning Out the Queue, August Edition

Welcome to yet another series of short answers. I’d write something larger but there are two factors preventing that:

  1. The lack of time to actually write it, these days.
  2. The lack of geeky questions in the queue to fuel my desire to slack off on real work and write something fun.

It’s not you, it’s both of us. It’s just not working out. However, I think with a little effort we can get this going again.

So, with that in mind, let us go forth in my effort to reduce the size of the queue in my search for something to write a long and heavy article about… There's more »

There’s nothing worse than an application that hides its data … no, your data from you. As a developer, you should take into account your experience as a user and avoid lock-in as much as possible, as well as enable useful “mashups” with other applications. To make it easier for users to use both your application and another with the same set of their data, you need to make it easy for users to get that data out of your application. You could support every common export type for your kind of data and hope that’s enough, or you could create a simple API to get at the data so that your users can do the work of making those exports. On the Mac, the easiest and most standard way of doing the latter is AppleScript.

With AppleScript you can setup a basic description of where you keep your data and let Cocoa Scripting take over and pull it all out of your program for you without you needing to change much at all. You’ll get features like searching and basic property editing for free. It’s quick, easy, and wonderful.

Unless you’re using Core Data. Like many other features in Mac OS X, gaining all the benefits of Core Data exempts you from the “easy” part that comes with the rest of the OS (like, oh, threading and autosave-enabled NSDocuments, for instance). It doesn’t make it impossible, it just makes it a very slight more interesting. In fact, making a read-only AppleScript interface is rather simple. Making a read/write interface is a minor pain in the posterior. Today, I’ll go over how to make a read-only interface and touch on the difficulties of making a read/write interface with Core Data. Later, I plan on covering the read/write interface when I’ve solved the ills of doing so and can explain how I got it to work. So much of this is “hold the bunny ears halfway up and lift your right leg towards the south” that it’s sometimes hard to say how something is working, or not. There's more »

Pretending to be an iPhone

This is entirely pointless if you have an iPhone. However, if you’re locked into a Sprint contract until next October, sometimes it’s nice to see how the other side lives.

The iPhone redirects RSS requests through reader.mac.com with a special URL: http://reader.mac.com/mobile/v1/http%3A//domain.com/feed.xml. However, going to that directly on a Mac gives you the “You’re not an iPhone” message.

Curious as to what I was missing, I grepped MG’s logs for iPhone browser user agent strings (we’re well-read in the Bay Area, it appears) and found some. So I made a modified attempt:

curl -A “Mozilla/5.0 (iPhone; U; OS X Leopard 9A365; en) KHTML” http://reader.mac.com/mobile/v1/http%3A//www.hopelessgeek.com/rss.xml > foo.html There's more »

Cleaning Out The Queue, Volume 2

My new MacBook Pro needs to go in for warranty service. I made two full backups to external drives using SuperDuper. Unfortunately, system software for an Intel machine won’t boot on an older PowerPC PowerBook. Is there any way to make a universally bootable system? Not being able to take a drive and boot it on multiple machine architectures seems to me to be a huge oversight by Apple.

Yes. There's more »

I’d pretend that I have a more productive use for these ideas, but I don’t. I wanted to nab all of Order of the Stick and xkcd because I hate clicking through pages and then scrolling down for long images only to scroll back up for the next one. I figured that if I had them all, then I could just open up a batch, set Preview’s window once, and then thumb through them offline. To balance the karma from such a leech event I’ll just get some things from each comic’s shop (regexp/science) and the universe will still be happy and sunny and annoying and stuff.

I started with OoTS and went to the first comic. Looking at the URL for the comic image itself, I saw that it was a sequential number, one for each comic. Well, that’s remarkably easy as I then used curl to download them with a move like: curl -O http://that.com/ic/images/comic[000-999].jpg. That tells curl to grab a thousand images in sequence and requires no actual thought.

However, the last hundred or so didn’t come through like that, so I went to the page and pondered why. When I checked the URL of the image to see if it had moved, I realized that someone was on to people like me. It’s in the same place, but it’s been named with a random hash for a filename. Good job, you just made this a challenge. There's more »