Thursday, February 25, 2010

Blocking user agents in IIS7

I had a problem with a very specific User-Agent - GBPlugin from Brazil.

Not sure why but this User-Agent was blocking IIS7 (not my ASP.Net app but IIS7 itself :/)

To solve this, I tried blocking GBPlugin a few ways - URLScan, RequestFiltering and my own custom http module. However, eventually I worked out how to do it using the generic URL rewrite module:

Although I of course configured this using the IIS UI not going direct to the .config files - just felt safer on the live server.

Monday, February 15, 2010

Enabling Screen Rotation on Samsung Omnia II phone - also enabling classic Microsoft Settings Control Panel

It took a little finding - but together these guys give the solution:

Two registry keys to change:

  1. HKLM\System\GDI\Rotation\HideOrientationUI and change the value to 0
  2. HKEY_LOCAL_MACHINE\Security\Shell\StartInfo\HideSettings change to 0

Monday, February 08, 2010

Getting SQLite to work in PHP (PHP5) on Windows Server

I just wanted to use the existing code....

But it seems PHP5 underwent a big change in "PDO" for SQLite.

I went around the houses looking at errors like "Class 'SQLite3' not found php" and " Fatal errorCall to undefined function sqlite_open()"

But... finally I found:

So I had to change the code:

$db = sqlite_open('filename',0666)


$db = new PDO('filename');


$res = sqlite_query($db, $query, SQLITE_ASSOC);


$res = $db->query($query);





I might have got some of this wrong... but hopefully not!

If you hit "SQLSTATE[HY000] [14] unable to open database file" then that means you need to open up read/write permissions on the database directory.

Friday, February 05, 2010

Doing IE6 testing

You don't want to, but sometimes you have to

When you do, then IE6 testing can be quite easily done using IETester - fab -