Disabling Adobe Acrobat PDF viewer in Safari 4

Posted by Jason Yanowitz Mon, 14 Jan 2008 13:58:00 GMT

[UPDATE There’s an easier way to do this. Launch Acrobat. Go into Preferences -> Internet and uncheck “Display PDF in browser using: ...” That should do it (at least in CS3). OTOH, moving it around on the command line is very satisfying…]

If you’ve installed Adobe CS2 or CS3 on your Mac, you’ve probably experienced it’s aggressive approach to Safari.

It installs its own Acrobat plug-in viewer that gets invoked by Safari (and other apps) when you view a PDF.

I find that really annoying – it takes forever for the initial page to load, i’s much slower than the built-in PDF viewing, and takes up a huge chunk of memory). Damn you Adobe!

So, if you want to disable it, here’s what to do (assuming you have admin privileges).

1. Launch Terminal (Applications -> Utilities -> Terminal)

2. Type:

# sudo mkdir "/Library/Internet Plug-Ins.disabled" 
# sudo mv "/Library/Internet Plug-Ins/AdobePDFViewer.plugin" "/Library/Internet Plug-Ins.disabled" 

Now if you restart Safari and go look at a PDF, life will again be fast. If you decide you are becoming too productive, you can always revert the change:

# sudo mv "/Library/Internet Plug-Ins.disabled/AdobePDFViewer.plugin" "/Library/Internet Plug-Ins" 

Enjoy!

Getting ssh (and by extension, rsync) to work in cron with Leopard (OS X 10.5)

Posted by Jason Yanowitz Thu, 03 Jan 2008 15:03:00 GMT

I didn’t find this elsewhere, so I’ll give you my kludgey solution to a problem created by Leopard.

Leopard now helpfully launches an ssh-agent for you and will keep your passphrases in the keychain.

That’s all well and good, but the SSH_AUTH_SOCK changes with every boot (as near as I can tell).

AFAICT, there’s no easy way to get the SSH_AUTH_SOCK value which means you can’t easily set it in crontab which means cronjobs that you want to have use passphrase-protected ssh keys won’t work.

Here’s my solution.

At the top of your crontab, put:
SSH_SETUP='export SSH_AUTH_SOCK=`find /tmp -follow -user $LOGNAME -regex ".*/launch-.*/Listeners"`'

then, where you might’ve had a crontab line like:

1,16,31,46 * * * *  /Users/yanowitz/bin/backup_igtd.rb
@daily /usr/bin/rsync -aqz --delete --rsh="ssh -i /Users/yanowitz/.ssh/id_dsa_rsync" /Users/yanowitz/Pictures/iPhoto\ Library mini.local:/Volumes/raid

you instead write:

1,16,31,46 * * * * eval $SSH_SETUP; /Users/yanowitz/bin/backup_igtd.rb
@daily eval $SSH_SETUP; /usr/bin/rsync -aqz --delete --rsh="ssh -i /Users/yanowitz/.ssh/id_dsa_rsync" /Users/yanowitz/Pictures/iPhoto\ Library mini.local:/Volumes/raid

Yeah, that sucks, I know. But it’s better than nothing.

Please let me know what obvious and superior solution I am missing.

(And yes, I’m too lazy to write launchd plist scripts. I’m sticking with cron. It would also be more of a hassle to do this solution, because you’d be invoking /bin/sh to do the rest of the work).