Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: One solution to a launchd-cron CPU usage issue System 10.4
Tiger only hintAfter 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:

  <key>QueueDirectories</key>
  <array>
    <string>/var/cron/tabs</string>
  </array>
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!
  Post a comment  •  Comments (8)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[11,830 views]  View Printable Version
10.4: An alternative postfix/smtpd solution on port 25 System 10.4
Tiger only hintThis 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.

Motivation

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).
read more (1,043 words)   Post a comment  •  Comments (20)  
  • Currently 2.00 / 5
  You rated: 5 / 5 (4 votes cast)
 
[39,796 views]  View Printable Version
10.4: Use Automator to start screen saver on remote Mac System 10.4
Tiger only hintWhen 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.
  Post a comment  •  Comments (5)  
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[16,031 views]  View Printable Version
10.4: Modify the slideshow navigation panel's settings System 10.4
Tiger only hintThis 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:

<key>PanelTiming</key>
  <dict>
    <key>longDelay</key>
    <real>5.0</real>
    <key>shortDelay</key>
    <real>3.0</real>
    <key>fadingTime</key>
    <real>0.8</real>
  </dict>
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.
  Post a comment  •  Comments (9)  
  • Currently 3.40 / 5
  You rated: 3 / 5 (5 votes cast)
 
[15,426 views]  View Printable Version
10.4: Secure delete items directly from the Finder System 10.4
Tiger only hintI 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:
  1. 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.

  2. 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.

  3. 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:
    #!/bin/sh
    for i in "$@"
    do
      srm -rmf "$i"
    done
    
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.]
  Post a comment  •  Comments (18)  
  • Currently 3.17 / 5
  You rated: 5 / 5 (6 votes cast)
 
[18,963 views]  View Printable Version
10.4: Two ways to bypass Spotlight 'find-as-you-type' System 10.4
Tiger only hintSpotlight 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:
  1. Use Laserlight

    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.

  2. Use Quicksilver as a Spotlight front-end.

    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:

    1. Open up Quicksilver's Preferences
    2. 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.
    3. 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).
    4. 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.]
  Post a comment  •  Comments (9)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[20,189 views]  View Printable Version
10.4: Change the 'Starting Mac OS X...' text System 10.4
Tiger only hintWith 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...]
  Post a comment  •  Comments (8)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[16,097 views]  View Printable Version
10.4: Random password widgets may not be random System 10.4
Tiger only hintThe 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!

Upon inspection of the code, the application uses JavaScript's Math.random() method, which doesn't take a seed. What this means is that any time the app is re-installed, or the Dock is restarted, the cycle of pseudo-random choices is restarted. Since you restart the Dock each time you reboot your computer your password is likely one of...
  • aiUCHncQQ5xG
  • ZcdGPaxezQK5
  • 0GfOzR4VqcTu
  • NU9wp8SUOeN2
  • qBVDorwkE34d
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. Any widget that uses Math.random() is not the best choice for security. This is clearly a weakness of JavaScript's pseudo-random number generator and its lack of a seed. Hence, until someone comes out with a widget that uses a Cocoa bundle, as opposed to JavaScript, to generate the random numbers, I think we all should refrain from using them. After all, what is the point in having a "random" password if it is the same as everyone elses' "random" password?

[robg adds: There definitely seems to be an issue with JavaScript and random password generation, as I found another widget (called Password Generator) that's no longer available due to the same non-random-password issue. Both Apple's Dashboard site and DashboardWidgets.com list a number of such password generating widgets; if you're going to use one, you might want to test the randomness of the results before relying on the tool.]
  Post a comment  •  Comments (36)  
  • Currently 2.25 / 5
  You rated: 2 / 5 (8 votes cast)
 
[28,053 views]  View Printable Version
10.4: Hide users from the login window via prefs System 10.4
Tiger only hintA 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:
sudo defaults write /Library/Preferences/com.apple.loginwindow \
HiddenUsersList -array-add account1 account2 account3
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:
sudo defaults write /Library/Preferences/com.apple.loginwindow \
HiddenUsersList -array-add account1
As of 10.4.2, the default Tiger install doesn't have any user names automatically hidden. To unhide all the names you may have previously hidden, you could execute the following from the command line.
sudo defaults delete /Library/Preferences/com.apple.loginwindow \
HiddenUsersList 
As always, make a backup of any preference file you might change so you can move back to it.
  Post a comment  •  Comments (27)  
  • Currently 2.86 / 5
  You rated: 4 / 5 (7 votes cast)
 
[68,197 views]  View Printable Version
10.4: Search Firefox bookmarks with Spotlight System 10.4
Tiger only hintFirefox 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...]
  Post a comment  •  Comments (20)  
  • Currently 3.00 / 5
  You rated: 4 / 5 (4 votes cast)
 
[24,492 views]  View Printable Version