Thursday, September 24, 2009

Get Class name from Static method in C#.NET

In order to get class name from the static method I used the following code, using .NET reflection

String className = MethodBase.GetCurrentMethod().DeclaringType.Name;

Thursday, September 10, 2009

Remove registry keys and subtrees

In order to remove the registry key and all sub-tree beneath it, create file with extension .reg and put this text in the file and double click the file. In following example all registry keys and sub trees under MyProgram will be deleted

Windows Registry Editor Version 5.00


Disable monitor timeout from Ubuntu server console

To disable monitor auto off from Ubuntu Server console, I used following commands

$setterm -blank 0
$setterm -powersave off
$setterm -powerdown 0

Tuesday, September 08, 2009

Disable Ubuntu monitor auto turn off

To disable auto turn off monitor for Ubuntu Server console I changed /etc/console-tools/config and made BLANK_TIME=0