After upgrading to 10.4, I found that launchd was eating up much CPU time (around 15%).
Investigating this strange behavior, I noticed that cron was started several times per second! The file com.vix.cron.plist (in /System -> Library -> LaunchDaemons) responsible for cron contains this entry:
This causes cron to watch the /var/cron/tabs directory for new crontabs, which is a good thing. But in my case, this directory also contained a .DS_Store file. The Finder uses this file to store various information such as window location, icon position, etc. For some reason, launchd choked on this file, even though it was never updated. After removing the file with sudo rm -f /var/cron/tabs/.DS_Store, I found that launchd behaved as expected, and CPU usage was back to normal.
As always, please be extremely careful when using rm -f as root (sudo), as you can do much damage to important files and directories with just one typo!
This hint provides an alternative mechanism to create an SMTP daemon that listens and accepts connections on port 25 (the standard SMTP port) that is (more) appropriate for desktop/laptop users, without disturbing much of the out-of-the-box 10.4 setup and behavior.
I suffer from mild obsessive-compulsive disorder when it comes to system administration, especially on my own machines. While I appreciate the simplicity of tools like Postfix Enabler, I naturally distrust their ability to do The Right Thing™, especially since tools like these typically hide the details of what they change "under the covers."
There are already a few hints (e.g., here and here) which explicitly advise how to set up postfix in such a way that it will provide a SMTP daemon that listens and accepts connections on port 25. Many of these use launchd, but (IMHO) do so in a way that doesn't quite seem to be in complete harmony with either postfix or launchd (at least how they were intended to be used on a desktop machine).
I wanted to create a solution that modified the 10.4 "stock" postfix behavior and configuration as little as possible, without suffering from some of the problems identified in other hints (e.g., aggravating the ability of a notebook to honor its sleep settings). I thought having the postfix master process exit after 60 seconds was a good idea and wanted to preserve that behavior. I also wanted to use launchd (as I believe it was intended) to be able to launch services on an as-needed basis (rather than force them to run all the time).
When I use Apple Remote Desktop (ARD) to reach another Mac, I like to leave the computer with an active screen saver after I access it.
Using Automator, I chose Automator from the Library column, and dragged Pause from the Action column into the work area. I set the pause time to five seconds, to give myself a bit of time to quit ARD. Next, I chose Finder from the Library column, and dragged the Launch Application action to the work area. Using the to pop-up menu in the Launch Application action, I chose Other (all the way at the bottom), and then navigated to /System -> Library -> Frameworks -> ScreenSaver.framework -> Versions -> A -> Resources. Once there, I chose ScreenSaverEngine.app as the application to launch.
I then saved the workflow as an application (File: Save As, and set the File Format pop-up to Application), and put it into Dock on the remote computer. Now when I'm finished working, I can click the icon in the Dock and quit the window in ARD, and I leave the machine with an active screensaver.
This hint along with this comment are evidence that I'm not the only one who wishes the slideshow navigation panel wasn't always there.
You can adjust the amount of time that the panel is displayed before it dissolves by changing the values in /System -> Library -> PrivateFrameworks -> Slideshow.framework -> Versions -> A -> Resources -> SlideshowConfig.data. You'll need your administrator's password to edit the file. The section you're interested in is down the bottom:
The longDelay is the delay before the panel starts to fade once it has been used in some way (i.e. if you've moved the mouse over the panel or clicked a button or press a key). The shortDelay is the amount of time it takes to fade if you move the mouse off of the panel.
Alternatively, if you don't want to see the panel at all, set the fadingTime to 0, and then back up and delete the images whose names begin with "Slideshow..." from that same directory. Once again, you'll need an admin password. Be careful; you probably want to leave the wheel graphics and MissingSlideIcon.tif in there.
There are also a bunch of other values in the SlideshowConfig.data file that can be edited to change the timing for transitions, amongst other things.
I was getting annoyed with having to either move stuff to Trash and secure delete it there, or to open a Terminal and use srm.
To ease my frustrations, I hacked up my first Automator workflow. Launch Automator, and then add these actions:
In the Library column, choose the Automator item, then drag the Ask for confirmation: Action to the work area on the right. Set the Message to Securely delete selected file(s)? and the Explanation to This operation cannot be undone.
Now select the Finder entry in the Library column, and drag the Get Selected Finder Items Action to the work area, below the previous command.
Finally, choose the Automator Library item again, and drag the Run Shell Script action to the bottom of the work area. Make sure that the Shell variable is set to /bin/sh, and change the Pass Input pop-up to as arguments. For the script itself, use the following:
for i in "$@"
srm -rmf "$i"
Save this as a Finder plug-in (File: Save as Plug-in; I called mine "Secure Delete"), and now you can select any number of files/folders in Finder, control-click on the selection, and then select Automator -> Secure Delete from the contextual menu. Files deleted this way are obviously not recoverable, which is why I added the confirmation step ... you can omit that action if you're brave enough.
I'd love to make this even more useful by creating a keyboard shortcut for it, but although I can create the shortcut in the Mouse & Keyboard control panel, and it shows up on the Finder contextual menu, it doesn't work. Anyone managed to do this yet?
[robg adds: Be aware that secure deleting takes a bit of time, so if you think the plug-in isn't doing anything, make sure you check teh Autmator status indicator in the menu bar; it will let you know that it's still working on deleting your selection. In testing, it took roughly 35 seconds to delete an 860KB test file on my 2.0GHz Dual G5.]
Spotlight has one "feature" that many people find quite annoying: as you start typing, Spotlight immediately starts matching results. If you have a large hard drive, and there are lots of matches, this can get quite annoying at times.
If you would prefer to complete your query before Spotlight starts going through your stuff (and perhaps choking on the way, as can sometimes happen), either of these third-party applications can help:
This is an AppleScript-based application that presents a display dialog into which you type your query before sending it to Spotlight as completed text. One nice touch: the author has also included an option to search as name or keyword only. Also, the program is GPL'd, so poke around inside it and tweak it as you need. The script inside has some very clever bits that might prove useful for other customizations of Spotlight functionality.
A Quicksilver text string (or any object, for that matter) can be "piped" to Spotlight, if the Spotlight plug-in is enabled. I don't believe it is by default. If yours isn't, try this:
Open up Quicksilver's Preferences
On the Plug-ins panel, check to see that the Spotlight module is available and enabled. If not, try the next step. Otherwise skip ahead.
On the Applications panel, check "Enable advanced features" (you may need to change the level of this item to "Beta," and a restart of Quicksilver may be required as well).
Still in Preferences, the Actions panel will now have two Spotlight actions listed in "All actions:" Search in Spotlight Window and Run Search with Spotlight. You may want to drag these up a few notches in the list, so they appear with a higher priority when using Quicksilver.
Here are a couple of tips for doing this with Quicksilver:
Pressing period [.] right after invoking Quicksilver switches it to text input, rather than the default behaviour (searching though your catalogues for a match).
It appears (from my experience, anyway) that of the two actions, only "Search in Spotlight Window" can be used with text strings.
[robg adds: I tested Laserlight, and it works as described. If attached to a keyboard shortcut via any of the various apps available to do so, this could be quite handy if you hate the "find as you type" behavior of Spotlight.]
With the release of Tiger, the window that reads "Starting Mac OS X..." (which appears just before the login window) has been changed to a "fake" window (see this hint). This window no longer shows what is actually happening, it just has generic text that is now possible to change, if you are willing to enable the root account (this can be done by opening NetInfo Manager, which is located in Utilities, and visiting the Security menu).
Once you've enabled the root account, browse to /System -> Library -> CoreServices -> Resources. There will be a number of different folders for different languages. Choose the one that your system uses when it boots up (probably English.lproj). If you have the Xcode Developer Tools installed, just open the file called SystemStarterUI.strings. Otherwise, it should be possible to edit it in TextEdit.
On the second line, it should say:
"SYSTEM_STARTING_MESSAGE" = "Starting Mac OS X...";
Where it says "Starting Mac OS X...," put in your own message (leave the quotation marks around your message). I wouldn't reccomend putting in anything strange like nothing at all, paragraphs of text, weird symbols, etc. (although I honestly haven't experimented with all the possible things you could put in there), but you can try.
After you've done your edits, save the file, log out of root, disable root if you want, and then restart your Mac. When it boots, the text that goes along with the progress bar should say your personalised message instead of "Starting Mac OS X..."
[robg adds: You do not need to enable nor login as root to edit this file. Instead, simply drag it to your desktop -- OS X will create a copy, since you don't have the rights to move the file. Open the copy on your desktop, make the edits, and save the file. When you're done, quit the editor, and drag the file back to its original location. OS X will ask you to authenticate (provide your admin password), and then ask if you want to overwrite the file. Say yes, and you're done. You should probably keep an unedited copy around, too, just in case...]
The widget KeychainHelper is supposed to be a random password generator. If you install it and set it up the exact same way, however, you will notice that the passwords are not random!
That is, assuming you use the same settings as I do -- twelve characters in length, all numbers and letters in both upper and lower case.
A hidden user is a user that can login to the system, but the account will not be displayed in the Login Window, where all of the other accounts on the machine are listed. In lab or work environments, it's often desired to have a hidden user that has Admin rights for administrative functions and/or other special circumstances.
In OS X 10.3 and prior all that you needed to do to hide a user from the login window was to create the account with a UID (user id) below 500 (all accounts normally created via the OS X GUI have UIDs greater than 500).
With the introduction of Tiger, things have changed. Tiger will now show (most) users, even if the UID is below 500, unless the account is UID 0 (root). The other variable that seems to stop the user (with a UID below 500) from being seen in the login window is if their default shell is set to /dev/null (other things might also cause the user to be hidden, but I don't know for sure). When we're talking about admin or special kinds of accounts, you most likely don't want to set the default shell to /dev/null ... so what to do...
Finally! Here's the hint. Tiger's login window preferences now supports a new setting called HiddenUsersList, which is an array of one or more user names. If you wanted to hide three users from the login window, the command to execute via the terminal would be:
where account1, account2, and account3 are the short user names for the accounts you need to hide. This would add additional names to any that might already exist. To hide just one account, you'd simply type:
Firefox users have been annoyed by the lack of a method for importing Firefox bookmarks into Safari's Spotlight-searchable index. So I wrote a shell script that will do the import; you can schedule it to run as often as you like. Just follow these instructions, and you'll be able to search your Firefox bookmarks via Spotlight.
[robg adds: I tested the script, and it works as described...]