3 reasons for going online backup

April 9th, 2012By WaikhomComputers/Internet

This is the time of cloud computing and nobody’s keeping their backup in a hard drive or local device. Everybody’s going the cloud way. But if you are still not comfortable with the cloud thing, here are three reasons why you should choose to back up your data online.

  1. Accessible anywhere and with any device:- With the availability of cheap internet connection, we now have internet connections in our computer, notebook and mobile devices. With internet connection in all these devices, online backup makes it easy to sync data across all devices and access data from any place. With these possibilities, there are various ways to sync your contacts, mails and other data across multiple devices. Would you still prefer the old way of ad hoc connection and syncing between these devices?
  2. Crash/Risk free:- With numerous cloud services on the internet, crash protection and recoverable backup has never been easier. Imagine having a hard drive as a backup device and the hard drive itself is corrupted. Cloud services help you avoid these risks by maintaining multiple versions of your backup.
  3. Secure & Easy:- When you backup your data online with trusted cloud services, your data is protected and secure with latest security technologies. You cannot secure your hard drive from malwares or other malicious softwares unless you are a hacker.

Well, these are not the only advantages of online backup. How will you protect your data against natural disasters, children, loss, thefts, etc.? Does your tape even work? Time has changed from the age of computers to the age of clouds. People are moving rapidly into the cloud world. Every person has more than one digital device and is using clouds knowingly or not. Having said that, would you rather use your personal email service or the simple and easy to use GMAIL. Still not convinced? Think about facebook.

How to read the attribute of an xml node in unix?

January 10th, 2012By WaikhomComputers/Internet,Linux,Programming

In unix/linux, you can accomplish so many things which would normally require programming languages in other operating systems. The unix shell is such a powerful tool that almost every bit of automation is possible in unix. So, when it comes to automation, unix is my #1 choice. Today, I’ll share with you how to read xml attributes in unix.

PROBLEM

Although, there isn’t an in built library in unix for reading an xml attribute, there are several ways to read an xml attribute in unix. Some of them are complicated and some of them are too easy. Today, I’ll discuss one of the easiest ways to read the attribute of an xml node in unix.

COMMON APPROACHES

Before I come to the easiest one, I’ll point out some of the other ways to read/parse an xml but without much explanation. Here are some of the suggestions made by fellow unix users :-

  1. Using xsltproc: xsltproc is a unix tool for transforming xml into html/ other xml format by using xslt (stylesheet). This method needs the knowledge of xslt and might be a bit tricky and cumbersome. However, this method will have more accurate and less error prone results because of the use of an xml oriented tool
  2. Using awk / sed: awk or sed can be used in a somewhat tricky manner to read the xml attributes. This one is also sometimes tricky and a beginner might wanna avoid

THE SOLUTION – MY APPROACH

The way i read the attributes of an xml node in unix is quite easy and can be used effectively for many attributes but with one drawback. This method cannot be used to read attribute values if there are multiple attributes with the same name. Otherwise this method is very easy and very efficient.

Let’s consider an xml from which we want to read the attribute values.
e.g. item.xml

<root>
<item name="foo" value="bar"></item>
</root>

In the above example, we can read the attribute values of “name” and “value” by using the following unix command.

eval $(tr '[< >]' '\n' < item.xml | egrep 'name|value')

EXPLANATION

In order to understand the above command, let's break it down into small pieces.
First, let's consider the command "tr '[< >]' '\n'". This command is basically splitting the xml into lines. It replaces >< and spaces with new lines. In other words, the above xml will become:

root
item
name="foo"
value="bar"
/item
/root

Now, the piped command egrep 'name|value' does nothing but filter out all lines except the ones containing the name and value attributes. This way, the xml is now reduced to

name="foo"
value="bar"

Then we evaluate this string as unix commands by using the eval command so that their values are assigned to their respective variable names. And we can easily access the values of these attributes by using their variable names in the shell as $name and $value respectively.

How to automate file upload in Internet Explorer using Selenium?

January 8th, 2012By WaikhomComputers/Internet,Programming,Web Development

Selenium is the most popular framework for web browser automation. We use selenium for automating our UI test cases. Selenium works perfectly fine in most web browsers with the exception of the obviously most problematic “Internet Explorer”. Although most of the features of selenium work fine with internet explorer, there are a few hiccups particularly associated with Internet Explorer e.g. capturing Screenshot, file upload, etc. Here I’ll be talking about automating the file upload feature in Internet Explorer using Selenium.

