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

A script to reset file permissions System
I screwed my OS by doing an APPLY on the top level disk information (command I) as root. Warning - this is extremely dangerous :) and easy if you are root. The apply does a RECURSE, not just apply the change you made, and doesn't warn.

Anyway, there is a Perl script by Larry Prall that reads the BOM, examines the file system and writes a shell script that will correct ownership, protection, and privilege problems.

I haven't run it yet, because an alternate is to just do an Install with the OS X disk (not the Restore CD set, just a regular disk). It will do an upgrade and just correct stuff. It even worked with 10.1.1 against a 10.1.2

This might save your life. Its in PERL, I checked it, but someone might want to do a test run on a scratch installation (I didn't want to risk running it after I managed to get my machine running again!).

[Editor's note: Just for the record, Apple does not recommend running an older-version system CD against a newer installed version; their current advice is that you must reformat and reinstall, which is not really a good choice for many people!]
  Post a comment  •  Comments (3)  
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[4,659 views] Email Article To a Friend View Printable Version
Creating custom services with TextWielder System
Text Wielder is a "super services" application that includes about 120 different predefined actions. As a brief example, Text Wielder services can search for song lyrics, clean up email formatting, or get a map of a particular city or zip code. And since Text Wielder runs as a service, it's available to all Cocoa apps and a few Carbon apps (hopefully more in the future!).

One of the coolest things, though, is that you can use Text Wielder to write your own services. As an example, read the rest of the article for a step-by-step guide on creating a "Search macosxhints.com" service item for Text Wielder. This guide was contributed by Eric Blenkush, the author of Text Wielder.

If you would rather not create the "search macosxhints.com" service yourself, you can simply download it. Otherwise, read the rest of the article for Eric's great step by step guide...
read more (368 words)   Post a comment  •  Comments (4)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,922 views] Email Article To a Friend View Printable Version
Avoiding ._ filenames when copying files System
It is my understanding that when copying files from X to a drive formatted that doesn't have resource forks, a "._filename" file is created that holds the information. While this is apparently very important if you plan to move the file back, sometimes having that file can be in a pain.

On my Kodak MC3 digital camera/MP3 player, when copying files to it's music folder on the compactflash card via the finder, it creates "._filename" files that cause the camera to freeze for long periods of time when it encounters them. I found there was no way to delete them in X. However, after fooling around a bit in the Terminal, I found that using the 'mv' and 'cp' commands will move or copy files to the compactflash card without the ._ files.

And of course, if you don't like the terminal, an applescript studio app could be made relatively simple to copy these files with the cp or mv function, which is what I did to solve my own issue.

[Editor's note: For the newcomers to OS X, it's very important to note that if you wish to retain your resource fork information, you should NOT use this method of copying files from the Terminal! But it can be useful when transferring files to systems that don't understand resource forks.]
  Post a comment  •  Comments (13)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[19,821 views] Email Article To a Friend View Printable Version
Auto sleep based on CPU usage System
In this Intelligent sleep/energy saver? thread on the forum site, Novajo offers up a script that can be used to put your Mac to sleep based on CPU load. The script is quite short:
set theLoad to do shell script "uptime | sed 's/.* //g'"

if (theLoad as number < 0.8)
tell application "Finder"
sleep
end tell
end if
Save the script, make it executable, and then use 'cron' to schedule it to run at regular intervals, and your Mac will put itself to sleep when the CPU load has been below your threshhold.

The forum thread has more info on the cron task if you'd like to see how that step is done...

[Editor's note: Script changed to reflect comments posted below - thanks all!]
  Post a comment  •  Comments (7)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[6,146 views] Email Article To a Friend View Printable Version
LaCie FireWire drive usage tips System
After experiencing a hard drive crash of my LaCie external 80 gig Firewire drive today, I can advise on how to avoid this based on what I learned from LaCie tech support:
  1. Don't use the drive out of the box in Mac OS X. It will work and appear to be fine, BUT it is formatted with Silverlining "which is incompatible with OS X".

  2. To prepare the drive first boot from the LaCie CD supplied with the drive and run Silverlining Pro.

  3. Check that the ATA-Firewire bridge firmware is the latest version (currently 3.12; mine was 3.11, which puzzled the tech support as drives should be shipped with the version provided on the CD. Update firmware if needed.

  4. Boot back into X and partition/reformat the drive using the Apple hard drive software supplied with X.
The good news is that Disk Warrior was able to rebuild the volume information on the drive with no loss of infomation and I was able to remount and backup files.

The bad news is that none of this would have occurred if LaCie had included some warnings and instructions with the drive.
  Post a comment  •  Comments (13)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[8,820 views] Email Article To a Friend View Printable Version
Display UNIX messages during startup System
If you are the old school type of linux/unix user that enjoys seeing all the bootup messages rather than the graphical bootup screen then this hint is for you.

From the terminal type:
  sudo nvram -p
This command prints out your current arguments for the settings. If you want to see the old school style bootup type this:
  sudo nvram boot-args="-v"
Reboot to see the effects. To change back to the regular bootup screen type the following:
  sudo nvram boot-args=""
(notice that the quotes have nothing in them.)

[Editor's note: Other than testing the "-p" option, I have not tried this tip myself, so I can't verify whether it works or not ... but it makes sense based on the output of the "-p" switch.]
  Post a comment  •  Comments (12)  
  • Currently 3.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[10,726 views] Email Article To a Friend View Printable Version
Close widget reflects document save status System
The next time you are in Word or TextEdit or even the terminal, look at the close button (red). If there is a small dot in the center it means that the document contains unsaved changes. This happens in the Terminal after you use the inspector to change something, but don't change the main preferences.

[Editor's note: I can't believe this hasn't been published here before, as it's one of the more basic element of OS X. The close widget will display a black dot in any Cocoa appliation document which has unsaved changes ... as noted below, Carbon application support is on an application by application basis.]
  Post a comment  •  Comments (8)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[2,077 views] Email Article To a Friend View Printable Version
A service to execute terminal commands System
I've written a service component called ShellService which allows folks to execute UNIX shell commands from a text window in an application like TextEdit or ProjectBuilder.

The component adds an "Execute Text" menu item. When you select some text and choose it, the text is sent to your MacOS X shell to be executed. The shell's output is then put into the text window.

Feedback welcome via the email links on the ShellService page.
-Christopher Corbell
  Post a comment  •  Comments (6)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[2,064 views] Email Article To a Friend View Printable Version
Rebooting without rebooting System
I was experiencing a number of problems one morning. Mostly applications not responding. This included the Finder and Terminal. Oddly enough, Classic still worked fine. I became fearful that my whole system was on its way down, so I thought I would try something.

I learned that the shutdown ('sudo shutdown now') command in Mac OS X does not actually bring the system down as it does in certain Linux systems I have used. Rather, it brings the system down to "single user mode." As I understand this, most everything is stopped and the system is in essence stripped down to its bare bones. To verify this, I ran top while in this state, and counted only about four (4) processes running.

Now, I just typed "exit" and the machine exitted from single user mode and the Window Server started back up. If you try this for whatever reason, you may notice that the network and other items are started back up. It seemed to fix my troubles and my system was never taken totally down. This was evident from running uptime from the terminal to see the total running time of the system has been preserved. This is also a much faster fix than a full restart.

I am not a guru in the area of the guts of this system yet, so I can't be sure of what damage I am creating or not really fixing, but so far this seems to be a more favorable fix than a full restart.

[Editor's note: Anyone have any input on the safety of this versus a full reboot into single-user mode? I believe I read somewhere that if you use "shutdown" to get into single-user mode, you should still finish with a reboot and not just an exit back to Aqua, but I can't find the reference now.]
  Post a comment  •  Comments (20)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,507 views] Email Article To a Friend View Printable Version
Install an inexpensive USB card for OS X System
If you need additional USB ports or have a beige G3 or run OS X on an unsupported system using XPostFActo, you can use CompUSA's $15 no-name two-port USB card. On my PowerMac 7600 it worked right out of the box. I was able to print from it to my Epson inkjet printer.

A Web search revealed the card, an MP-861-2, to be made by Megapower International Corp. in Taiwan. Their online information makes no mention of OS X, by the way.
  Post a comment  •  Comments (8)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,533 views] Email Article To a Friend View Printable Version