by R.I. Pienaar | May 10, 2005 | Uncategorized
I’ve been trying to play with the new Certificate Assistant that comes with Tiger to set up a CA but had some trouble tracking it down in the System Preferences. So I figured I’d search for it using spotlight but could not find it.
Turns out it is on the drive in /System/Library/CoreServices/Certificate Assistant.app so why did it not show up in Spotlight? Annoyingly I found out that there is a hard coded list of directories that Spotlight will exclude, this include all of /private which contains among others /etc and a whole long list of other stuff that Unix people might actually enjoy being able to find.
If you’d like to override these defaults then read this discussion board entry for all the details.
Spotlight is becoming more a pain than it’s worth, I have considered just turning it off since it seems daily I discover a new way that it is somehow crippled in the name of sparing the poor clueless masses from seeing something they aren’t supposed to see etc.
by R.I. Pienaar | May 9, 2005 | Front Page
FreeBSD today released version 5.4. This looks like a pretty good release mostly for some changes to userland tools and some firewalling bits, some of the highlights for me are:
- CARP from OpenBSD has been added, this allows for some nice shared IP addresses between machines with failover carp(4)
- The ipfw(8) ipfw fwd rule now supports the full packet destination manipulation when the kernel option options IPFIREWALL_FORWARD_EXTENDED is specified in addition to options IPFIREWALL_FORWARD. This kernel option disables all restrictions to ensure proper behavior for locally generated packets and allows redirection of packets destined to locally configured IP addresses.
- The libarchive library (as well as the tar(1) command that uses it) now has support for reading ISO images (with optional RockRidge extensions) and ZIP archives (with deflate and none compression).
- The -f option of tail(1) utility now supports more than one file at a time.
-
rc.conf(5) now supports changes of network interface names at boot time.
There are a whole bunch of other interesting changes, be sure to read the Migration Guide before attempting to upgrade.
by R.I. Pienaar | May 8, 2005 | Uncategorized
I read quite a few photoblogs and I figured it might be a good idea to post a weekly list of what I really liked during that week.
So this then is this weeks:
Light Plug
Touchdown #1
The pier’s end #2
The pier’s end #3
Lonely Sunset
Coney Islan VI
I see I have 3 photos listed from Chromasia, if you only subscribe to one photoblog then this is the one you should choose.
by R.I. Pienaar | Apr 30, 2005 | Uncategorized
As pointed out in the excellent arstechnica review Apple chose not to expose a fraction of the usefulness of Spotlight to the GUI, I suspect within days there will be a Shareware Spotlight power users GUI out that bridge this gap, I can only wish.
For now, if you want to do some kick arse queries you need to use the command line and it really is very powerful. I scp’d a couple of my photos onto the apple hard drive and now I can do really nice queries over my photos like this one:
[rip@temptation]% mdfind 'kMDItemAcquisitionMake == "nikon*"c && \
kMDItemExposureTimeSeconds >= 1'
/Users/rip/Pictures/book/hms-belfast.jpg
/Users/rip/Pictures/book/london-eye.jpg
/Users/rip/Pictures/book/albert-bridge.jpg
The above bit will find all the photos on my drive shot by a Nikon camera with a exposure time of more than 1 second.
This is pretty kewl, and a wealth of meta data gets stored by default for images, this is a dump of one of the above photos:
[rip@temptation]% mdls /Users/rip/Pictures/book/albert-bridge.jpg
/Users/rip/Pictures/book/albert-bridge.jpg -------------
kMDItemAcquisitionMake = "NIKON CORPORATION"
kMDItemAcquisitionModel = "NIKON D70"
kMDItemAperture = 8.33985
kMDItemAttributeChangeDate = 2005-04-30 00:54:33 +0100
kMDItemBitsPerSample = 32
kMDItemColorSpace = "RGB"
kMDItemContentCreationDate = 2005-04-24 00:40:51 +0100
kMDItemContentModificationDate = 2005-04-24 00:40:51 +0100
kMDItemContentType = "public.jpeg"
kMDItemContentTypeTree = ("public.jpeg", "public.image", \
"public.data","public.item", "public.content")
kMDItemDisplayName = "albert-bridge.jpg"
kMDItemExposureTimeSeconds = 5
kMDItemFlashOnOff = 0
kMDItemFocalLength = 18
kMDItemFSContentChangeDate = 2005-04-24 00:40:51 +0100
kMDItemFSCreationDate = 2005-04-24 00:40:51 +0100
kMDItemFSCreatorCode = 0
kMDItemFSFinderFlags = 0
kMDItemFSInvisible = 0
kMDItemFSLabel = 0
kMDItemFSName = "albert-bridge.jpg"
kMDItemFSNodeCount = 0
kMDItemFSOwnerGroupID = 501
kMDItemFSOwnerUserID = 501
kMDItemFSSize = 1072065
kMDItemFSTypeCode = 0
kMDItemHasAlphaChannel = 0
kMDItemID = 455102
kMDItemISOSpeed = -2.321928
kMDItemKind = "JPEG Image"
kMDItemLastUsedDate = 2005-04-24 00:40:51 +0100
kMDItemOrientation = 0
kMDItemPixelHeight = 1555
kMDItemPixelWidth = 2481
kMDItemProfileName = "sRGB IEC61966-2.1"
kMDItemRedEyeOnOff = 0
kMDItemResolutionHeightDPI = 300
kMDItemResolutionWidthDPI = 300
kMDItemUsedDates = (2005-04-24 00:40:51 +0100)
All isn’t perfect though, notice the kMDItemISOSpeed? It’s blatantly wrong, so thats really a pain.
Here is a nifty little show off trick with mdfind, the GUI has the nice auto updating of results going which is obviously difficult to show in the command line world, but it has something at least.
To set this up do a query that will match files – one that you can easily add more matches to.
[rip@temptation]% mdfind -live apple
<snip>
Users/rip/Library/Preferences/com.apple.recentitems.plist
/Users/rip/Library/Preferences/com.apple.dashboard.plist
/Users/rip/Library/Preferences/com.apple.Syndication.plist
/Users/rip/Library/Preferences/com.apple.Safari.plist
[Type ctrl-C to exit]
Now here comes the magic, create some files that match in another term or through finder.
[rip@temptation]% mkdir apple
[rip@temptation]% rmdir apple
If you paid attention to the other window you will see it updated on the fly like this:
Query update: 378 matches
Query update: 377 matches
And to see just how deep the indexing goes, if you have Photoshop on your machine, create a new file and put some text on a image, something that will match your query. You will see Spotlight finds even this text on an image.
by R.I. Pienaar | Apr 30, 2005 | Uncategorized
A friend installed his new Tiger today and found that only the files that was on his drives at first boot is in the spotlight database, nothing new was being added.
At first glance everything looked fine, but this very simple test will confirm if spotlight is working or not:
[rip@temptation]% touch test
[rip@temptation]% mdls test
test -------------
kMDItemAttributeChangeDate = 140116-07-24 20:14:56 +0000
kMDItemFSContentChangeDate = 2005-04-30 00:10:37 +0100
kMDItemFSCreationDate = 2005-04-30 00:10:37 +0100
kMDItemFSCreatorCode = 0
kMDItemFSFinderFlags = 0
kMDItemFSInvisible = 0
kMDItemFSLabel = 0
kMDItemFSName = "test"
kMDItemFSNodeCount = 0
kMDItemFSOwnerGroupID = 501
kMDItemFSOwnerUserID = 501
kMDItemFSSize = 0
kMDItemFSTypeCode = 0
kMDItemID = 531254
kMDItemLastUsedDate = 2005-04-29 23:10:37 +0100
kMDItemUsedDates = (2005-04-29 23:10:37 +0100)
This creates a new file and then asks spotlight to list the metadata for this file, if spotlight isn’t indexing then nothing will be displayed after the second command. This was the case for this user.
Spotlight has a command line control tool called mdutil(1) that can start, stop and display current indexing state among other things, I turned indexing off and back on for the / volume on his machine and all was fine.
[rip@temptation]% sudo mdutil -i off /
Password:
/:
Indexing disabled for volume.
[rip@temptation]% sudo mdutil -i on /
/:
Indexing enabled for volume.
After that the simple test above should work. Note though that the new files may not immediately show up in search results since its likely that your machine may be now importing quite a few files into the datbase in a low priority background task, but things should be back to normal eventually.
In some cases though it seems not even this kicks the bugger back to life. So it is time to get a bit tough on it, so you can completely whipe the spotlight data store for a volume which will cause a immediate resync.
$ mdutil -E /
After this your spotlight will not work for a while, it will be like right after a fresh install, once it is done rebuilding and your spotlight icon lets you run searches it seems a reboot is in order, when you are back from the reboot it should all be good.
A quick test is to run a search for something in the spotlight GUI, click on ‘Show All’ and while this window is open make a folder or something that will match your query in a terminal, your spotlight results should dynamically update to include the new match.
UPDATE: You can also force a re-index by adding your whole harddrive to the Spotlight ‘private’ list and then removing it from the list after a while. Using this method you wont need a reboot or anything, plus it’s reachable by the GUI.