Tuesday, December 07, 2010

Powershell: Find certificate by thumbprint

cd cert:
dir -recurse | where {$_.Thumbprint -eq "84e2c011ad0c1b3f6d32f651069bba184c426158"} | Format-List -property *

Monday, October 18, 2010

Check how many open DB connection we have

SELECT SPID, STATUS, PROGRAM_NAME, LOGINAME=RTRIM(LOGINAME), HOSTNAME, CMD
FROM  MASTER.DBO.SYSPROCESSES
WHERE DB_NAME(DBID) = 'MyDb' AND DBID != 0

Saturday, September 04, 2010

Unlock locked android

My child was playing with my HTC tattoo and he was try too many unsuccessful unlock patterns. When I try to unlock my phone it was asked for Google account credentials. But whatever I have try to enter I got a message:
"too many pattern attempts" and "invalid username or password"
The only solution that left was to do a factory reset :,(
And finally I found solution:
Enter your google username (with @gmail.com) and "null" as a password

Thursday, July 01, 2010

Wednesday, May 05, 2010

See cookie size in fiddler

To see cookie size in fiddler do the following:

  • Choose from menu: Rules | Customize Rules
  • Add "oSession["ui-customcolumn"] = oSession.oRequest["Cookie"].Length.ToString();" as the last line in method OnBeforeRequest
Cookie size will be the last column

Thursday, April 08, 2010

SQL query optimization tip

If you change your query in management studio query window like this:


SET STATISTICS TIME ON

Go

SET STATISTICS IO ON

Go

[Your query]


you can check Messages. There are lot of useful information there (timers, seeks for each table). Using this and using execution plan you can better optimize your sql queries.

Friday, March 05, 2010

Wednesday, February 10, 2010

WCF and Performance Counters

To enable counters for WCF services add following line


<diagnostics performanceCounters="All" />


at the xml element


<system.serviceModel>


in web.config file or in machine config file (for all services on your machine).

To see counters data start from command line:

perfmon.exe


Open performance monitor and add counter from: ServiceModelService

Monday, January 18, 2010

Fiddler and ASP.NET Development Server

ASP.NET development server only accept urls that starts with localhost. Therefor when your request comes from fiddler it become 127.0.0.1 and ASP.NET development server will reject it.
To enable fiddler to work open from menu TOOLS | Hosts and enter

127.0.0.1 localhost


Now, every address from 127.0.0.1 will become localhost just what ASP.NET development servers like :)