Connect to FTP server through Windows Explorer


Im one of those guys who say we hate Windows. Its fair enough since we are developers and developing web and other applications on Windows does suck big time. But most of the time our hatred or abuse of Windows comes from ignorance. I left windows years back and started using Linux for development but now in my new job I am having to use windows to develop with the RhoMobile studio. And everytime I use Windows I find out some cool feature that I did not know it existed. Maybe this is an obvious feature for all you Windows users out there but I never knew you could connect to an FTP server right from Windows Explorer. I do this all the time from Nautilus in Ubuntu and I always wished things would be as simple as that in Windows. But I knew windows had a ftp client in it and I thought it can be accessed only via the command line.

Today I got frustrated with Filezilla and thought of using ftp.exe and I googled for some documentation when I found out that I could use Windows Explorer directly. All I had to do was just enter the server’s URL in the address bar and that’s it! So I typed ‘ftp://steve@ftp.myserver.com’ and it opened up a window to ask for my password and I could now browse the server through Explorer.

Neat is it not? So I learned a good lesson to not to blindly hate an OS or anything without properly using it. But at the end of the day Windows does suck for development unless you’re doing something with .NET ūüėÄ I use Powershell + Console2 and Sublime Text to make life slightly better.

Installing Ruby, Rails, MySQL and Apache on a fresh Ubuntu 12.04 installation


The first challenge I faced when I started using Ubuntu was moving my Wubi installation inside Windows to a separate partition. Thats when I understood how one should find his/her way around the problems they face using Linux. Linux has one of the biggest support base on the internet. You can find solutions to almost all problems you face in the web. The only thing you need to do is a simple and proper Google search and you’ll fix whatever problem you have in not time at all! But unfortunately many who are new to this whole idea find it really difficult using Linux. This is because they are completed immersed in and used to the way Windows works. And so whenever they face some problem in Linux, like a dependency issue, they call you or text you and ask you to fix their problems. Unlike in windows where you get generic error messages with an error code, Linux provides verbose details about the kind of error that has occurred. People must make use of this information to find solutions to their problems.

Okay enough said! When I started learning Ruby I wanted to install Ruby on my Ubuntu 11.10 installation. But I really didnt know that I already Ruby pre-installed! Not knowing this I started installing Ruby and I faced a lotta issues. I had no idea what was happening. Then I tried removing Ruby. Then after my failed attempts to remove Ruby completely I installed RVM. Then I installed a Ruby version via RVM. But then gems like rails etc just wouldn’t install. Me being a Linux beginner back then found it really irritating and annoying to the extent that I considered dumping the whole idea of learning Ruby. But the pure elegance of Ruby and the thirst to learn Rails made me keep pushing. Finally after two days I got Ruby and Rails working on my PC without re-installing Ubuntu :P. Since then I’ve made several Ruby and Rails installations on many computers. I faced a lotta issues, especially dependency problems when installing Ruby, Rails, MySQL etc. So I decided to write this post to tell those beginners out there, the stuff they would need to properly install Rails etc.
Continue reading

Skype listening at port 80!


I was working on adding a forum to Tech-Coders.com today and I started my WampServer to test it locally. Before that I was in conversation with a friend over skype and I left skype open. And as usual I opened up ‘localhost’ on my browser and to my surprise the default index.php of wamp didn’t show up! I knew for sure that I did not meddle with any of the configurations of Wampserver and it worked perfectly just days ago. I looked at the system tray and noticed that the Wampserver icon was in orange color meaning that server is not able to start.

I was¬†puzzled¬†as to why Wamp was behaving this way. I sought for help online and found that one of the main reasons for the orange indicator is that wamp couldnt successfully start its service on the HTTP port 80. So I assumed that something else is occupying it. So I ran a netstat and to my surprise, it was SKYPE! Omg! I never ever expected skype to be using port 80. I did some reasearch about this and found that skype intentionally listens on port 80 so as to by-pass firewall and other restrictions. Clever ūüėČ

Anyway, I promptly closed skype and restarted Wampserver and everything was normal again. And I also learned that you could prevent skype from using the ports 80 (HTTP) and 443 (HTTPS) easily by opening up “Options” from “Tools” menu. Then you need to navigate to the “Connection” section under “Advanced” and uncheck the checkbox that says “Use port 80 and 443 as alternatives for incoming connections”. Its as simple as that. Now you dont have to worry about running wamp and skype together. But there is also another solution. You could run Wamp as a windows service and thus it would be always started before skype. But I think the first solution is a better one particularly if you dont use Wamp very often.

Steve

Kubuntu anyone?


