Tuesday, November 24, 2009

Windows Media Player & S3

After some work I discovered that Windows Media Player (WMP) 9 through 11 on XP intermittently fail to play MP3 files hosted on S3

The 64 Bit Encoded S3 signature might contain an escaped plus which WMP does not handle correctly.  So for example we expect this signature to go untouched.

Signature=pXucORkPxykKvQo%2B0Hv17jvSPVE%3D

Is improperly re-escaped (mangled) by WMP as the following. Notice the + and the equal sign.

Signature=pXucORkPxykKvQo+B0Hv17jvSPVE=

When decoded by Amazon's servers the plus is interpreted as a space and therefore neither the 64 bit encoding, nor the signature are valid causing the download to fail.

Wireshark was a huge help in watching the traffic flow and proving that WMP was mangling data.

Reset the Active-X Information Bar

I was doing some Active-X control testing where an Active-X control was not loaded and the Information Bar is displayed.

sshot-199

In one test I allowed the control to be run. I needed to undo that choice but couldn't figure out how. On Windows Vista with IE the solution was in the registry under:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Stats

The specific Active-X control is specified by CLSID. So in my case it the Windows Media Player Active-X CLSID is 22d6f312-b0f6-11d0-94ab-0080c74c7e95.

Removing the subkey that specifies the domain caused the information bar to appear on reload. In the example below I removed iexplore\AllowedDomains\ringrevenue.com

image

For Windows XP & IE 7 you will only see the key "iexplore" (no subkeys). Delete the iexplore key.

Wednesday, November 18, 2009

MySQL & InnoDB

InnoDB is our preferred database engine.  Use show engines to see if InnoDB is enabled.

show engines \G

show table status \G

When changing the InnoDB log file size make sure you remove the ib_logfile* files.  If you don't the server doesn't start cleanly and you get an error in /var/log/mysql.err such as the following:

InnoDB: Error: log file /var/lib/mysql/ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 67108864 bytes!

I found the DB install scripts in RightScale does not do this, causing me hours of pain for a simple task.

Tuesday, November 17, 2009

MySQL @ 3:00 AM

So here is what I learned while working with MySQL at 3:00 am

  1. usernames have to be 16 characters or less.  30 minutes lost rebooting a mysql server.
  2. Triggers have a "definer" that specifies the security context the trigger is run in.  So when restoring a database if that user doesn't exist you will run into problems.  That I could find there isn't an easy programmatic way to reset the definer of a trigger.  Presumably you could remove and recreate the trigger, but doing that is a pain in the ass too.