iPod Touch Headset Test

overview hero 20090224 iPod Touch Headset Test

(pic. courtesy © 2009 Apple Inc.)

Almost a month and a half back, i bought a new 2nd Gen. 8GB iPod Touch. Well i have to say that its one handy device and i look like a star (or atleast i feel so), given the fact that i mostly come in contact with people whose knowledge of technology is as good as my knowledge of politics.

On the internet you’ll find all sorts of tests that people do on the unsuspecting iPod, iPod Touch, iPhone etc. But did you really care to test the headset. No! none of them really did any of that. I’m into QA (quality assurance) and though my testing of the iPod headset wont do me any good. Also any expenses involved has to be from my account. No one will ever ever fund something like what i did…

Disclaimer: This is a seasoned experienced tester. Experiments like this can leave you broke. Please do not attempt this at home.

Cost of a brand new iPod headset – Rs 1’600/-

I didnt care to buy a new one. I just used the one that they shipped with the iPod.

Steps :

  1. Place the headset in a shirt pocket, preferrably with a button on top, so that the test-material a.k.a headset doesnt drop off
  2. Soak the shirt in a half a bucket of water, with 2 spoons of detergent ( Yes!!!)
  3. Wait for 12hrs
  4. Take the shirt (with the headset in its pocket) and dump it into a washing machine along with other clothes and do a dirt-run.
  5. Wait 1hr
  6. Pretend that you forgot about the clothes and the headset in the washing machine and wait for 1 more hour
  7. Take the clothes, put them to dry

Now, take the headset out, wipe it clean, give it CPR, plug it into the iPod and play ….

IT WORKS !!! icon biggrin iPod Touch Headset Test and here it is ladies and gentlemen, the headset that made it through, resting on my laptop

image 048 300x225 iPod Touch Headset Test

“Tweet This” for Blogger Blogs

I had migrated out of blogger in 2007. Reasons for which i’m not quite sure of. One thing that attracted me in WordPress is the availablity of plugins and the ease with which i was able to work with the php code. So when i had to do a ‘tweet this’ link for each post on my blog all i had to do was write this at the right place -

    <a href="http://twitter.com/home?status=Now reading <?php the_permalink(); ?>" target="_blank">
        <img src="http://jerrymannel.com/blog/wp-content/themes/SIM4.0/images/s-to-twit.jpg"
        style="border:none;">
    </a>

So yesterday, i was lazing around in the evening after a visit to the local library, one of my friends called. She was a smart-enough-techie for a business student. The only chick i knew who owned a Mac (i was so ready to dump all my girl-friends for her, coz she had a Mac. But her boy-friend owns an Audi so she ruled me out. 150cc Pulsar DTSi doest really stand a chance against an Audi). She had she blog up on blogger. Her problem how to get a ‘Tweet This’ link for each and every post on her blog.

I just dropped everything i was doing (nothing much infact) and got down to crack the problem. And this is how its done.

First get the full code for the .blogspot.com site that you have by navigating to Layout -> Edit HTML page. Check the “Expand Widget Templates” and copy the content of text area and back it up.

Next check the code that you have in had and make sure that its not the Classic Theme code. Just scroll and see you dont come across anything like <$BlogItemXXXXXXXXX$> in it.

Just like WordPress, blogger also loops and adds the blog entry(the simplest logic). So find a tag like <b:includable id=’post’ var=’post’>. This is the start of the section that will genrate the post-title, post-content, date-of-publishing, labels, etc. and similar miscellaneous information.

Now to add a “Tweet This” link to the each post use this code -

    <a expr:href='&quot;http://twitter.com/home?status=Now Reading -&quot; +
    data:post.title + &quot; &quot; + data:post.url' target="_new">
        Tweet This
    </a>

Depending up on where you are going to add that piece of code, you might have to add the necessary tags and define the properties. For eg. if you want the “Tweet this” link to be like the way its there at – http://jerryreghunadh.blogspot.com/ – this is the code that you need to add at the footer section :

    <div class='post-footer-line post-footer-line-2'>
        <span class='post-labels'>
            <a expr:href='&quot;http://twitter.com/home?status=Now Reading -&quot; +
            data:post.title + &quot; &quot; + data:post.url' target="_new">
                Tweet This
            </a>
        </span>
    </div>

Thats it. I guess this fixes the problem for you too icon smile Tweet This for Blogger Blogs

 Tweet This for Blogger Blogs

Mailing and Telneting with PERL

There are many tutorials on the net on how to use the Net::Telnet module to write a script that will automate a telnet session. Perhaps the best place is the CPAN site itself. Though all i needed was a simple script that did the job, i had to scour through many other sites for reference. Finally i’m done with the script that will telnet to the server collect the logs and then mail it to the id that i specified.

I wrote the working version as two perl scripts. I still dont know why i did that, may be for the simplicity sake.

  • log.pl  => does the telnet to retrieve the logs and mail it to me
  • run.pl => which runs the log.pl every hour

So here is the code -

log.pl

