Sunday, January 23, 2011

Android: Rebind camera button to a menu with Tasker

I got an HTC Desire Z last month and I'm loving it. It's replacing my computer more and more. You can read my page of notes I've collected on it here.

I've got Cyanogenmod running and my one complaint is that the camera button only launches the Camera app and there is no way to rebind it.

Or is there? I have the excellent Tasker app and figured out how to get it to pop a menu when the button is pressed! Here's how:

1. Create a new Profile in Tasker (mine is called Camera)
2. Select Event: Hardware: Camera Button as first context and tick Stop Event. This will stop the system
from launching the Camera app at the same time.
3. Create a new task and under its properties, change the task type from Execute to Menu.
4. Add new actions for each app you want to launch (I have camera, barcode scanner and torch)
5. Apply and enable the profile.

That's it! Enjoy :)

Wednesday, January 12, 2011

Exchange 2k10 SP1 DAG Reseed

Recently I had an issue where my DAG got out of sync. First the CQL was up past 9800 and increasing.
I misguidedly deleted the log files and the CQL shot up to 187k! But at least it was going down.

After a day, the CQL had only dropped to 175k so I knew I had to reseed. Fortunately the datacenter is only a brisk walk away.

I set up Windows Server Backup to take a full snapshot of the good exchange server. This ran overnight and in the morning I brought the disk in. I removed my failed database copy and renamed its folders on the database disk. Then I mounted the VHD off the usb disk from the other server, copied the database and log directories, and remounted the database copy using this command:

Add-MailboxDatabaseCopy -Identity "Primary Mailbox Store" -MailboxServer SVR15 -SeedingPostpone

At this point I got the error: 

Registry key has subkeys and recursive removes are not supported by this method.

The fix for this was to get the GUID by:

get-mailboxdatabase "primary mailbox store" |fl name,GUID

I navigated to HKLM\Software\Microsoft\ExchangeServer\v14\Replay\State and deleted the guid's key, then retried the add-mailboxdatabasecopy command above.
It worked, but didnt show up in the System Manager immediately. I waited a bit, restarted the System Manager and my repaired database copy was there with a CQL of 967 and going down fast! Job done, beer time.