Sunday, October 17, 2010

Using Mono

I have been involved in developing .NET web applications  since quite some time now. Usually the applications are targeted for the Windows OS, using IIS as a web server. This particularly helps organization already having users setup and running on windows that could authenticate and authorize themselves against their windows accounts to utilize the web applications. However I quite frequently dabble with code on my home laptop, which runs Windows Vista Home Basic (among others). Not pretty eh !? This does not and can not have an IIS installation. So all I had to rely was on Visual Studio Express edition (since I don't like spending money on stuff), and debug applications using the mini ASP.NET web server shipped with the Visual Studio Express. There were two problems with this :

1) I could only debug my applications. Never actually host them on my laptop.
2) I have a mediocre home laptop. 1.66 GHz dual core processor and 2 GB RAM. Visual Studio Express wasn't helping me achieve efficiency (while working, it would easily hog all the resources).

So I dug up some articles on the web, and found out that I could install Apache HTTPD web server on my laptop, and install the mod_aspdotnet module, to host ASP.NET web applications. This was pretty cool. The HTTPD web server is pretty fast, and doesn't hog down the laptop. Perfect. I could develop applications in Visual Studio Express, and host them on the Apache web server (HTTPD) to see how things work out in real time. So far so good.

But again there were some limitations. Apache community doesn't actively develop/contribute to mod_aspdotnet module, and since then it has been maintained by its own community. It is compliant with only up-to .NET 2.0. But the biggest problem of them all was that I rarely used Windows, and most of the time I am using Ubuntu. Working on windows meant spending away time from my favorite OS and feeling guilty about it.

But if there is a problem, there is always a solution, because chances are you are not the first person to have hit that roadblock. I read about Mono and have been using it ever since. It installed seamlessly on Ubuntu, and does not even hog my laptop resources. It comes with a mini xsp2 web server to let you debug the web applications, and you can also install apache HTTPD together with mod_mono module to host the web applications for real time experience. The bonus is Mono is binary compatible with up-to .NET 4.0 (barring some features). And I am in love with Mono ever since. Apart from the web development you could also do all the console, windows forms, and GTK# development.

Since then I have created solutions using Visual Studio, opened them in Mono from Ubuntu, compiled them in both places, and hosted them on IIS and HTTPD. Totally binary compatible. No issues noted.This is what I call true cross platform development. And as a matter of fact Mono can be installed on Windows as well. Open source for .NET has arrived. Next time some one ridicules .NET to not be truly cross platform, here is the answer. Mono. The only drawback I have found with Mono's IDE is that it doesn't provide for rich design time tools for web site design. However It makes great stuff for trying out code snippets, working on console applications, and creating class libraries and web services.

Here are the links for the softwares I have mentioned in this article. So that you could read more, and decide what combination is best for you :-

Visual Studio Express http://www.microsoft.com/express/
Apache HTTPD web server http://httpd.apache.org/
Project Mono (for Mono runtime, mod_mono module for Apache HTTPD, and the IDE MonoDevelop) http://www.mono-project.com/Main_Page

And this is the blog which helped me actually configure mod_aspdotnet on Apache HTTPD http://weblogs.asp.net/israelio/archive/2005/09/11/424852.aspx

It has only been few weeks since I first started experimenting with Mono, so not all information above might be accurate. There could be omissions or oversights on my part. I would be more than glad if anyone points those out, and helps me move ahead. 

Friday, October 15, 2010

who me? who is that?

I am not just who I am, its an amalgamation of who I was born as, how I was raised, who I mixed with, who I chose to avoid and who I couldn't, the sins I committed, the sins I should have committed but did not have the courage to, the occasional good I did, the actions I took, the choices I made, and the actions and choices of those around me. Could I have been some one else, or even with varying some of the factors forming me would still yield a person a lot similar like me?

Monday, October 11, 2010

An Indian version of Debian

Just found out that India has its own customized version of Debian Linux, credits to CDAC. It has been named as BOSS (Bharat Operating System Solutions) "http://bosslinux.in/". CDAC / DIT of India have also nurtured an organization called NRC-FOSS (National Resource Centre for Free and Open Software) "http://nrcfoss.org.in/". impressive :-)

