Archive for the ‘SiteMania’ category

Remote Desktop : Hamachi + VNC [ Deadly combination ]

Hi folks,

Sorry for this so late post. Actually was very busy with some management stuff in my company and had a very tight schedule.

Any ways, so introducing Hamachi + VNC.

If you need to access a remote computer on Network trust me VNC is one of the best in the business. Just install VNC ( Server + Viewer ) and bingo… You are ready to access a desktop remotely.

But problem comes when you are not on same network or say you want to access a computer over Internet. Now hamachi comes into the picture. Hamachi creates VPN ( Virtual Private Network ) between few computers.

We will go step by step :

Step 1: Download and install VNC.image

You can download VNC from following locations :

VNC website :

Filehippo :

You can find Steps to install VNC here

Want to know more about RealVNC… go here

Step 2: Download and install Hamachi. 

You can download Hamachi from following locations:

From LogMeIn Hamachi Site :

FileHippo :1)

You can find steps to install Hamachi here. This article also contains how to create a Virtual private Network between two computers.

Step 3: Create VPN between two compuers using Hamachi.

With the help of this article create VPN between two computers.

Step 4: Do Remote Desktop using VNC Viewer.

After creating VPN start VNC Viewer on one machine( machine A ) from which we want to control other machine ( machine B ). In Hamachi Network right click on machine B and click Ping. See you are getting ping correctly or not. If you are not getting Ping correctly than machine B might have some firewall or antivirus kind of thing which is blocking your commands. Solve this issue.

When you get ping correct, again right click on Machine B in Hamachi Network and click Copy Address

In VNC Viewer give this copied IP Address as Server name, and hit Ok. Nowyou will get password screen. If in Machine B VNC Server you have set up a password than give that password here. If You have not given any password than leave it blank, and hit Ok.

Magic………… Now you are controlling Machine B from Machine A…. :).


Few other uses of Hamachi. It basically gives an IP address to your machine accessible to all other machines on same network. It means that suppose you have developed one web site on your machine and you want to demo it to your client who is not on same network or say is accessible only through internet, you can use Hamachi effectively. Just setup a VPN using Hamachi with your client. Give hom URL to your site with servername as your IP Address on Hamachi Network. :)

Other Players In Remote Desktop :

I love TeamViewer. image

But its free version is for evaluation purpose only and terminates the session after some times.


eMail Forwards – Spare a second to save your friends

Hi All,
We all love this forward messages and we welcome them since they work as a little refreshment in our busy work schedule.
But we need to be little responsible and careful when we send this forwards to our friends.
Please take care of following two things to honor privacy of our friends who share their eMail address with you and trust you.
1) Always do bcc. Never send a forward using plain To: field. Everyone can see to whom you are sending the mail and he has access to all eMail addresses to whom you have sent this mail.
Use bcc instead which makes recipient list as anonymous.

2) Before hitting Send please spare a second to remove all forward information from the eMail which contains eMail addresses of previous sender and all the to,and cc recipients.
Also check if user's has put their signature at the end of mail or not since normally users put their mobile No.S and where they work also in signature( Sometimes these signatures are automatically appended by Mail server ). If signature is there then remove all the signatures. This is very important.

3) Let the subject line indicate Fw: or Fwd:
This will help recipient  to differentiate if the eMail is Forward or a Text. He can also use filters ( gMail ), Rules ( Outlook ) to categorize eMails as Forwards.
Follow this steps since they will hardly take few seconds and you will save your beloved friends from being victim of social engineering or tele callers or spammers.

Note : You can forward this eMail but please make sure you have followed above steps.
I have also published it as a blog entry in my blog. If you want to say anything regarding this please send me a comment on my blog or reply this mail.

Fruitfultime – Monitoring, Analytics, and Enhancement of Productivity

Hi All,

Again I have found a great pair of magicians who allow me to check how productive I am.

Introducing Fruitfultime.


I have implemented following process in my office.

1. Every developer machine will have fruitfullTime installed.

2. Every machine will have Firefox installed with the plugin ScreenGrab image_8

3. Now FruitFullTime runs silently in task bar for whole day. Whenever you want to see the usage of time, just click on fruitFulltime iconimage_12 in taskbar and it will Show you a page in your browser ( We have Mozilla Firefox as default browser ) containing hell lot of statistics about your usage of computer today.

This is the example screen from their web site ( I can not show my screen for the reason of privacy ;) )

Using these stats I exactly know now how much time I am giving to bloody gTalk,gMail. I really surprised by knowing the amount of time I spend on gTalk.

4. Everyone will do ScreenGrab at the end of day for FruitFullTime statistics page and will mail it to one eMail Address.

I know I have created a work around to use a great system for free, but I will definitely try to purchase its Business edition as soon as it will be available.


You can check some reviews about it here.

You can  Download it from following location.


Best Regards,

Mahin Gupta


Checking Internet Connection

So basically there are 3 ways to do it. We will check each of them and will find the best out of them.

 1) Send WebRequest

                private static bool IsInternetConnected()
            HttpWebRequest req;
            HttpWebResponse resp;
            bool bRet = false;
                req = (HttpWebRequest) WebRequest.Create("");
                resp = (HttpWebResponse) req.GetResponse();
                bRet = resp.StatusCode.ToString().Equals("OK");
            catch (Exception exc)
                bRet = false;
                // resp.Close();
            return bRet;

Remarks : You need System.Net namespace to use HttpWebrequest and HttpWebresponse.


