WordPress Google Cache poisoning

If you see garbage showing up in your sites google cache, you might want to have a look at your wp-includes/general-template.php file. Specifically the section that contains this line: if(!(strpos($sUserAgent, ‘google’) === false)) It should probably not be there, and will have been deposited there without your knowledge. Remove it and wait for your site …

C# create a new GUID

If you need a new GUID (not in code) and have MS Windows SDK installed, you can type this in the cmd prompt: uuidgen which will give you something like this: C:\>uuidgen ff9ddb07-bf8e-4f90-9475-8715c061231c If you need to do this at runtime in .Net, see System.Guid. System.Guid guid=System.Guid.NewGuid(); Console.WriteLine(guid.ToString);

Gacutil location in Windows Vista

Weird, the Vista UAC prevents you from running gacutil, and on my machine this location was not PATHed. Figures. You’d have to fire up a CMD window (as Administrator) and find gacutil here: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

C# Timers

There are three kinds of timers in .Net but it’s not always obvious when to use which one.  Here’s some sample code of each, and then later on a table from the MSDN website that summarizes the differences. // Runs on the UI thread // Will not raise events if UI is unable to process …

C# Suspend and Wakeup

If you need to suspend a device running on battery power programmatically and wake it back up SO THAT THE MONITOR TURNS ON you need to use the basic Suspend if the device AND the SetThreadExecutionState function. If you don’t, the device will assume there is no user activity and since no thread has signalled …