Monday, 11 July 2011

Microsoft Windows 7 : Screen Savers dropdown disabled (or grayed)

I wanted to edit the screensaver on my machine. I have windows 7 installed. I navigated to Control Panel > Appearance and Personalization > Personalization > Change Screen Saver
The 'Screen Saver' dropdown appeared to be disabled (or grayed) with 'None' selected.

  1. Open regedit.exe
  2. Go to HKEY_CURRENT_USER > Software > Policies > Microsoft > Windows > Control Panel > Desktop
  3. Right-click SCRNSAVE.EXE and select Delete.

Friday, 8 July 2011

An error occured in avast! engine: Invalid argument

I recently installed Avast4Workstation in my laptop running Ubuntu 10.10. The avast engine was able to do a complete scan of my system. After that I decided to fetch latest updates for avast and clicked 'Update database' in the GUI. After the update happened, the avast will not open, but shows the error message

An error occurred in avast! engine: Invalid argument

In older kernels the maximum size of SHM block was limited to a certain number of bytes, that is being exceeded by the database. We need to increase the size of the SHM block to accommodate the large database
The command to be executed in the terminal is as follows. When executing the command it will ask for the root password.
sudo sysctl -w kernel.shmmax=128000000
The above command provided me with a temporary solution to the problem I was facing. After I restarted my machine, if I wanted to open avast, I had to type the command again. To get away with this, there is another way.

Add the line kernel.shmmax = 128000000 to the bottom of the sysctl.conf text file.
How to update the sysctl.conf file:
  1. Go to 'etc' folder, select sysctl.conf file
  2. With the sysctl.conf file selected, press Alt + F2. This will open the 'Run application' dialog
    1. Type gksu gedit
    2. Add kernel.shmmax = 128000000 to the file and save

Tuesday, 5 July 2011

Get assembly fully qualified name

While doing development it has occurred to me many times how to get the assembly name easily of a dll(that is strong named). The normal approach is to create it manually from the properties of the dll file.

I would like to share with you a very eazy way to get the fully qualified assembly name using Visual Studio. It uses the external tools feature of Visual Studio.

  1. Open Visual Studio
  2. Go to Tools –> External Tools
  3. Click on "Add" to add a tool, and put in the following values:
    1. Title: Get Qualified Assembly Name
    2. Command: Powershell.exe
    3. Arguments: -command "[System.Reflection.AssemblyName]::GetAssemblyName(\"$(TargetPath)\").FullName"
    4. Check "Use Output Window". All other checkboxes should be unchecked
The new tool appears under Tools –> Get Qualified Assembly Name.

When this menu item is selected, the assembly name is given in the output window.
It should look like HelloWorld, Version=, Culture=neutral, PublicKeyToken=b2135059549c7590