Saturday, October 9, 2010

College Life

This Saturday (today, if I am not too late) I happened to be present at HCL's Career Development Centre. Actually they host Prometric tests, and my wife happened to have enrolled for an exam. So I had driven her to this place. While she was in the "room" taking the test, I was left with one good hour in the lobby with nothing to do. The place is almost like a college, since many final year kids and/or fresh graduates undertake some or the other IT course here to "jump start" their career. And the place was teaming with many of them. Apparently (or so it seemed) many of them were still not out of the mindset of not being in a college since I could overhear a lot of conversation from a noisy group. There were talks of bunking the class from dushera to diwali, excitement over a cancelled class for a faculty no show, and discontent on the grading given on the tests taken the previous week. It all sounded like pure bliss to me. Schooling was so much fun. 

Thursday, October 7, 2010

is that haze

Woke up this morning to an aromatic cup of tea. Nothing like it. But that is not what this is about. Strolled into the balcony and felt a strange chill in the air. Could just sit around in the hall without a fan, and what was that mist enveloping the Noida skyline? Winters knocking at doorstep already ? Seems like things are changing for good. Happy morning to all of you :-)

Friday, September 17, 2010

Ubuntu 10.10 beta is here

As a regular subscriber to Ubuntu updates, I felt duty bound to broadcast that Ubuntu 10.10 Maverick Meerkat beta is ready for download and some beta testing. Enthusiasts please go ahead and do your bit. The full release is around the corner and ticker to right hand side shows the countdown.

Saturday, August 7, 2010

Securing your file transfer

Quite often we end up in a situation where we would like to transfer some files to our friend or between our home and work laptops. But are worried about the security of the data being transferred. Using emails is not possible, as these are usually unencrypted and limit the size of attachments. Personal torrents are also ruled out as service providers may block torrent traffic, and many organizations don't allow torrent traffic from within their firewall to the outside world (you can actually get sacked if caught doing it!!). While I do agree that torrents are the best solution we could have, it is not so much trusted by the general community.

Another solution would be to have FTP over TLS/SSL (secure FTP). But this would mean having to constantly adapt to changing IPs (unless you have a static IP). And still being available on the general internet as a FTP server. Any person with the right user id and password, could still ftp to your laptop.

However I came across Comodo's (www.comodo.com) free Easy VPN software (http://easy-vpn.comodo.com/download.html), that provides the extra level of security we need. Combine this with any free ftp client server software like filezilla (http://filezilla-project.org/), and you are ready to go.

Basic Concepts,

What is VPN:- It is a private network which is layered on top of the internet. Simplly put it is a secret tunnel inside the internet in which only those can enter and meet who have the key to the tunnel's door. Bottom line, it is more robust than https and ftps. Organizations the world over trust theirs VPNs to allow their staff to "work from home". For more details (if you are interested that is) you may read the wiki article on VPN (http://en.wikipedia.org/wiki/Virtual_private_network).

What is FTP:- It is a standard network protocol for transfer of files over TCP/IP based networks such as internet (the VPN in our case) and LANs. Further reading from the wiki article. (http://en.wikipedia.org/wiki/File_Transfer_Protocol).


How to start,

So I guess you have two machines which need to talk. Decide which one will be host and which one will be client (both could be both for that matter). Download and install Comodo Easy VPN. Log into this software, and create a user id. To put things simply, this is just like any other chat client (yahoo, gtalk, aol, skype etc) but also provides the VPN feature. Other Easy VPN users can discover you and add you as a friend. Only people you accept as friends can connect to you (this is where security comes in). Comodo assigns a static IP address to each user. This will be displayed next to your user id. Repeat this installation on the second machine. Add each other as friend! So at the end of it, you would have machine 1 with static IP address A, and machine 2 with static IP address B. Type hello to each other to check if it is working (silly but important !) Lets decide machine 1 will be host, and machine 2 will be client. Leave the Comodo Easy VPN running on both machines. It should look something like this (I have erased details specific to me for security reasons):

Download and install Filezilla server,

 on machine 1. I would recommend a full installation, with manual start setting (that is ftp server is installed as a service, and does not auto start with either windows startup or user login. It has to be started explicitly). The next step is very important. Since you have installed COMODO VPN, you would typically have the following IP addresses (or something like these) allocated to machine 1. (You can check this by running "ipconfig" command from command prompt in windows)

127.0.0.1 default IP for local in windows
192.168.1.* default IP for your machine on your LAN / Wifi
A dynamic IP provided by your service provider
The static IP address A from Comodo, which will be something like 5.*.*.*.

Customizing FileZilla server ,

Start the Filezilla server, and go to Edit -> Settings and change the following options

1) IP Bindings. By default, Filezilla server will allow connections to all IP addresses listed above. Change this to only IP address A


