The New Look and Year 2009

Phew!!! .. Yes Phew. Its the first word that i chose to start the first post of the new year. Well technically new year was almost a month ago, still from the ‘first post of the year’ point of view, its still new year. Oh crap, that line was awfully jumbled up. Hey but i dont mind that line being like that, i dont want to read through that line again and then rephrase it and make it more vivid. No i dont want to do that.

So what happened? I took my blog to the drawing board. 25th Dec ’08 christmas eve, i decide to redesign this blog. Though the previous design was very simple and required less than 3-4 hrs to come up with, this one took nearly 4 weeks. Shit! that was like a month.

Made a sketch of it on paper, then to photoshop, then back to the layout on paper, back to photoshop. I designed one layout and when i looked at the finished one, i almost puked. Then redesigned the whole thing and here it is the new look.

On paper this is how the design looked like

18012009001 300x225 The New Look and Year 2009

Then i decided to have the sidebar to the right. The first version on Photoshop looked like this and i hated it

v 1 246x300 The New Look and Year 2009

Then i struck the right note with this one.

v 2 300x292 The New Look and Year 2009

Then it was the wrestle with stylesheets and upgrading the then current SIM3.0 to this one,which i call SIM4.0. Lets talk about the changes,

1. Latest Twitter updates on the header – i basically took the HTML badge given by twitter and put the code there.

2. Sidebar will now sport the pages with a logo for each. I disabled the widget functionality of the sidebar.

3. The Footer -This is where most of the work went into. I mutated the footer to have 3 columns. Into these columns i can add the widgets. It was quite simple infact once i figured that out.

The main footer file is – footer.php. Each of the 3 columns are again separate php file. The main footer.php calls these files like this -

<?php include (TEMPLATEPATH . '/1-footer.php'); ?>
<?php include (TEMPLATEPATH . '/2-footer.php'); ?>
<?php include (TEMPLATEPATH . '/3-footer.php'); ?>

to make each of these accept widgets, this line was added -

<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(3) ) : else : ?>

The ‘dynamic_sidebar(3)’ made it sidebar-3 in the add widgets page. It was joy when i figured this out. I know i could have referred the WordPress manuals. But then i wont get the joy of discovering things.

4. My CSS is split into two. Why? One for all the browsers and one for IE. I officially label IE as a pain. This is what i observed. An image was to the left in Firefox, but to the right in IE. “margin-left:100px” put something in the middle for Firefox and at the page boundary in Internet Explorer

Any way after all that pain, now i have the site up with the new look and it feels GREAT!!!

Happy New Year Guys…

- xxx Jerry -

Mallu in Delhi – Part 2

December 19, 2008 …

I didn’t expect to write this second part the very next day. But something really funny happened that i had to write about day 2.

After taking the session to a crowd, that enrolled itself for the advanced training, for something that they didn’t know, i was quite exhausted. Every time i finish a slide i’d ask them, “Did u guys understand that?”. They all will then have that look like Katrina Kaif just asked them out. Interestingly the only girl in the session, was trying out the student exercises and was cursing big time – “Yeh, kitna ghatiya system hai…”. With all that, i needed a break.

I decided to walk it up to the guest house. After all it was just a 15 min walk from the office. Got out to the main road and got on to a cycle rickshaw. I was told by my friend from Delhi that one of things to try out in Delhi was to take a ride in one of the cycle rickshaws. Hopped on to one of them and as i was nearing my guest house, i changed my plan.

(translation of my conversation with the rickshaw guy)

“Do you know any shopping malls near by..”

“Yes sir”

“Can you take me there?”

“Ok”

So he started peddling. On and on and on. On the way i see one Grand Mall, he didn’t stop there. Then i see a Mega Mall. he didnt stop there either. I asked him why he didn’t stop any where there? He replied that he will take me to a better place. 20 minutes into the ride i end up in a place like the BDA Complex in Bangalore and there was a big red board on top of that building and on it was written in white Arial Bold font – “DLF Shopping Mall”. Yes! he took me to a building named shopping mall. I just couldn’t stop laughing at myself. Paid the rickshaw guy and walked back to Mega Mall. All the way laughing at myself.

So if u ever end up in Delhi/Gurgaon/any NCR region, dont ask for shopping malls. Just ask for ‘malls’. I must warn you, if u cant say ‘mall’ with the ‘o’, and can only say that with an ‘a’; Oops! My advice – stay at home, Delhi is not the place for you. Or may be if you are lucky enough the mall can get you to a place full of ‘mall’.

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.

En Route to Office…

Its a beautiful Monday morning … YAWN!!!!!!!!

I dont want to talk about Monday mornings. Like all other Monday mornings, today i was late to get up, slept through the ‘wake-up’ time.

Today i found something that was my time-pass to the way to office in the morning. With all the damned jams and slow moving traffic, these were real amusing…

  • An auto that had no inch left to be decorated with multi-colored stickers, looked like a Pharaoh’s 21st century ride
  • Every damn guys is late and its jammed
  • The chick behind the bike always looks cute on a Monday morning and her beauty-quotient drops as we move to Friday
  • This applies to all the days – 80% of chicks riding a 2-wheeler wear a jacket with either/both the shades of Blue / Red. Its like their universal code.
  • On any given working day, the average body area of a lady covered with clothes, scarfs, helmet etc. etc. beats that of a lady from Taliban lead Afghanistan.
  • The BMTC bus jams the road at exactly the same spot every Monday

and i’m always half crazy on Mondays…

(This post was done on August 19, 2008 at 1:35 am, which is a Tuesday…)

What Happened… What’s going on …

A month away from blogging and all active online activity. There has to be some valid reasons, right!!!

Of lately i was going through some strategic, that’s right ‘strategic’, changes in life. Both in my career and my personal life. No you dumb ass, i didn’t get married nor did i get engaged. Definitely i’m not having a break-up / patch-up nor did i find someone. Why does people have to think that “its that” when i tell them that i had some major personal life changes and i’m being responsible these days.

Career vise, i quit my previous employer and joined a BIG BIG BIG company. Currently working in a very cool environment, where they practically let you do anything. My kind of work. The confidentiality nature of the project that i’m working right now is such that, i have no idea what i’m doing… icon smile What Happened... Whats going on ... . AND the best part, they gave me a T61p ThinkPad to work. Now that’s whats called super cool!!!!

Ok now on the personal life side – i bought a flat in Bangalore. Ok, close your mouth, its not something to eat. Why cant a guy with ’0′ savings buy a flat. So soon, within a 2 month time, i’ll be moving into my new adobe. All are welcome to party anytime. Already the booking list is out-of-bounds.

logo What Happened... Whats going on ...In other news… i’ll be flying to delhi on the 26th of this month. I’ll be talking about blogging and its business side at Birla Institute of Management and Technology, Noida, as part of Mutiny’s evangelism initiative. If any of you BIMTECH-ers are listening, i just started preparing the slides. logo BIMTECH What Happened... Whats going on ...27th i’ll be in Delhi, roaming around with my friend Anina. So anyone from Delhi, other than Anina, who knows me (sorry i’m too bad at names and remembering where ppl are from) drop in a word we can meet for sure.

And i hope i can remain active online for quite some time now…