How to find location where Perl Module is installed

I often peek into Perl Module source code to add debugging logs, or to find or narrow down problems. and have to spend sometime always to find where that module is installed.

Following script was implemented to save me sometime:

use strict;
use warnings;

my $package = $ARGV[0];

my @arr = split('::', $package);
my $packagePath = join('/', @arr);
foreach my $path (@INC) {
    if(-f $path."/".$packagePath.".pm") {
        print "$package found at: $path/$packagePath.pm\n";
        last;
    }
}

e.g.:

-bash-3.2$ perl findPerlPackage.pl Net::SSH2
Net::SSH2 found at: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Net/SSH2.pm

Posted in Linux, Perl, Programming

Installing Net::SSH2 on Cent OS

We have struggled with this too, so will share the minimum steps needed to setup Net::SSH2 lib on Cent OS:

  1. Install pre-requisite libs:
    • sudo yum install libgcrypt-devel
    • sudo yum install zlib-devel
  2. Download libssh2 source code from here.
  3. Untar and cd to the extracted directory.
  4. Execute: ./configure — This will verify availability of packages installed in step 1 and write Makefile.
  5. Execute: make — This will compile the libssh2 source code.
  6. Execute: sudo make install — This will install libssh2 shared libs at /usr/local/lib
  7. Execute: export LD_LIBRARY_PATH=/usr/local/lib
  8. Download Net::SSH2 library source code from CPAN.
  9. Untar and cd to the extracted directory.
  10. Execute: perl Makefile.PL gcrypt
  11. Execute: make
  12. Execute: sudo make install

This should be all for installing Net::SSH2 lib on Cent OS. Incase you face any issues, please leave a comment, and we will try to help.

Note: The above has been tested successfully against Cent OS 5.6 image.

Posted in Linux, Perl

Specify output file using wget

wget can be used to download file from any server. However everytime you execute the command, it saves the copy of file instead of replacing the file if already exists.

wget provides a flag that can be used to download the file to a specific location:


wget -O <OUTPUT_FILE_NAME> or wget --output-document =<OUTPUT_FILE_NAME>

Word of caution: Use of ‘ -O’ is not intended to mean simply “use the name file instead of the one in the URL;” rather, it is analogous to shell redirection: ‘ wget -O file http://foo ’ is intended to work like ‘ wget -O – http://foo > file ’; file will be truncated immediately, and all downloaded content will be written there.

Posted in Linux

Google releases ‘Account Activity’ product

How many times did you used Google.com in last few days? What all you tried to search? Whom did you sent [and received from] the most emails? Where all your account was accessed and using which all browsers?

Phew ! A long list of questions isn’t it? However answer is not !!

Google released a new product to help users track there own activity on different Google products. Using the product, you could easily figure out relevant details as the percent increase in time spend on your email, and the activities performed on your account.

Out of all, I found following two particularly important:

1. The details of locations from where you signed into your Google account, and
2. If there were any authentication changes done to your account.

Now consider the scenario that your password was compromised and someone [your wife? your boss?] is keeping the track of your emails from some other location, you can trace it out using your account summary.

This can really spice up the internet space if Google provides the domain administrators to monitor the reports for everyone using their domain email address. However it remains to be seen from the legal perspective.

Google always keep surprising with the products, however this product is seen as a launch which is crucial keeping in mind the recent privacy policy changes introduced by Google.

Posted in Google

Apple employees already surfing web using iPad 3 on iOS 6 ?

This is the big questions making round of internet these days with no concrete answer if this device caught by ars technica in their server logs is actually iPad 3 or not.

With only 3 days left for the big event which everyone, around the world, is lined up to see, this finding just took the excitement to further heights. As can be seen in the server logs clearly the requests to the server came from iPad and running an OS version 6.0 [which by the way is scheduled to be released atleast a couple of months from now].

As an update to the article, ars technica rightly pointed to the fact that hits to the servers coming from the said resolution are not necessarily coming from the same iPad’s running iOS 6. [Which I think they could have confirmed by digging little more with server logs]. However with these unconfirmed reports it is left to the imagination of the user to dream of iPad 3 being launched with all the features he ever wanted and have the fingers crossed until new iPad is made available on stores to grab.

Tagged with: , , , ,
Posted in Apple, Gadgets

Aakash’s manufacturer ‘Datawind’ receives ‘Most Innovative Mobile Company’ award from UK government

British Indian firm ‘DataWind’ won the nations most innovative mobile company award from UK government. UK Trade & Investment (UKTI) that started its search for the award recipient in 2011, is a government department that helps UK-based companies succeed in the global economy.

Montreal based Suneet Singh Tuli, CEO of DataWind said, “We are honoured to be recognised; it is a great validation of our vision and I hope this will help create greater impetus for UK innovation.”

Aakash which is an Android device with a 7-inch touchscreen, 3-hour battery life, and 32 GB of storage is available starting at $35 for students and has been making headlines in India ever since Indian government decided to purchase 1 Lakh units of the device to school going children and further hopes to purchase upto 50 lakhs devices in current year.

Datawind had been in news for wrong reasons also, dealing with the claimed poor quality of the Aakash. Problems such as low memory, frequent system freezes, poor sound quality, absence of support for all formats were raised by the users.

After receiving feedback of the early release model from over 500 users from educational institutions, DataWind announced the next iteration that will have a new microprocessor of 700 MHz versus the original 366 MHz processor and that will ensure the user’s concerns are addressed.

Posted in Gadgets

Gadget to ‘Shut up’ the person on receiving end