From what I saw with GNOME, its way too simple and most of the features have been hidden to promote simplicity. Well, after using Windows, using GNOME was way way too toy-like. Hence I decided to switch to KDE (Kubuntu) based on advice from a friend. I first thought I would have to remove Ubuntu completely and then install Kubuntu. But he said, its kinda easy to switch over to KDE without having to install ubuntu all over again. And the process was kinda easy. I just had to install the kubuntu-desktop package and reboot. And voila! I had both GNOME and KDE. The login manager allows you to select where GNOME or KDE must be used for the session. It was as simple as that.

Just use this command,

sudo apt-get install kubuntu-desktop

About 175 Mb will be downloaded and it will ask whether you want to use the KDE login manager or the default GNOME login manager. I liked the GNOME one, so I selected the default Ubuntu login manager (GNOME). And now the UI was more like windows and I finally found the font anti-aliasing option that I was searching for. The text rendered by the broswers were too blurry and gave me headaches. Windows uses clear-type to render fonts properly. After enabling it the fonts looked better!

Anyway from what I read online about differences between KDE and GNOME, If you’re a serious developer or a techie I’d recommended KDE. GNOME is like having advanced settings hidden in Windows. Not for me ūüôā

Cheers!

Correcting display issues in Ubuntu


I recently decided to start using Ubuntu inspired partly by an Open-Source mag that I read in my college Lib and partly by a friend on twitter who had a lot of great things to say about Ubuntu. So I decided to install it and I’m running Ubuntu 11.10 right now. And to be honest, it feels really great! But my start with Ubuntu was not necessarily an easy one. My display did not look proper because it was set at a lower resolution that the one Im used to with Windows. And the other problem I faced was my monitor went on flickering in regular intervals and that kinda frightened me. I’ve managed to solve these issues using help from the vast number of Linux and Ubuntu forums and after reading ’em I realized that 80% of the people face these issues. So I decided to write an article about this. Here’s how I fixed the issues… Continue reading

Getting to know the ‘hosts’ file…


We had a lecture on DNS today in class and I thought I’d write something about the built-in domain name mapping file present in all of our computers. This file is a very interesting one. You get a lot of uses from it and at the same time it exposes you to a lot of security threats. But before going into all that, here’s something for those who do not know what DNS is.

