Just another site

Category Archives: OS

Fix broken chm ( compiled HTML file ) files

I’ve had a bunch of docs in *.chm format.
Looked like they were broken on Win 8.

Just figured out that due to some security enhancements the links & authority of the files weer broken.

To enable it:
1. Select the file
2. Right-click select properties
3. Watch out for the Unblock button.
4. Click on it and close the dialog by clicking on the button OK.
5. Launch the file and voila! It works!


C# : Working with .cab (cabinet) files

.NET does not have any classes for creating cabinet files out-of-box, so today I had to look what else is available out there. There are a couple of solutions I found for creating a .cab file from the .NET code. The one that actually worked for me was a library developed by Microsoft(!) as part of their Windows Installer XML (WiX) toolset. This toolset is distributed with a bunch of dlls as part of its SDK. The library that allows to create cabinet files is called Microsoft.Deployment.Compression.Cab and located under <WIX_Installation_Folder>\SDK.

In your project you need to add a reference to the Microsoft.Deployment.Compression.Cab.dll and to Microsoft.Deployment.Compression.dll (located under the same folder and has some base classes for types defined in the Microsoft.Deployment.Compression.Cab).

After doing this you can add files to a cabinet file from .NET with just a couple of line of code:

using Microsoft.Deployment.Compression.Cab;

//create a instance of Microsoft.Deployment.Compression.Cab.CabInfo
//which provides file-based operations on the cabinet file
CabInfo cab = new CabInfo(@”C:\”);

//create a list with files and add them to a cab file
List<string> filesToArchive = new List<string>() { @”C:\file1″, @”C:\file2″ };
cab.PackFiles(null, filesToArchive, null);

//add a folder (including subdirectories) to another cab file with a maximum compression level
cab = new CabInfo(@”C:\”);
cab.Pack(@”C:\folder”, true, Microsoft.Deployment.Compression.CompressionLevel.Max, null);

//unpack a cab file into C:\Unpacked folder

The library has an MSDN style help file located under <WIX_Installation_Folder>\doc\DTFAPI.chm.

Another dll that also comes with WiX toolset SDK is Microsoft.Deployment.Compression.Zip.dll that provides similar functionality for packing and unpacking zip files.


C# : Credentials management on windows 2008

I was looking at options to save credentials on Wnidows platform.The traditional way is registry or DB or filesystem.But then one has to keep an eye on security issues & other headaches that follow.

Then i saw this feature in W2K8 ,”Credentials Manager”. The API for it are in C/C++ , but i needed a solution in C#. So I triaged a bit & came across a solution for the same .

Another one :


Add command prompt shortcut to Windows Explorer

  1. Click on Start=>Run & Open registry using “regedit”.
  2. Navigate to “HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell”.
  3. Create a Key called “command prompt”.Set the default string to value “CMD Prompt Here”.
  4. Under the key created above,create another key called “command”.Set the default string to “cmd.exe /k pushd %1”.
  5. It takes effect immedialtely try out in the windows explorer.

Enabling menu bar in windows explorer on windows 2008

  1. Open Windows Explorer
  2. Click on “Organize” menu option @ the top left hand corner
  3. Select “Layout” & from the sub-menu select Menu Toolbar

Installing MongoDB 2.0.3 on Ubuntu 10.04

I tried following the following wiki:

Didn’t workout so i decided to have my own triage 🙂 . I’m going to assume user is comfortable with Ubuntu.This should work with Ubuntu 11.x too.

  • Create Apt source

Create /etc/apt/sources.list.d/mongodb.list
Add the following line to the above created file : deb dist 10gen

  • Add the GPG Key and Update Index

sudo mkdir /etc/apt/trusted.gpg.d/

sudo apt-key adv –keyserver –recv 7F0CEB10

sudo gpg –export | sudo tee /etc/apt/trusted.gpg.d/ > /dev/null

sudo apt-get update

sudo apt-get upgrade

  • Install MongoDB

sudo apt-get install mongodb-10gen

Have fun!

Linux internals

Ubuntu – My tryst

Some tips & tricks while working behind corporate firewall/proxy on Ubuntu(11)

1. Setting up proxy server on Ubuntu

export http_proxy=’http://{DOMAIN}\{USERNAME}:{PASSWORD}@{PROXY HOST NAME}:{PORT}/’

2. Setting up proxy for apt-get

Acquire::http::Proxy ‘http://{DOMAIN}\{USERNAME}:{PASSWORD}@{PROXY HOST NAME}:{PORT}/’;

Acquire::https::Proxy ‘https://{DOMAIN}\{USERNAME}:{PASSWORD}@{PROXY HOST NAME}:{PORT}/’;

if you have “@” symbol in your password use %40

3. Turn off firewall

ufw disable

4. Install Vmware tools

mount /dev/cdrom /media/cdrom

cp /media/cdrom/VMwareTools-8.3.7-341836.tar.gz /tmp

tar zxvf /tmp/VMwareTools-8.3.7-341836.tar.gz

cd /tmp/vmware-tools-distrib


5. Install git

apt-get git-core gitosis

6. Howto configure network

7. If you are looking for one stop shop for Ubuntu release apart from the LTS version here is the link

Installing centos on Hyper-V

Makes sure you select Legacy Network Adapter while configuring a network for the host OS.

Also a good blog to install Centos on hyper-v with mouse support