In Firefox, you can automate file upload by simple using the “selenium.type” method over the file selector.

Selenium.type("/input[@name=image_file]");

However, the type method doesn’t work in Internet explorer because of security restrictions. Internet Explorer doesn’t allow you to change the value of file inputs through JavaScript. So, I did a little research on how I can automate the process in Internet Explorer. There seems to be a few solutions to this problem but none of them really solved mine because all of the solutions are for those who are not using selenium RC or are not using RC server in a remote machine. In my case, selenium RC is located in a remote machine and all my java classes in a separate controller machine. This makes it difficult to invoke autoit scripts as it is mentioned in most of the available solutions. Some of the methods I tried are:

  1. Using selenium.attachFIle: Selenium has an api for automating file uploads and is provided as the attachFile method. However, this method is supported in Firefox only and doesn’t work with Internet Explorer.
  2. Using native keys to type in the characters: Selenium RC has apis for generating native keyboard events. This method can be used to automate keyboard events in the OS level and outside the web browser. I also tried this in Internet Explorer, but once I click the browse button and the file selector popups, selenium gets blocked and the keys could not be typed without manual intervention
  3. Using AutoIT with Selenium: One most popular method of automating the file upload is to use an autoit script in conjuction with selenium. However this also had it’s own problem. I couldn’t invoke the autoit script from my test script as I was running selenium RC in a remote machine. I found another interesting post about this method here – http://automationtricks.blogspot.com/2010/09/how-to-upload-file-in-selenium.html

THE FIX

After a series of trials, I could finally automate the file upload scenario in Internet explorer. The fix was to upgrade my selenium from 1.x to 2.x (or webdriver). Unlike selenium 1.x, webdriver is not javascript driven and is not as restricted as javascript driven selenium 1.x. However, upgrading from 1.x to webdriver was a mess because all my test cases were then not working as expected in firefox. So, i did a little hack here to make sure web driver is used only in case of Internet explorer. Given below are the changes I made.

Before:

DefaultSelenium selenium = new DefaultSelenium("localhost",4444,"*iexplore","http://www.example.com");
selenium.start();

After:

WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),DesiredCapabilities.internetExplorer());
DefaultSelenium selenium = new WebDriverBackedSelenium(driver,"http://www.example.com"));

With this code change, we are now using web driver backed selenium, and because of this, the selenium.type method can be used without any security restrictions. As a result, my file upload automation was run successfully. Well, thanks to those guys working on web driver.

In fact, many of the limitations of selenium 1.x have been addressed by web driver and there’s a properly documented section on migrating selenium 1.x to webdriver. If you are facing any issues with selenium 1.x, you might try upgrading to web driver. More details on the upgrade process are available here – migrating from selenium 1.x to web driver. Well, if you find anything interesting, feel free to share it here.

How to prevent/disable javascript error popups in internet explorer while running Selenium tests?

January 6th, 2012By WaikhomComputers/Internet,Windows

Today, I was trying to run some selenium tests on Internet Explorer 8 and got another “This is why I hate Internet explorer” problem. All the selenium tests work fine in Firefox but as soon as I started running them in Internet Explorer, lots of javascript error popups started coming up. The popups were blocking the selenium tests and there was no way I could prevent those popups. In fact, this trivial problem blocked me for a day and was driving me crazy. And when I got through it at last, I thought what the fuck? I won’t let this stupid thing waste someone else’s time again. That’s why I’m writing this post so that you don’t get stuck like me again.

Well, it started with me migrating my selenium tests to webdriver. I had to migrate to webdriver (selenium 2.x) from selenium 1.x because file upload doesn’t seem to work properly (again in Internet explorer) with selenium 1. That leads me to another post – How to automate file upload in Internet explorer using selenium? But that’s another day. For now, let’s focus on preventing those javascript error popups.

How to prevent/disable javascript error popups in internet explorer?

