Thursday, September 20, 2012

Mail unread menu and 5.3

Another thing that broke on an OSX upgrade was mail unread menu (http://loganrockmore.com/mailunreadmenu/) which I really like.  So with a little help from http://stib.posterous.com/how-to-fix-unsupported-plugins-after-upgradin I was able to write the following script (though you can cut and paste them directly into a Terminal (Applications -> Utilities -> Terminal) window).
#! /bin/sh

a=`defaults read /Applications/Mail.app/Contents/Info PluginCompatibilityUUID`
b=`defaults read /System/Library/Frameworks/Message.framework/Resources/Info PluginCompatibilityUUID`

for i in ~/Library/Mail/Bundles*/MailUnreadMenu.mailbundle/Contents/Info.plist
do
    echo "$i"
    echo "${i%%.plist}"

    defaults write "${i%%.plist}" SupportedPluginCompatibilityUUIDs -array-add "$a";
    defaults write "${i%%.plist}" SupportedPluginCompatibilityUUIDs -array-add "$b";
    plutil -convert xml1 "$i"
done
Then a
mv ~/Library/Mail/Bundles\ \(Disabled\)/MailUnreadMenu.mailbundle/ ~/Library/Mail/Bundles
Made things right again.

Wednesday, September 19, 2012

gpgmail for 5.3

Updated to Apple Mail 5.3, and gpgmail stopped working.  Uninstalled gpgmail, gpgtools, and reinstalled both.  Had to do "chown -R beaty-admin /Library/Mail/Bundles/GPGMail.mailbundle" and run the System Preferences, GPGPreferences, About, Fix GPGtools to get everything working again.

ubuntu 12

http://askubuntu.com/questions/129012/how-can-i-restore-the-activity-monitor

Wednesday, September 12, 2012

Is consistency overrated?

I have a Firefox extension: https://addons.mozilla.org/en-us/firefox/addon/lightweight-theme-switcher/  I've been playing with adding a new menu, and was struggling to find all the default menu names.  Here they are: file-menu, edit-menu, view-menu, history-menu, bookmarksMenu, tools-menu, windowMenu, helpMenu.  Am I the only one that this bugs?

Sunday, August 26, 2012

Disappearing SD MMC slot on MacBook Pro

Some upgrade caused the SD MMC slot on my MacBook Pro to no longer be recognized.  Zapping the PRAM (option-command-p-r during boot) brought it back.

Friday, August 3, 2012

Incremental/interruptable Unix/OSX file copy

I wanted to copy a large file to a Unix (OSX) system, and I knew it wouldn't complete before I took my laptop home.  Indeed, it would take a couple of days, so a couple of detaches would be needed.  I couldn't find anything that seemed to do the job I wanted, so I wrote the following script.  It takes two arguments: the from file and the to file.  It examines how large the to file is, and starts the copy from there, using 1 megabyte blocks. It won't work if the file changes during the overall copy operation of course.
#! /bin/bash

output_size=`du -m "$2" | cut -f 1`

if [[ $output_size = "" ]]
then
    output_size=0
fi

dd bs=1m seek=$output_size skip=$output_size if="$1" of="$2"