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: http://djhweb.co.uk/sqlite1.htm

So I had to change the code:

$db = sqlite_open('filename',0666)

to 

$db = new PDO('filename');

Then:

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

to

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

And:

$row=sqlite_fetch_array($res);

to

$row=$res->fetch(PDO::FETCH_ASSOC);

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 - http://www.my-debugbar.com/wiki/IETester/HomePage