2) Create a user account for accessing the FTP


3) Set a Shared Folder, and set is as Home Directory.

4) Start the server, by clicking on the bolt icon.


This was pretty much the basic steps for the host machine. Now with the client.


Download/Install/Customize the Filezilla client,

on machine 2. (I am assuming Comodo Easy VPN is up and running, and user @ Machine 2 is already friend with user @ Machine 1).  Start the client. Enter the connection details, IP Address A, user ID and password created in step 2 on machine 1. And click on "Quickconnect" button.

If all went well, this will establish the connection, and you will be ready to transfer files. The home directory set in step 3 will be displayed as root "/" in "Remote Site" box. You can browse in this location to make file transfers happen (depending on level of permission granted by server during step 3. did you notice the check boxes back there?).

The steps described above are specific to Windows OS, and the softwares prescribed. However you may setup your own solution on windows / mac / linux platforms using several similar software available from the internet.

Possible problems you could run into,

Comodo Easy VPN would need to be able to add exceptions to your firewall. Since I have firewall software from Comodo, I did not face any issues. But other firewalls may block and/or cause problems with Comodo Easy VPN. For any troubleshooting, you may contact Comodo Support (its free!) by registering at https://support.comodo.com/

The FileZilla FTP server would also need to add exceptions to your firewall, and you would need to allow incoming FTP requests from clients. If there seems to be a problem, you can go asking for help at http://forum.filezilla-project.org/

And in the end, I would recommend to go through help section in your firewall software as well, to check on how to change settings for FTP and VPN connections.

Hope this article was precise and will help you in setting up a FTP over VPN network.

Did I miss any obvious information,

If so, then please leave a comment, and I will try to put that detail in here.

Credits / Disclaimer,

All softwares discussed in this post are copyright products from their respective supplier/vendor. This post was not aimed at promoting or reviewing these products. Any harm caused by using these softwares / following the steps outlined in this post will not be the responsibility of the Author of The Dark Book.  Please make sure you understand what you are doing before you attempt to setup a FTP over VPN network, especially when you play with your firewall settings. If you need to transfer data between your home and work laptops, then it would be best (rather advised, and sometimes compulsory) to use softwares approved by your organization.

Switched to Fadnis.org

Finally tried my hands at something I have been trying so long. Getting a custom domain name, and moving my blogs and email on to this new address.
 
Migrating from wordpress was the worst thing I had to ever do (I had ditched blogger in the past for a wordpress.com account). But blogger's solution combined with google apps is by far the cheapest combination I could find on web for getting a custom domain with privacy protection, and making it work with a blogging website and email application.
 
I would like to thank the application developers of the website http://wordpress2blogger.appspot.com/ for this made the transition from wordpress to blogger quite easy. I could at least retain all my text, comments, posts and pages. The only loss is of the wordpress images, which are no longer accessible as I deleted my wordpress blog. But there's always a learning curve with something new that you try :-) I still have all those images on my hard disk, and may as well go an edit the 100 odd posts to make the images work anew.
 
