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

Change your 'root' prompt for safety System
Thanks to Keith O. for this one...

If you occasionally use the terminal as root, you should consider using a different prompt when 'rooted' - this will help you remember that you are working as root, and hopefully prevent you from doing something that you didn't intend to do.

The first step is to create a file named .tcshrc in /var/root (this file could also probably be created as /var/root/Library/init/tcsh/rc.mine, but I haven't tried that). You'll be placing your prompt in this file, so that it gets loaded each time you start a root session. Here's what Keith O. placed in his root .tcshrc file:
set prompt="%{\033[32m%}%n @ %/ on $host %#%{\033[30m%}  "
This changes the content and color of the prompt, so that it differs from that of his normal user. If that looks completely foreign to you, that's perfectly normal! Read this hint for a general overview of prompt variables, including an explanation of the color codes, which should help clear things up (a little!).

You can experiment all you like in a terminal session - whatever you set as prompt will only last until you change it again or close the session. It only becomes permanent when you place it in root's .tcshrc file. Also read the referenced hint for setting your normal user's prompt. You can do some pretty neat stuff once you figure out the structure. For instance, this is my normal prompt string:
set prompt="%{\033[0;1;32m%}[%{\033[36m%}%t %n%{\033[32m%}%{\033[33m%}[space]
%c3%{\033[32m%}]%{\033[0m%}%# "
Note: Replace [space] with the actual space character, and enter on one line; broken for easier display. That prompt string leads to this prompt display:



The colors help the prompt stand out from the text that flows as the result of whatever command I'm running. Customizing your prompt string (for both your normal user and root) is a good way to make your time in the terminal more productive.
  Post a comment  •  Comments (9)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[5,931 views] Email Article To a Friend View Printable Version
Repairing OS X disks in a GUI System
If you have filesystem errors, Mac OS X doesn't allow you to repair the startup disk, so you need to boot from a CD to run a repair utility. Of course if you formatted your drive in UFS, tools like Disk First Aid and Norton Utilities won't be able to do anything for you. However, Apple has provided a solution.

If you boot from the OS X install CD, you can go to the Installer menu, and choose "Open Disk Utility...". This will allow you to test and repair both UFS and HFS+ disks, without having to venture into the scary land of terminals and Single User Mode.
  Post a comment  •  Comments (3)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,834 views] Email Article To a Friend View Printable Version
Change the version number System
This is completely useless tip, but OS X stores the version number in /System/Library/CoreServices/SystemVersion.plist
If you edit this file, you will be able to make it say Mac OS 3 (build 3p14) in the about this mac.

Pi

[Editor's note: This shouldn't bother anything like future upgrades, since they look elsewhere to see if they're needed ... however, use at your own risk. During the Public Beta, people had great fun changing the version number and publishing screenshots to confuse forum readers!]
  Post a comment  •  Comments (0)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,743 views] Email Article To a Friend View Printable Version
Adaptec beta drivers and disk space System
I noticed on MacFixIt today that someone commented on the system.log file getting filled with data from the Adaptec SCSI drivers. So I took a look at system.log in the /var/log directory, and was surprised at what I saw:
May 15 10:01:41 mach_kernel: ADPT_OSI_IndicateQueueFrozen: id 4, freeze
May 15 10:01:41 mach_kernel: ADPT_OSI_IndicateGenerationChange (nop)
May 15 10:01:41 mach_kernel: ADPT_OSI_IndicateQueueFrozen: id 4, unfreeze
May 15 10:01:42 mach_kernel: ADPT_OSI_IndicateQueueFrozen: id 4, freeze
May 15 10:01:42 mach_kernel: ADPT_OSI_IndicateGenerationChange (nop)
May 15 10:01:42 mach_kernel: ADPT_OSI_IndicateQueueFrozen: id 4, unfreeze
As you can see, all those messages were written in the span of two seconds. My system.log file was over 5.5mb in size, and the system had backed up about six previous logs, all over 2mb in size. You can see these in the list as system.log.0.gz, system.log.1.gz, etc.

I deleted the backup log files, and will remove the drivers later tonight (see the Adaptec ReadMe for instructions on how to do so).

So if you've noticed some vanishing drive space, and have the Adaptec drivers installed, check your log files!
  Post a comment  •  Comments (3)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[2,547 views] Email Article To a Friend View Printable Version
View all volumes in the dock System
I'm pretty sure almost everyone has tried the trick of putting an alias of your hard drive(s) in the dock. However, this thread on the MacFixIt boards has a great tip from 'johnq' for putting one icon with all your drives (including removables) into just one dock icon. The process basically involves creating a symbolic link (from the terminal) to your /Volumes folder, and then making an alias of that symbolic link so that you can use a customized icon in the dock.

Head on over to MacFixIt and read all about it! Quite cool...
  Post a comment  •  Comments (3)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[5,963 views] Email Article To a Friend View Printable Version
Option-delete in Cocoa to erase previous word System
Dunno if this has been mentioned already but I just noticed that in Cocoa apps, hitting option+delete erases the word located to the left of the cursor.
  Post a comment  •  Comments (2)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[2,395 views] Email Article To a Friend View Printable Version
Saxon & Java Jars installation details System
Can anyone explain, please, how to install a java.jar on Mac OS X? I'd like to run the Saxon XML processor.
  Post a comment  •  Comments (4)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[7,006 views] Email Article To a Friend View Printable Version
Trashing prefs is still good advice System
OK, i know its been said in various ways on this site, but i'll say it again, as i found out today how similar OS9+ and OS X are. If something changes in your OS X enviroment, some configuration, the look of your desktop, your mailbox has suddenly added more boxes, folders are in the wrong place, or like me, all of your invisible files become visible, SCRAP THE PREFERENCES relative to the change.

if you're unsure if it's the preferences, then login as someone else and see if it stays the same, if it doesn't, its more than likely to be a prefence change, so dump it in the trash. you wont have to delete it, it wont work from the trash. after you RESTART, if the problem still hasn't changed, you can move it back (say yest to "replace new with old") no harm done. OS X isn't that different after all.

[Editor's note: I published a similar tip back in December, but it bears repeating. It's good advice, and you can find your user's preference files in your home directory, then in Library/Preferences]
  Post a comment  •  Comments (0)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[2,529 views] Email Article To a Friend View Printable Version
A hack to script system preferences System
Is there a way to script the system preferences? Specifically, I want to be able to have the monitor resolution change at login to suit each user's preference.
  Post a comment  •  Comments (2)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[6,228 views] Email Article To a Friend View Printable Version
Remote activation of auto-login System
If you want to enable automatic login on Mac OS X remotely you can to this by using ssh and the niutil command. This requires that you have enabled "Allow remote login" in the System Preferences, of course.

1) Open an ssh session to your Mac.

2) type su to become root.

3) To enable the automatic login, the property "username" must be found by loginwindow in the local netinfo database. Here is how you do it:
niutil -createprop -t localhost/local /localconfig/autologin[space]
username user_to_log_in
(NOTE: shown on two lines; replace [space] with an actual space character and enter on one line)

Replace "user_to_log_in" with the username of the user who will be automatically logged in on restart.

4) Type "reboot" to restart you mac and see if it worked.
  Post a comment  •  Comments (1)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[4,348 views] Email Article To a Friend View Printable Version