DNS stands for Domain Name Service or Domain Name Server. As we know every server in the internet is identified by an IP Address. But¬†in order¬†to access the websites running on those servers we usually use something called as an URL (eg. http://www.footyntech.wordpress.com) How does the router find out the ip-address of the server containing the resource addressed by the URL? This is where the DNS comes in. Your computer sends a message containing the domain name to a server called Domain Name Server which contains a database of domain names (eg. google.com, yahoo.com etc) and their corresponding IP Addresses. The DNS responds to your request and sends you the IP address of the requested domain name. This way your computer can know the IP address of any server using the domain name. When ever new domains are created the information is¬†propagated¬†across the internet and all the Domain Name Servers update their database to¬†accommodate¬†the new Domain. If you have tried hosting webpages before, you might have noted that some time is needed for your domain name to get mapped to your webhost’s server. During that time the information about your domain will be propagated to the DNS servers. So this is just a simple abstract explanation of DNS. Actually the system is much more complex but we need not go into that.

the hosts file…

So this hosts file is actually a plain text file that contains a local Domain name mapping table. It contains ip-addresses and corresponding domain names. And this file has a greater priority than the external DNS servers. So when you enter a domain in your browser, first your hosts file is consulted to check if you have a mapping for that domain, if so that specified IP address is accessed, or else you go for the help of external domain name servers. So this is the basic function of your hosts file. Lets take a closer look at the file itself.

Your hosts file will be located in the following directory if you are running Windows.

C:\Windows\system32\drivers\etc\

My apologies to the folks running other operating systems…. But I know some one who knows everything, and that person would be glad to help you find your hosts file. You can find him here.

Now go on and open that file using a text editor (like Notepad in Windows). It should look like this.

My Hosts File

Your hosts file may not look exactly like this but every hosts file is structured in the same way. The file itself is self explanatory. You’ve got the ipaddresses in one column and the domain name in the other. And btw, please dont read too much into the domain names given in my hosts file, we will come to that later. ¬†And 127.0.0.1 refers to your local computer. Its is called as the loop back address. So if you have any HTTP server running in your computer that server will be accessed if you go to 127.0.0.1. If you dont have a server in your computer then you wont be taken to any webpage.

This is how it works. If you type, say, reg.sorensonmedia.com , you will be taken to your local host (127.0.0.1) rather than the registration host of Sorenson. And ‘#’ character is used to comment out lines in the hosts file. When you install the OS for the first time you wont have any mappings here except for the local host. Now that you know what a hosts file is and how it works, lets see some tricks you can do with it.

playing with the hosts file…

You might have wondered why my hosts files has so many domain mapping. Well, the explanation might get me into a bit of trouble. But still, Im taking all risks! ūüėÄ just kiddin’. Anyway, we all love to use premium software for free and we have been taught to share stuff from age 2 and we all know “Sharing is Caring”. So when you share software, you need to have a mechanism to fool the vendor and we have many techniques for that. And most of these techniques block any attempts by the software to access the vendor’s server by routing them to the localhost so that they go nowhere and hence the software wont have any way of verifying the genuineness. Since I used Adobe Software shared my acquaintances on the web (hehehe ūüėČ ) I have the adobe entry in my hosts file.

Speaking of blocking, you can use your hosts file to block access to certain websites from your computer. To do this add the domain name to the hosts file and map it to localhost (127.0.0.1) You can also play tricks on your friends using this. You can mess up the DNS by mapping some websites to some other different websites like facebook to google, google to yahoo, etc. To do this fetch the ip address of the hosts. You can do this by running “ping hostname” as a run command (where hostname may be google.com, facebook.com etc) . So now add the IP address into your host file and specify the domain for which the IP address should be used. So to route requests for facebook to google, find google’s ip address and put the following entry in your hosts file

74.125.236.84           facebook.com

You can drive your friends crazy this way! The hosts file is not all about fun. This can be a serious vulnerability in your computer. For eg. A malware (virus, adware etc) may modify your hosts file and lock it so that your DNS would be totally messed up. Worse, it could route access to email websites and other websites to¬†phishing¬†websites that steal your passwords. The latter technique is called “desktop¬†phishing” . Id love to teach you guyz about it but it would be illegal to do so.

There are certain very nice uses for the hosts file also. Very often we get annoyed by irritating ads in webpages. We can easily block them without having to install Ad Block software (although I use one (adblock for Chrome) and its awesome!) What you have to do is add the ad server to your hosts file and map it to the local host. You might wonder how to find the ad servers. Fear not! There is someone who cares for you! Check this out!

http://someonewhocares.org/hosts/

This is a comprehensive hosts file that is updated almost on a daily basis with the latest ad servers, hijack websites and infected websites. You can copy the contents and put them in your hosts file and Voila! You should be ad-free!

Ah! I almost forgot. After you update your hosts file, the changes may not be reflected immediately. To get things working immediately you need to flush your DNS cache. To do this open command prompt and run the following command,

ipconfig /flushdns

You can also use the Run dialog box to use this command. And also you need to be the administrator of the computer to access and modify the hosts file.

What are you waiting for? Go play with your (or your friend’s ūüėČ ) hosts file!

Cheers,

Steve Robinson

“All Programs” empty in Windows 7 Start menu


I recently ran into a problem in my computer (Windows 7). I wanted to start Eclipse and as always, I opened up the start menu and started typing eclipse. On any other day, windows would show the Eclipse.exe even before typing the entire name. But that day nothing came up and I waited and waited and waited and finally some system files showed up. I was kinda surprised. I clicked the “All Programs” menu and was¬†totally¬†taken back! It was completely Empty! Ive never seen something like this before in my experience of using Windows 7. ¬†I thought my Programs folder was deleted somehow or some access privileges were revoked or something. I tried all I could and¬†couldn’t¬†come up with a solution to the problem. I gave up and today I was goofin’ around and I thought I’d open up my Programs folder under “Users” Folder to see if I can fix this. I found too many programs that I never use in that folder. I started deleting them one by one. Then I got bored and shut down by PC and later started it again and to my¬†surprise¬†all the programs came back to the All Programs menu once again!

It seems Window’s 7¬†doesn’t¬†like to have too many program shortcuts in the start menu. I¬†haven’t¬†done any research as to how many items it can hold. But I had nearly 80 – 90 items in that menu.

So if you have the same problem follow below steps to resolve it.

  • Open Start menu and right-click ¬†“All Programs” and select “Open” if you want to delete current user’s program shortcuts or “Open All users” if you want to delete shortcuts for all users.
  • Now in the ensuing Win-Explorer window delete the unnecessary program shortcuts.
  • Log-off and then Log-on again and now the start menu should be back to normal!
Note: Deleting program shortcuts from “Programs” folder does not delete the actual application. You can safely remove stuff from this folder without affecting the functioning of any of your applications.
Regards,
Steve Robinson