The next challenge is to switch to my new email id (still haven't finalized what it shall be). I am giving second thoughts so as to why should I be doing it, and would there be any advantages in doing it.
 
After I sort all this out, I am going to try my hands at wordpress.org web hosting (not wordpress.com) using a free web host www.zymic.com Thanks to www.HUKD.com Hot UK Deals, I was able to locate the reference of this free web host. With limited bandwidth, and 3-5 free MYSQL databases and no ads, this looks to be quite a package for a hands-on at wordpress.org hosting.
 
The bottomline, http://darkbook.wordpress.com has been moved to http://sidsdarkbook.fadnis.org

Friday, August 6, 2010

It happens only in India

KFC advertising its finger lickin good "Veg Zinger Burger" in prime time slots on TV, just to beat McDonalds. I just lost my respect for KFC.

Sunday, July 11, 2010

I love my bad luck

Did you ever commit a blunder, and liked it later on. Did missing something ever gave you the ultimate satisfaction? In my case I felt the same today. The feeling of stupidity, foolishness, and happiness all at the same time.


Months ago, I had planned trip to Ujjain to attend a friend's wedding. I had booked return tickets by train (supposedly Intercity Exp, which runs daily at 6:00 PM from Ujjain) for Sunday July 11, 2010. However it turns out I had mistakenly booked the tickets not on Intercity express, but on Indore-Dehradun (which runs once in a week on Sunday at 5:00 PM).


So there I was, at the train station, with bags in hand, and confident of boarding the train at 6:00 PM. Only to be taken aback when my wife read the contents on the ticket. "Indore-Dehardun, Boarding Ujjain 5:00 PM". It was a rude rude shock, for I pride myself to be very systematic and organized. And I had missed the train by good one hour.


Only god knows, how I managed this blunder. Nevertheless, we went through the drill. Haggled with the TC for any seat on the Intercity, failed and then rushed back home to check tickets on any of the trains running through the night. Finally settled for a plane ticket for the next day.


But as I said, I loved this bad luck. For there were plenty of nice things that I could do, since I had missed my train:




  • shared my meal packed for train with my childhood friend Rochak.

  • Enjoyed another night at home, with my parents.

  • Gonna watch the world cup football finals. Yoohooooo!

  • Will get treated to a feast tomorrow by mom.


As its said, all's well that ends well :-)

Monday, March 1, 2010

Need free OS?

Well I have stressed this thing a few times in the past. But can not just stop doing it. When it comes to software, the best things out there are free. Anti virus, firewall, word processors, web browsers, aren't they? If you don't know, here are a few examples: avast, comodo, open office, firefox. If you haven't tried them you should; without delay.

Coming to the OS, should we still be paying for license fee for Windows to Microsoft when we don't actually need it. Just think, what do I use your computer for? An average user, does mostly net surfing, playing with office applications, image editing and watching media files. 80% of time, being on Windows is not even needed. Only some hardware items (printers, mobile phones etc which you use with your PC) are shipped with windows only drivers, and PC games are released for Windows platform. Leaving them apart, linux is the better alternative to using windows.

Linux!! Crazy, who has the time and skill to be using it. Agreed. But wait, there is a linux for human beings, it is called Ubuntu. Its free, open source, and comes with technical support and regular updates.
It has one of the easiest and fastest installation process, and can work from within windows. No need to format your PC what so ever. No technical expertise needed. And it comes in many flavors, and for different computer architectures (desktop, netbook, server, 32bit, 64 bit etc). Just give it a try, and see the difference. You will fall in love with it.

If you have trouble downloading the ISO file (installation disc image), just fill up the form at https://shipit.ubuntu.com/, and the Ubuntu guys will dispatch the CD to you for free.

Follow the Ubuntu Logo on right hand pane of this blog for more details.

Sunday, January 24, 2010

Nowhere in India, and the day when I shook hands with a Pakistani

I was travelling from Delhi's Hazrat Nizamuddin station to Ujjain in train 2416. The train started on 22 Jan, and was supposed to reach Mathura at 12:00 AM (Jan 23rd), however thanks to the dense fog, the train trailed for some 9 hrs in the vast swathes of "NOWHERE" and brought us to Mathura at 9 AM the morning. I had some how seen this coming and had bought a thick novel to keep my company. The book was my plan B, for most part I tried to sleep all the time and pretended I was not interested in all the chit chat going around me.


Strangely, people are not so talkative in trains on short distance journeys, usually, until they learn that they would be stuck with the strangers sitting next to them for the next 10-12 hours in daytime. With people from so many different backgrounds, religions, linguistic communities and castes (I was about to learn one more difference) all sorts of talks begin flying around.


There was this red mehendi dyed hair old punjabi lady who was amazed at MP culture and all the excitement among passengers who were eager for Nagda station to come; to satiate their collective hungers for poha, kachori and sanchi srikhand.


There was this "Indori Bhiyao" gentleman, now a production manager with some manufacturing firm in Ludhiana accusing the Punjabis to be hostile to outsiders in Ludhiana. There was also this other girl now doing her MBA from MDI Gurgaon (and I over heard that she was a junior from my college for engineering). And she got a lot of uncalled-for advice from this gentleman about why an MBA after BE, and about wasting her BE degree. I am sure she would have paid any amount to escape from the train. There were three more boys all from finance / banking background in awe about life in US. And they too got a thrashing from this gentleman who sincerely believed Indians only did menial jobs in US and told lies back here about their riches.


I had an overpowering urge to jump right in and defend the girl, the three boys, and beat this gentleman black and blue in a verbal duel. But I restrained myself. I would be fighting a war that was not mine for the next 8 hours or so. And also it would have proved that I was over hearing them all this while.


None of these people were in my compartment. My own compartment was strange in the fact that it did have quite a few talkative fellows, but with friends sitting elsewhere. There was this man from UP, apparently with a big brother in IAS, and kept rambling about him all the time. There were two working class youth who were busy in their laptops, having private jokes about their office colleagues in Mumbai. Three middle-aged punjabi men, business class, who had a wise view about everything. And a teen doing his MA in Political Science from DU. All of them tried to befriend me, but given my sleepy ways, gave up after a while. I was still secretly listening to all their talk. However, soon, all of them disappeared to where their friends were respectively. To my satisfaction I was left to myself.


Then just me and one other very quite fellow were left in the area. Seeing all people gone, and Ujjain coming near, his two other friends who were sleeping on top births came down and joined him. They were talking in a very strange language. And except the quite fellow (who could blend in the crowd) the other two had distinct features. They were tall, had rugged looks, and coarse and long hair. They were all apparently in much agony because of this unexpected delay.


Curious I striked a conversation with them, with some innocent questions. They were on a long journey, as they told me. Before the train they were on a flight that got delayed as well. They told me they were from "foreign". Their Hindi was pretty bad, but they were able to manage small broken sentences. Curious as I was,  I implored them further, to which one of them declared, we are from "Pakistan". I gulped down my shock, and asked "Sindh eh?". He said yes. We only had small talk after that. I did not want to appear shocked / rude at least to their faces.


All the images of Mumbai terror attacks, the violence in Kashmir, and the bombings of Delhi flashed through my eyes. And yet I could see the average Pakistani sitting next to me, coming to India to meet his relatives, attend a marriage perhaps. The contrast was so real and yet so hard to imagine for me.


Before I had any more chance to talk to them, Ujjain came. He (the one who declared they were from "Pakistan") noticed that I was packing and bid me good-bye. We shook hands and exchanged smiles. It (this meeting) brought a strange feeling. Something I would remember for months to come.


I got down from the train. And then it striked me, not a single person in that talkative crowd brought up subjects of recent firing along the Indo-Pak international border, Ajmal Kasb, the humiliation of Pak players in IPL, the possibility of an Indo-Pak war. Subjects which usually end with sentences like "lets nuke them once and far all". And I thanked god, for we would have been much embarrased later, all facts not withstanding, as we still should be playing good hosts to our visitors.


Having met the average Pakistani, I wondered, is it time for "Aman ki Asha". Though personally I am more opposed to the idea. Only the debate has now intensified within me.