How many times it has happen to you that you want the person speaking in front of you to just ‘SHUT UP’, but could not say that just because it can hurt him?

It has happened with me in past and I am sure must have happened with many of you out there. So finally here is gadget that will LITERALLY shut the person up.

The research paper as published by Kazutaka and Koji Tsukada suggests that this gadget can be used to silence a person sitting up to 30 meters away from you.

“In general, human speech is jammed by giving back to the speakers their own utterances at a delay of a few hundred milliseconds. This effect can disturb people without any physical discomfort, and disappears immediately by stop speaking.”

The device works by recording its target’s speech then FIRING their words back at them with a near to 0.2-second delay, which affects the brain’s cognitive processes and therefore causes speakers to stutter little bit before silencing them completely.

The device is said to be working better when the speaker is reading aloud and doesn’t work on people making just useless noise like “ahhh”. The researchers suggests that this device can be used for silencing people making noise in public library and in group discussions where people normally try to interrupt the person giving speech.

Tagged with: , ,
Posted in Technology

ITA software finally takes off with Google on the pilot seat.

Ever since ITA software was acquired by Google in 2010, speculations were on about Google intent behind this acquisition. Over the last weekend, Google made its intentions public by launching complete flight management system for Cape Air.

The ITA team had been working on the software for almost a complete decade and this launch came almost half-a-century years after the first launch of flight management system based on mainframes which powers most of the flight reservation system. [Atleast till the date this post was published ;=) ]


The new platform provides power to manage complete passenger airline workflow that includes reservation of tickets, inventory control system, departure control system and much more.

The system’s modern user interface is surely going to please the users as we all know Google works on latest cutting edge technologies and how much it invests to ensure it is easy for the end users. The system is based on Linux and everyone linked with the industry is super excited about this launch. Some unconfirmed sources suggests the Dan Wolf, the CEO and founder of Cape Air quoting “This is the smoothest platform update I have ever seen and it is expected from a brand like Google.”

How much impact it will have on the existing players of the market, that remains to be unearthed but surely management in companies like Kayak software, Travelocity must be keeping very busy since this announcement.

Tagged with: , , ,
Posted in Google

Cars that will reduce road accidents to half the rate

Google Inc. has lately developed technology for cars that can drive themselves. These automated cars use video cameras, radar sensors and a laser range finder to “see” other traffic, as well as detailed maps to navigate the road ahead. This is made possible by Google’s data centers, which can process the enormous amounts of information gathered by manually driven cars when mapping their terrain.

The main aim of this research is car safety, efficiency, to help prevent traffic accidents, reduce carbon emissions by fundamentally changing car use and free up people’s time.

Automated cars, manned by trained operators, drove from Google’s Mountain View campus to Google’s Santa Monica office and on to Hollywood Boulevard. They’ve driven down Lombard Street, crossed the Golden Gate bridge, navigated the Pacific Coast Highway, and even made it all the way around Lake Tahoe. These self-driving cars have logged over 140,000 miles. We think this is a first in robotics research.

According to the World Health Organization, more than 1.2 million lives are lost every year in road traffic accidents. This technology has the potential to cut that number, perhaps by as much as half. Self-driving cars will transform car sharing, significantly reducing car usage, as well as help create the new “highway trains of tomorrow.” These highway trains should cut energy consumption while also increasing the number of people that can be transported on major roads.

In terms of time efficiency, the U.S. Department of Transportation estimates that people spend on average 52 minutes each working day commuting. Now it is possible to spend that time more productively.

Google has gathered a team of the best engineers from the DARPA Challenges, a series of autonomous vehicle races organized by the U.S. Government. Chris Urmson, the technical team leader;Mike Montemerlo, the software lead;and Anthony Levandowski are a part of that team.

Although it appears, but these cars are never unmanned. They have a trained safety driver behind the wheel who can take over as easily as one disengages cruise control. They also have a trained software operator in the passenger seat to monitor the software.

While this project is very much in the experimental stage, it provides a glimpse of what transportation might look like in the future thanks to advanced computer science.

Hope this is informative for you and i would like to thank you for reading it.

Tagged with: , , , ,
Posted in Google, Technology

Setting up Selenium with Perl

Here are the steps to configure Selenium with Perl.

1. Download Active Perl from the link: http://www.activestate.com/activeperl/downloads
2. Install the Perl using the installer.
3. Download Selenium RC Server from link: http://seleniumhq.org/download/
4. Right Click on My Computer > Properties > Advanced System Settings > Environment Variables.
5. Add/Edit new User Variable ‘PERL5LIB’ to have following path added to it: ‘D:\Automation\selenium-perl-client-driver-1.0.1\lib’

D:\Automation\selenium-perl-client-driver-1.0.1 here is the path to directory selenium-perl-client-driver-1.0.1 which comes bundled as part of Selenium RC Server download.

6. Now open notepad and copy the following script in it and save it e.g. say: firstScript.pl

use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";


	my $sel = Test::WWW::Selenium->new( host => "localhost", 
                                    port => 4444, 
                                    browser => "*firefox", 
                                    browser_url => "http://google.com");
$sel->open_ok("/", "true");

pass;

7. Open command prompt. Navigate to path where you have downloaded Selenium RC Server.
8. Change the directory to selenium-server-1.0.3
9. Execute the command java -jar selenium-server.jar
10. Open another command prompt. Navigate to the directory where you have stored your script.
11. Execute the command: perl firstScript.pl and here you are. Your first script will execute successfully.

Hope it helps.

Thanks,
Rajat Jindal
Quicksilver1183.com

Posted in Perl, Programming, Selenium/Webdriver, Tools