Mac Tips

This page is a collection of various Mac OS X tips that will come in handy at some point or other.

Flushing the DNS Cache

Sometimes, you may find that the IP address for a certain DNS domain name has changed, but your Mac still seems to be trying to access the old IP address. This can happen because Mac OS X keeps an internal cache of various directory service queries. DNS lookup is one such type of query that gets cached. Here’s how to flush this directory service cache:

dscacheutil -flushcache

Changing Printer Passwords

This is particularly for changing of SMB (Windows) printer passwords that have been configured into your Mac OS X. If you ever have to change your Windows passwords, the passwords you have saved into your printer configuration will be outdated. Short of deleting and recreating your printer passwords, here’s how to update it.

  1. Edit /etc/cups/printers.conf (in a Terminal window, type: sudo vi /etc/cups/printers.conf).
  2. Change every occurrence of your old password to your new password. Here’s a handy vi command to use: :g/oldpassword/s//newpassword/g
  3. Save the file. The vi command to do this is: :wq
  4. Restart the printing service: sudo killall -1 -c cupsd

I would not be surprised if there was a more elegant GUI way to get this done. But I don’t know, and I am a command-line UNIX kind of person, so this works for me.

Clear Recent Searches in Safari

Run this in the terminal: defaults delete com.apple.safari RecentSearchStrings

Debugging Tips

The equivalent of strace or truss in Mac OS X is dtruss.

You can leave a response, or trackback from your own site.

One Comment

  • AR says:

    Thanks a lot for the printer password tip! The 6-month policy on campus has me struggling twice a year with the printer re-configurations. This is so much easier! :)

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word