#!/usr/bin/perl
use Telnet;
# ---------------------------
$date = `date`;
chop $date;
$mailId = "jerry\@jerrymannel.com";
$cmd = "cat in.log | mail ".$mailId." -s \"Logs - ".$date."\"  ";
# ---------------------------
$host = "192.168.1.100";
$port = "2300";
$uid = "jerry";
$pwd = "password";
open $inputLog,  ">in.log";
$box = new Net::Telnet();
$box->open(     Host => $host,
                Port => $port,
        );
$iLog = $box->input_log($inputLog);
$flag = $box->login(    Name => $uid,
                        Password => $pwd,
                );
$box->print("co");
$box->waitfor('/# $/i');
$box->print("show load;show cpu");
$box->waitfor('/# $/i');
$box->print("show log");
$box->waitfor('/# $/i');
$box->close;
# MAIL section
system $cmd;
exit

run.pl

#!/usr/bin/perl
while (1)
{
        $date = `date +%M%S`;
        chop $date;
        #print $date." - ";
        if ( $date eq "0000" )
        {
                print "Sending the mail @ - ".(`date`);
                system("./logs.pl");
        }
        sleep(1);
}

The script was run on a Linux machine. So i neednt worry about the ‘date’ command and getting the date printed out in a fashion that i needed.

icon smile Mailing and Telneting with PERL Drop in a line of you have more queries on the script. Always happy to help.

Telnet Scripting Tool a.k.a TST10.exe

I have been thinking for a long time that i need to write about this tool that i found. Its quite interesting that this tool is really helpful in automating many of the routine sessions that i as a tester came across. This is by far the best automation tool that i found for telnet sessions.

Imagine these scenarios :

  • You need to do BSO authentications frequently when you switch networks
  • Get intermittent logs from the server for analysis
  • Run automated tests on remote systems (something which i have started to call as run-and-forget)
  • stuck in traffic…no way

Lets get into what this tool is and how to use it.

The tool is for windows (one of the things that i felt bad). To make use of this tool, u will need the exe file, i.e., tst10.exe and an input commands file. The input file will has the first line as the hostname/IP and port, which is followed by alternating SEND and WAIT commands.

Consider this example. I need to connect to a server of IP – 192.168.1.100, where a telnet service is running at PORT – 2300. This is how my script/input file will look like :

192.168.1.100 2300
SEND "\m"
WAIT "login:"
SEND "admin\m"
WAIT "Password:"
SEND "admin1\m"
WAIT "s1#"
SEND "co\m"
WAIT "s1(config)#"
SEND "show load; show cpu\m"
WAIT "s1(config)#"

“\m” = \n in C/PERL/Java/most programming langunages = CR or in non-techie terms “Enter”. SEND, sends the commands to be executed and the WAIT that follows tried to match the string in the output of the SEND commands before it.

How to run it?. There are 2 ways to do it. You can open up the command prompt navigate to the directory where the files are and then issue this command -

tst10.exe /r:IN /o:OUT

where IN is the input file and OUT stores the complete output of the session, so that you can skim through the file and have a look at what happened. OR, put the command in a batch file and double click it every time you need to run it.

Here is the screen capture -

tst10 Telnet Scripting Tool a.k.a TST10.exe

TST10 Screen Capture

How is it different from Net::Telnet module of Perl or something similar in TCL or Python? Think about it.

  • Time to write the code – 30min to ? depending upon how complex the situation is
  • Trying to match the output to with REGEX, which means that you need to spend time in coming up with the right regex. Now you have 2 problems in hand
  • Testing time to make sure that the script is robust enough

So this is perfect! NO. This doesn’t work for ssh sessions. Since telnet is getting substituted by ssh in most of the servers due to the secure nature of the connection its kind of difficult to fit it in a normal installation of Linux. I’m not sure about the telnet-ssh thingie happening in Solaris or any of the other servers.

Is there something like this for Linux? icon sad Telnet Scripting Tool a.k.a TST10.exe No. Hey, but look at it this way. Its some relief for us on windows platform for scripting.

You can build complex automatons with this combined with a little bit of Perl and Outlook. Here is one typical scenario that i made and which i have presented as a white-paper.

  • Outlook has a setting that detects for incoming mails with a specific subject line.
  • When the mail comes it evokes a Perl script.
  • The Perl script will go ahead an call the TST’s batch file, which initiates the TST10 session, connects to the remote server starts/runs the automation. The output will be stored in OUT file
  • The Perl script will skim the OUT file for any errors reported during the run.
  • Then it calls an FTP script that will go ahead and get the log files from the remote system
  • The log files are read, the results extracted and neatly formatted into mail and send to the required email-ids

icon smile Telnet Scripting Tool a.k.a TST10.exe sounds complex, but this script gave me enough time to hut for a new job and quit the previous employer.

Who wrote this? Someone by the name of Albert Yale. His home page is – http://ay.home.ml.org/, sadly the site is no longer online.

What happened to the white-paper? It got rejected icon wink Telnet Scripting Tool a.k.a TST10.exe , humor was not the order of the day.

Download TST10 : tst10.exe | tst10.zip