It seems there are lots of information out there in Google on how to prevent / disable javascript error popups but none of them really worked for me. Some of them are simple settings change in IE but for some reason, all those instructions didn’t help me in any way. But finally, I got this worked when I reset the IE Settings. So, here we go all the steps I followed in order to disable those freaky javascript popups.

  1. Disable script debugging – I tried disabling the script debugging option with no use. Well, if you want to, you can disable script debugging by opening Internet Explorer -> Tools->Internet Options -> Advanced and checking the “disable script debugging” option there.
  2. Disable JavaScript error notification (both manually & using Microsoft fixit) – I tried this too but in vain. You can disable the error notifications by going to Tools->Internet Options -> Advanced and unchecking the “Display a notification about every script error” option. Or if your don’t want to do it manually, you can use the Microsoft fixit wizard available at http://support.microsoft.com/kb/822521 or follow the manual steps there
  3. Reset IE Settings – This was the last resort and it did solve the problem. The downside is that all IE settings are lost and you might not want it. But as I said, if the above steps didn’t work and you are ready to lose your IE settings, you can reset the IE settings to disable/prevent those crazy javascript errors. Well, you can find more info on the resetting procedure at http://support.microsoft.com/kb/923737/ln.

Well, with these steps, I was able to get rid of those annoying popups. If you are facing this issue, try these out and let me know the results.

Macbook Pro Unibody

October 27th, 2011By WaikhomComputers/Internet,Electronics/Gadgets,PC Hardware,Video Posts

One of the unique features of the macbook pro is the unibody. The enclosure of the macbook pro is made from a single block of aluminium and is called the unibody. This makes the body light, strong and smooth.

One thing that I like the most about apple products is their finishing. And in this case also, the macbook pro displays a symbol of delicate and super smooth finishing touch. Although I haven’t got one of these macbooks, I’m really in the mood to get one. And I’m sure I’ll buy one soon enough. Also, below is a video on the unibody and is worth watching.
YouTube Preview Image

Kontera and slow wordpress

October 24th, 2011By WaikhomComputers/Internet,Web Development

For quite some time, my blog has been slow and I finally got the time to sort this out. Using Firebug, I analyzed the page response times of all requests made while opening my homepage. And surprisingly, the kontera ad code that I added seems to be taking a lot of time. So, I just removed the ad code and tried refreshing my page and then …oorah.. My blog is loading faster than ever before.

But then, what about the bucks I get from kontera? I went to their site and just checked my last quarter earnings and it was pathetic. Who’s gonna sacrifice the speed of their blog for a few bucks a quarter. Maybe i’ll try something like infolinks but not kontera. Not anymore. Well, if you have kontera and your blog is taking too much time, removing the kontera ad code is the first thing I’ll suggest you to do. And after that, you can start looking for “i like taking time to load” plugins in firebug.

Hideipproxy.com – A classic php based SSL Proxy

May 20th, 2010By WaikhomComputers/Internet,General

Out of the thousands of web based proxies available for free, only a few are reliable and good. If you click at the proxies listed at proxy.org, you will find a useful proxy in around 20 proxies. And that single proxy that you found will most probably be overloaded and too slow for browsing your favorite sites like myspace, facebook, etc. This is because, most of the web proxies are hosted on cheap proxy hosting companies where proxies are overloaded. A single server will have some 50-100s of proxies which when overloaded will not only mess up their servers but waste your time. In fact, these proxies are so overloaded that when you try to browse a 50K sized website, it takes minutes. If it was me, I would get frustrated and never visit that proxy site again.
Hide Ip
But there are few proxies which are good and reliable. Some of them are daveproxy.uk, ninjacloak.com, etc. Imagine, these proxies have been running for more than 2 years. These are not like the “create a proxy today and discard it next week” type of web proxies. These are considered premium proxies and users are loyal. I would always remember the names of such proxies as if I had to think of a good proxy. Besides, these are free proxies, not like proxify and all. You’ll surely love it once you get your hands on it.

However, these are old proxy sites and must be already blocked by almost 99% of network filters. So, you need a new one but as reliable and good as these. Well, the new one is hideipproxy.com. Hide Ip is only a few weeks old and is still a new proxy which leaves it unaware to many of the network filters. It is fast and not overloaded. It runs on a 1GB dedicated Intel dual core server and has lots of bandwidth to accommodate its users. It supports SSL or secure browsing. And not like those quick proxies which get expired tomorrow, this proxy was created with the same intention as those of the premium proxies mentioned above. So, start using it, tell your friends and share it with everyone as you enjoy the surfing.

Recent Photos

DSC04900DSC00584DSC00583DSC00580DSC04898DSC00492DSC00339DSC04828