OS X Misc

From brainsik
Jump to navigation Jump to search

Removing an application's "downloaded from the internet" warning

Applications downloaded with Safari will have a "quarantine" attribute set. This causes the following message to be seen when the application is opened:

"SomeApp" is an application which was downloaded from the internet. Are you sure you want to open it? Safari downloaded this file today at [...]

After the user agrees it's safe to run, the extended attribute is removed. Unfortunately, if the application was downloaded by an administrator but never run, then the message will be shown to standard users every time they run the app because they do not have sufficient privileges to remove the "quarantine" attribute.

To manually remove the "quarantine" attribute:

$ sudo xattr -d com.apple.quarantine SomeApp.app

Viewing extended attributes

In ls -l, files with extended attributes have an @ at the end of the permission settings.

To list extended attributes via ls:

$ ls -al@ SomeApp.app

To print the contents of the extended attributes:

$ xattr -l SomeApp.app

Add /usr/local to MacPython's search path

I'm using the python.org Python package. By default, it does not check /usr/local for modules.

Create the following file:

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/local.pth

/usr/local/lib/python2.5/site-packages

Flush DNS Cache

On Leopard:

dscacheutil -flushcache

On Tiger:

lookupd -flushcache