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# 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 …

C# Using List.Find

Ever wonder how you use a Predicate Delegate to make the Find function work? Well I was wondering as well, so I found the following useful snippet on MSDN: http://msdn2.microsoft.com/en-us/library/x0b5b5bc.aspx