2) InternetGetConnectedState()  – wininet api


       private static bool APIInternetGetConnectedState()
            bool bRet = false;
                int Desc = 0;
                bRet = InternetGetConnectedState(ref Desc, 0);
            catch (Exception exc)
                bRet = false;
            return bRet;

Remarks : You need to create extern function to use this api and have to use runtime interop assemblies. So you need to reference namespace  

        System.Runtime.InteropServices and include following code in your class definition.

        private extern static bool InternetGetConnectedState(ref int description, int ReservedValue);


3 )InternetCheckConnection – wininet api

        private static bool APIInternetCheckConnection()
            bool bRet = false;
                bRet = InternetCheckConnection("", 0x01, 0);
            catch (Exception exc)
                bRet = false;
            return bRet;

Remarks : You need to create extern function to use this api and have to use runtime interop assemblies. So you need to reference namespace  

        System.Runtime.InteropServices and include following code in your class definition.

        private extern static bool InternetCheckConnection(string description,int flags, int ReservedValue);


Comparision :

Table shown below compares all the methods. Interestingly InternetGetConnectedState() reports connected even if we are not connected to Internet, and that is very natural since it has no way to detect if you are connected to actual Internet ( ie particular server ) unless you send a request to web server. You can find a good explanation about it here.Again you have to use interop services to use both this api which can cause performance issues.

Using Google server as server to request has also pros and cons. 1) Google is used heavily – but again it effectively uses CDN, so I don't think this argument holds a point. 2) You are almost very sure that Google server will be up and running in almost all circumstances, but yet for the sake of precaution use this as parameter and get it from either Database or App.Config

So after all of this for the time being I will go with Method 1 ie by using Send Web Request.

Method No Connection Connected to Intranet Connected to Internet
Send WebRequest false (0 ms) false (0 ms) true (550 ms)
InternetGetConnectedState false ( 30 ms ) true ( 0 ms ) true ( < 10 ms )
InternetCheckConnection false ( more than 2 seconds ) false ( 400 ms ) true ( 78 ms )


There exist other methods also to check Internet connectivity ie Create a socket connection to Web server, Use Ping or tracert, Open a telnet connection but many of this can create problems when firewall is on. yet, I am still interested in finding a better method than this. Please let me know if you know one.


Best Regards,

Mahin Gupta

App_Offline.htm – An easy way to take your application offline.

Sometimes it is really a big pain to take your application offline. has one very good feature to take your application offline without any pain.

Method : put an HTML file named app_offline.htm in the root directory of your web site. will shutdown your application, Will unload your application domain, and for every request made to your web site it will return the content of App_Offline.htm

So now you don’t need to write any logic for taking your application offline.

Remarks :

1. Make sure you put at least 512 bytes content in the page, otherwise the browser will display 404 Not Found.


There is one more way to take your application offline : You can set enabled attribute to false  in <httpRuntime> tag.



Mahin Gupta

BlogEngine – Windows Live Writer Bug – Post not visible

I am using BlogEngine for my blog and using Windows Live Writer to post it to my blog.

I came across a very strange thing today.

I have posted a post using Windows Live Writer but it was not visible to the world. Strangely I was able to see it when I am logged in to my blog, moreover in the Month Archive

After digging sometime I got the point. BlogEngine comes with a handy feature of preposting, where you can publish a post in advance and it will be visible to the world only after it's publish time you have set.

The problem was basically of the difference between my Local Time and Server time.

When I post it using Live Writer it sets the publish time according to my local time. When BlogEngine displays any post it checks for its publish time and will display it only if the publish time is not in future.

So What is the solution :

1. When you post to your blog through live Writer, Set the publish date which is not in future for your Server.


1. Post to your blog through Live Writer, Go to your blog admin panel, change the publish date.


1. Wait for future… it will show up automatically. :)

Any ways…. Take my words, except this small problems the combination of BlogEngine and Windows Live Writer is killer… too Good.

I will give this pair 5/5.


Thanks and regards,

Mahin Gupta

Google Talk chatback badge on your Blog/Web

Here it is… Google again came with bang.

One of my client needed live Chat support on his web site. So I have tried lots of options including third party component, making my own chat system but than I came across the Google thing. Yes, you can add google talk chat support on your blog/Web site.

They call it Google Talk chatback badge.

If you want one for your own than go to

They will ask you for login, after login you will be redirected to Create a Google Talk chatback badge Page.


Rest of the steps are very easy..

1. Select a title for your badge.

2. Write your nick name : ( Mahin )

3. Select Style depending on layout of your website or blog.

4. if you want to display your status message there then check the checkbox Show your status message.

5. Click update badge.

You will be given a script in below textbox, just copy and paste this script in your blog/Website.


How it works :

1. If your gTalk Status is Available ie. Your status icon is green ball Available then your nick name/Title will become hyperlink. ( If your status is busy then it will not be a hyperlink.)

2. When someone will click on that link

– he will get a popup chat window.

– You will get a chat from with one link. If you want to join this chat than click on that link.

– you will be redirected to your default browser to open a popup window. if you are not already  logged in in to your gMail account than it will ask you to login.

– After login you will get Launch Chat button. Click on that and you will get a popup window, where you can chat with user.


Remarks :

1. Both party must have Flash 8 or higher plugin installed in their browsers.

2. System is quiet slow, so better you write warning about same in your blog/Website.

3. You should not put this type of things directly on your home page, because basically it is a cross domain request so it will affect the loading time of your home page. So better you put link for this on home page and open a pop up or new page for this.