Browsing TagMac OS X

Enabling AirDrop on older systems

You can enable AirDrop for many older Lion systems at the Terminal command line. Enter:

defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1

After setting the defaults, you’ll need to restart Finder:

killall Finder

Ejecting a stuck CD or DVD on a Mac

If you have a stuck CD or DVD on your Mac, and the desktop icon for the media has disappeared from the desktop so that you can no longer drag it to the trash, you can manually eject the media without rebooting the machine by executing the following command from the Terminal:

drutil tray eject

dyld: shared cached was built against a different libSystem.dylib, ignoring cache

I just upgraded my MacBook Pro’s hard drive to one with a bigger capacity. After restoring the contents from the old drive to the new one using an image created by SuperDuper!, I keep on getting this error every time I launch the Terminal application:

dyld: shared cached was built against a different libSystem.dylib, ignoring cache

After googling around, I found this discussion thread from Apple’s Support Forum on how to fix the error:
sudo update_dyld_shared_cache -force

How to determine DST time changes

Here’s how to determine the dates when the Daylight Savings Time changes for a given year (I keep forgetting how to do this.):

zdump -v /etc/localtime|grep 2008 /etc/localtime Sun Mar 9 06:59:59 2008 UTC = Sun Mar 9 01:59:59 2008 EST isdst=0 gmtoff=-18000 /etc/localtime Sun Mar 9 07:00:00 2008 UTC = Sun Mar 9 03:00:00 2008 EDT isdst=1 gmtoff=-14400 /etc/localtime Sun Nov 2 05:59:59 2008 UTC = Sun Nov 2 01:59:59 2008 EDT isdst=1 gmtoff=-14400 /etc/localtime Sun Nov 2 06:00:00 2008 UTC = Sun Nov 2 01:00:00 2008 EST isdst=0 gmtoff=-18000

 

Obviously, change 2008 to whatever year you want.

Find Out the Top 10 CPU Hogs

I found this command useful in finding out which top 10 processes are hogging my CPU resources. Note that this command is specific to the Red Hat flavor of Linux. See the man page for ps for the correct output format to use for your specific platform:

ps -eo pcpu,pid,user,args | sort -k1 -r | head -11

Substitue pcpu above with pmem to see the memory hogs instead.