Tuesday 30 September 2008

Gmail labels and date sorting

When you apply a label to a GoogleMail message that message is sorted by the date that label was applied (not the date of the latest email in the conversation) - which can be a bit confusing as the Inbox messages are sorted according to latest dated conversation?! Is this a bug or a feature....

Anyway you can get Gmail to resort all your messages in a particular labelled directory/folder by going into the folder and selecting all messages in folder and reapplying the same label - magically the messages will be sorted according to lastest conversation date!

An alternative approach (which keeps the same ordering in the original folder) is to again select all messages in the folder and the apply a new label - this new labelled folder will contain a properly date sorted list of emails.

Monday 8 September 2008

Dynamic library dependencies - direct or not?

So you're looking at some (Linux) binary and wondering what libraries it uses - You can use ldd to list all the dependencies:
ldd /path/to/your/app
However this shows direct and indirect (i.e. those needed by other libraries) dependencies, so you can tell what are just the direct dependencies by using readelf:
readelf -d /path/to/your/app
The direct dependencies are the libraries listed as NEEDED.

Friday 5 September 2008

Leopard upgrade and kernel crashes/panics

I just upgraded from Tiger (which I was very happy with) to Leopard - which has crashed no lees than four times since I installed it?!! I was going to do a clean reinstall but apart from not wanting to sink more time into I did some Googling and found some possible cures - basically due to older (non-Leopard compatible) versions of software - particularly kernel modules (kext stuff). You can have a look at the kernel modules loaded by running kextstat and looking out for non apple ones. Or better you can use the following incantation to show you all non apple kernel modules (including from the Startup folder) on your system (shows you their bundle name, ID and path):
kextfind -e -f /Library/StartupItems/* -not -bundle-id -i -substring 'com.apple.' -report -b -B -print
Or to do the same for loaded modules only (which are a possible immediate problem):
kextfind -e -f /Library/StartupItems/* -loaded -not -bundle-id -i -substring 'com.apple.' -report -b -B -print
To cure suspect (if you see them in a crash report or seeing nasty logs about them) kext modules - either find an appropriate upgrade, uninstall them or unload and remove them (e.g sudo kexunload /Library/Extensions/Dodgy.kext && rm /Library/Extensions/Dodgy.kext) and reboot.

You should also go and have look at the system logs (Console app) to see if there's nasty messages in there about dodgy goings ons.

Here's s of the known ones that cause issues:
  • Doublecommand - Upgrade or uninstall it - The old version seemed to be the cause of a some USB related crashes.
  • SmartSleep - Seems not to work properly and leaves quite trail in the log files.