Sunday, September 20, 2009

Friday, July 10, 2009

Wise things to do this YEAR

Thursday, June 25, 2009

10 Deadly Sins of Negative Thinking

10 Deadly Sins of Negative Thinking

The way to overcome negative thoughts and destructive emotions is to develop opposing, positive emotions that are stronger and more powerful. - Dalai Lama
Life could be so much better for many people, if they would just spot their negative thinking habits and replace them with positive ones.
Negative thinking, in all its many-splendored forms, has a way of creeping into conversations and our thinking without our noticing them. The key to success, in my humble opinion, is learning to spot these thoughts and squash them like little bugs. Then replace them with positive ones. Youll notice a huge difference in everything you do.
Lets take a look at 10 common ways that negative thinking emerges ” get good at spotting these patterns, and practice replacing them with positive thinking patterns. It has made all the difference in the world for me.

10 Deadly Sins of Negative Thinking

1. I will be happy once I have _____ (or once I earn X).

Problem: If you think you cant be happy until you reach a certain point, or until you reach a certain income, or have a certain type of house or car or computer setup, youll never be happy. That elusive goal is always just out of reach. Once we reach those goals, we are not satisfied ” we want more.
Solution: Learn to be happy with what you have, where you are, and who you are, right at this moment. Happiness doesnt have to be some state that we want to get to eventually ” it can be found right now. Learn to count your blessings, and see the positive in your situation. This might sound simplistic, but it works.

2. I wish I were as ____ as (a celebrity, friend, co-worker).

Problem: Well never be as pretty, as talented, as rich, as sculpted, as cool, as everyone else. There will always be someone better, if you look hard enough. Therefore, if we compare ourselves to others like this, we will always pale, and will always fail, and will always feel bad about ourselves. This is no way to be happy.
Solution: Stop comparing yourself to others, and look instead at yourself ” what are your strengths, your accomplishments, your successes, however small? What do you love about yourself? Learn to love who you are, right now, not who you want to become. There is good in each of us, love in each of us, and a wonderful human spirit in every one of us.

3. Seeing others becoming successful makes me jealous and resentful.

Problem: First, this assumes that only a small number of people can be successful. In truth, many, many people can be successful ” in different ways.
Solution: Learn to admire the success of others, and learn from it, and be happy for them, by empathizing with them and understanding what it must be like to be them. And then turn away from them, and look at yourself ” you can be successful too, in whatever you choose to do. And even more, you already are successful. Look not at those above you in the social ladder, but those below you ” there are always millions of people worse off than you, people who couldnt even read this article or afford a computer. In that light, you are a huge success.

4. I am a miserable failure ” I cant seem to do anything right.

Problem: Everyone is a failure, if you look at it in certain ways. Everyone has failed, many times, at different things. I have certainly failed so many times I cannot count them ” and I continue to fail, daily. However, looking at your failures as failures only makes you feel bad about yourself. By thinking in this way, we will have a negative self-image and never move on from here.
Solution: See your successes and ignore your failures. Look back on your life, in the last month, or year, or 5 years. And try to remember your successes. If you have trouble with this, start documenting them ” keep a success journal, either in a notebook or online. Document your success each day, or each week. When you look back at what youve accomplished, over a year, you will be amazed. Its an incredibly positive feeling.

5. Im going to beat so-and-so no matter what ” Im better than him. And theres no way Ill help him succeed ” he might beat me.


Problem: Competitiveness assumes that there is a small amount of gold to be had, and I need to get it before he does. It makes us into greedy, back-stabbing, hurtful people. We try to claw our way over people to get to success, because of our competitive feelings. For example, if a blogger wants to have more subscribers than another blogger, he may never link to or mention that other blogger. However, who is to say that my subscribers cant also be yours? People can read and subscribe to more than one blog.
Solution: Learn to see success as something that can be shared, and learn that if we help each other out, we can each have a better chance to be successful. Two people working towards a common goal are better than two people trying to beat each other up to get to that goal. There is more than enough success to go around. Learn to think in terms of abundance rather than scarcity.

6. Dammit! Why do these bad things always happen to me?

Problem: Bad things happen to everybody. If we dwell on them, they will frustrate us and bring us down.
Solution: See bad things as a part of the ebb and flow of life. Suffering is a part of the human condition ” but it passes. All pain goes away, eventually. Meanwhile, dont let it hold you back. Dont dwell on bad things, but look forward towards something good in your future. And learn to take the bad things in stride, and learn from them. Bad things are actually opportunities to grow and learn and get stronger, in disguise.

7. You cant do anything right! Why cant you be like ____ ?

Problem: This can be said to your child or your subordinate or your sibling. The problem? Comparing two people, first of all, is always a fallacy. People are different, with different ways of doing things, different strengths and weaknesses, different human characteristics. If we were all the same, wed be robots. Second, saying negative things like this to another person never helps the situation. It might make you feel better, and more powerful, but in truth, it hurts your relationship, it will actually make you feel negative, and it will certainly make the other person feel negative and more likely to continue negative behavior. Everyone loses.
Solution: Take the mistakes or bad behavior of others as an opportunity to teach. Show them how to do something. Second, praise them for their positive behavior, and encourage their success. Last, and most important, love them for who they are, and celebrate their differences.

8. Your work sucks. Its super lame. You are a moron and I hope you never reproduce.

Problem: Ive actually gotten this comment before. It feels wonderful. However, lets look at it not from the perspective of the person receiving this kind of comment but from the perspective of the person giving it. How does saying something negative like this help you? I guess it might feel good to vent if you feel like your time has been wasted. But really, how much of your time has been wasted? A few minutes? And whose fault is that? The bloggers or yours? In truth, making negative comments just keeps you in a negative mindset. Its also not a good way to make friends.
Solution: Learn to offer constructive solutions, first of all. Instead of telling someone their blog sucks, or that a post is lame, offer some specific suggestions for improvement. Help them get better. If you are going to take the time to make a comment, make it worth your time. Second, learn to interact with people in a more positive way ” it makes others feel good and it makes you feel better about yourself. And you can make some great friends this way. Thats a good thing.

9. Insulting People Back


Problem: If someone insults you or angers you in some way, insulting them back and continuing your anger only transfers their problem to you. This person was probably having a bad day (or a bad year) and took it out on you for some reason. If you reciprocate, you are now having a bad day too. His problem has become yours. Not only that, but the cycle of insults can get worse and worse until it results in violence or other negative consequences ” for both of you.
Solution: Let the insults or negative comments of others slide off you like Teflon. Dont let their problem become yours. In fact, try to understand their problem more ” why would someone say something like that? What problems are they going through? Having a little empathy for someone not only makes you understand that their comment is not about you, but it can make you feel and act in a positive manner towards them ” and make you feel better about yourself in the process.

10. I dont think I can do this ” I dont have enough discipline. Maybe some other time.

Problem: If you dont think you can do something, you probably wont. Especially for the big stuff. Discipline has nothing to do with it ” motivation and focus has everything to do with it. And if you put stuff off for œsome other time, youll never get it done. Negative thinking like this inhibits us from accomplishing anything.
Solution: Turn your thinking around: you can do this! You dont need discipline. Find ways to make yourself a success at your goal. If you fail, learn from your mistakes, and try again. Instead of putting a goal off for later, start now. And focus on one goal at a time, putting all of your energy into it, and getting as much help from others as you can. You can really move mountains if you start with positive thinking.

Tuesday, May 19, 2009

बाबा खालिद बंगाली

Awesome forward. lol !

An energy saving bulb has gone - evacuate the room now



Danger: The new eco-friendly bulbs contain toxic mercury (picture posed by model)
Energy-saving light bulbs are so dangerous that everyone must leave the room for at least 15 minutes if one falls to the floor and breaks, a Government department warned yesterday.

The startling alert came as health experts also warned that toxic mercury inside the bulbs can aggravate a range of problems including migraines and dizziness. A leading dermatologist said tens of thousands of people with skin complaints will find it hard to tolerate being near the bulbs as they cause conditions such as eczema to flare up..

The Department for Environment warned shards of glass from broken bulbs should not be vacuumed up but instead swept away by someone wearing rubber gloves to protect them from the bulb's mercury content.

In addition, it said care should be taken not to inhale any dust and the broken pieces should be put in a sealed plastic bag for disposal at a council dump & not a normal household bin.

None of this advice, however, is printed on the packaging the new-style bulbs are sold in. There are also worries over how the bulbs will be disposed of.




Under new regulations for hazardous waste, councils are obliged to recycle them. At present, they should be placed in special bins also used for batteries at a council dump. But in future, councils will have to provide a collection service or install special recycling banks for the bulbs.

There are fears that without a proper dispo sal system, the mercury content could contaminate water supplies.

Independent environmental scientist Dr David Spurgeon warned yesterday: 'Because these light bulbs contain small amounts of mercury, they could cause a problem if disposed of in a normal bin.

'It is possible that the mercury could be released into the air or from land-fill when they are released into the wider environment. That is a concern, because mercury is a well-known toxic substance.'

And dermatologist Dr John Hawk, told BBC Radio 4's Today programme that some people already find it difficult to tolerate the fluorescent-strip lighting that is widely used in schools and offices, which works in the same way as the eco-friendly bulbs. He said: 'Fluorescent lights seem to have some sort of ionising characteristic where they affect the air around them.

'This does affect a certain number of people, probably tens of thousands, in Britain , whose ailments flare up just by being close to them. Certain forms of eczema, some of which are very common, do flare up badly anywhere near fluorescent lights, so these people have to just be around incandescent (old-style) lighting.'

Friday, March 20, 2009

Disable Quiz $hit Updates from Facebook

New Facebook is out! I think this time no one is exited about the release. You like it or not, you DON'T have a choice. There are many changes in the new version. The changes are so annoying that FB Suckz !. I am not going in the details about the differences here as I want to pass the useful information I know to get rid of the F#$&ing Quiz updates on your Facebook home page.

Under the assumption that everyone uses Firefox, get the Greasemonkey plugin for Firefox. Install the FB Block Quiz updates script from Userscripts. Open Facebook again and you are done. It doesn't work if you view older posts. Will try to find a workaround for it soon.
HTH ! Please post feedback and pass this on to your friends.

Sunday, March 15, 2009

Facebook and Twitter Updates

My Facebook and Twitter updates are now available on my blog. Keep Tweeting.

Saturday, March 14, 2009

Horn NOT OK Please

Bangalore is the Silicon capital of India. I have been living in Bangalore for almost 5 years now. The city has seen drastic changes in terms of the rise in population, pollution and decrease in awareness for social issues. I see Bangalore as the next Mumbai in terms of the bad things which can happen to a city.

World Health Day is coming up on April 7th. Government and the authorities would have made plans to reach out to the masses and convey the message. But, is anyone listening ? Mumbai attempted a "No Honking Day" last year on World Health Day. The campaign was successful not in terms of imposition, but was able to convey the correct message. This year Mumbai Traffic Police have launched a 10 Day No Honking Drive. There was an attempt to call for a No Honking day in Delhi but it fell on deaf ears.

There are campaigns like NDTV's Greenathon which created huge impact on the society, thanks to the support of NGO's and famous personalities. I read an interesting blogpost which calls for answers to some obvious questions which we encounter almost everyday. My concern is, if a drive is taken up in a particular city, why can't people get the message in other cities? Is it necessary that someone comes to your door every morning and explains you whats permissible and what's not ? We are moving towards 100% literacy soon, but I feel even if that happens the people will always be impatient. If this is the case, the Government should start measures right away to deflate the cities.
I would be happy if I hear from people, how we can launch such awareness campaigns in Bangalore and other cities.

PS - Do have a look at the Earth Hour Global Campaign.

Wednesday, March 11, 2009

100 miles on my Nike Bowerman shoes

Its been almost 5-6 weeks since I got my new Nike Bowerman series shoes. The shoes are specifically designed for extra cushion, thus having least impact when your foot hits the ground. I am having fantastic time using the shoes and I have run more than 100 miles in the last 5 weeks.

RFL has been the source of inspiration for me and the "Runners High" feeling makes me go on and on. There are some gadgets available which help you track the distance covered with the shoes. I personally like Social Running Map and GMaps Pedometer. There are also other
sites like Mapmyrun, WalkJogRun , FavoriteRun and RunningLog which are considered pretty good and user friendly. Most of the sites are best designed for view in United States as maps are updated with zoom possible with high resolution.

Some of the features which make the site better are
-> You should be able to enter routes without logging in.
-> You should be able to share the running routes with your friends ( as links )
-> You should be able to find if anyone else has added the same route, to connect with more runners.

Sunday, March 8, 2009

How Social Are You ?

I was just trying to see where I am spending most of the time on weekends. Its either some social events, social drinking or social networking. I thought of making a note of all Social Networks I have logged in to. Except 6 from the below list, I check every network for updates on weekly basis. Now its upto you to decode how social I am. You can check CheckUsernames.com if your favorite username is available.

ApnaCircle
BigAdda
Blogger
Eventful
Facebook
Hi5
Ilaaka
Last.fm
LinkedIn
LiveJournal
Meetup.com
Naymz
Netlog
Orkut
Plaxo
RFL
Ryze
Shelfari
SiliconIndia
StumbleUpon
Tagged
Toostep
Twitter
Wayn
WordPress

The list is still growing ...

Saturday, February 28, 2009

First 15K in Bangalore

I have given up a few things lately and trying to drive myself forward with some intense physical activity. The feeling is awesome and I am enjoying every moment of it. I missed the Goan Marathon when I was in Goa. Lately, I had trained myself to sleep like a log on weekends and give some silly excuses (to myself!). I had to get out of it somehow. So I quit boozing and took up running. It's not only able to motivate me to always aim higher but I am also seeing nature at its best. I really recommend that, if you really want to travel around you have to get your 'feet on the street'. Another motivation is a film that I watched in Hyderabad 'The Spirit of Marathon'.
I got up at 5:30 am today(Sunday), warmed up myself and went to my friends place who was supposed to join me for the run. He is a Marathoner (+ultra), so I felt I have to try hard to meet his expectations. Its only because of the support given by some of my close friends that I feel its so easy to run. We started the run from Wind Tunnel road around 6:15 am towards Belur. On the right, is Karnataka Golf Association which I had never heard of. There are CTS and HP offices too. On the left is the HAL Airport strip and other airport establishments. I had never seen the airport so quite and an empty runway. The weather was good, the sun yet to rise. We crossed the Centre for Airborne Systems and National Aerospace Laboratories (NAL) on the way. I covered the same stretch to and fro twice. It was close to 8 am when I was really tired as I finished all water I had and I didn't take any supplements. I finished my run at 8, covering around 15K in 1:45 hrs. This is one of my slower run. I am going to improve my speed and consistency and aiming to finish next half-marathon in less than 2 hrs. I have also mapped the route on Social Running Map.

My best bowling score - 177

Last week was a completely action packed week. I enjoyed my 5 day break relaxing in Goa. There was Viva-Carnival, Shivratri which kept me busy all the time in Goa. I met my school friends, and it was real fun. Getting back to work is difficult after tiring journey back to Bangalore. I am tired whatever maybe the mode of transport used. I think its because the 'mind over body' effect.
We had an office outing on the weekend, but at the last minute the outing was compressed to a mere Bowling and Dinner. I would not have gone out for the outing due to personal reasons. IMHO, outing on a weekday makes participation compulsory and works out best. There are only a few addas for Bowling and the most famous one is Amoeba (Church Street). I had been there before last month. Bowling is not a sport as it does not involve power or brain. Its a tricky game. Tricky because no one is quite sure about the rules and terms used in Bowling. If you wanna be a professional you ought to learn some of them.
My first game was just a warm up and I scored 91. There were people playing in 8 lanes and a friend of mine scored 153. I have never scored 150+ and I always admire people who cross the 150+ barrier. It takes a lot of precision and consistency with the ball to be one in that category. In my second game I was simultaneously playing in 2 lanes, just like Home and Away. In Home I was playing to set a new record and in Away it was a heated competition with the 'Bowling Champs'.
In Away it was a close call right from beginning. 3 people were competing for the "Bowling Champs" title. I was 4-5 points behind till the 9th hit. In the last hit my opponents screwed up big time with a 7 and I did a strike and the bonus hit took me to 139. The next highest scores were 134 and 130. I had won the battle of the Champs.
In Home lane it was going great. I did 2 strikes and a 9. I was at 95 in 5 hits. Next 4 hits were not so great and I was at 148 in 9 hits. In the meantime, a friend of mine had scored 161 - The highest score in the house. I had to beat the score somehow and needed a strike for sure. I still needed 14 to beat him. I rolled the ball and wow! it was a strike. I was not thinking about my score, I wanted to repeat it another time. The next hit was a strike too. I was so exited and jumped with joy. I was not confident if I had already broken the best score in the house. People were cheering me for another hit on the second bonus shot. But, I couldn't do it one more time and got a 9. Final score 177. I had setup a new high. This is my personal best and the experience was thrilling. Everyone congratulated me for achieving this feat.
Here is a guide How to Keep Score in Bowling. Finally to end the week on a Happy Note, was a B'day party organized by my friend Rajaram in TGIF. We had a amazing time pub-hopping and bird-watching.

Sunday, February 8, 2009

A glimpse of rsync

As a person, I am very impatient as far as my work is concerned. I want to do things superfast and in the process end up being completely screwed. I have already mentioned this over and over again. This is 21st century. India had its successful moon mission last year viz. Chandrayaan. We are technically so capable, still we are so used to committing the same mistakes again and again. Shame on us! I wanted to improve on something to avoid the daily mistakes that we do.
In my project, we have continuous integration in place. So everything runs automatically ( periodically) and all you have to do is, sit back and analyze the reports you get in the mail. You can decide when the automatic scripts should run. It can be when someone updates the files, or at a fixed time everyday. We use SVN repository for our code base. However, there are many things that we maintain in our system which has no direct relevance to the code and is not backed up automatically. We use multiple frameworks for testing. If I find a fault in the code, it has to be rectified and it should work fine with all other tests too. So we can't check-in the code based on one test alone. It may take several weeks to finish the tests and its really risky to maintain only a local copy of the code. Similarly, you can be testing some tools if they suit your work etc. which can go on for some time. From my experience, it is very difficult to create a build environment from the code in the repository. It is something that you would require daily for doing your tests and stuff, however there is no place for it in the repository. What do you do in such cases ? rsync is the utility that you are looking for. Let's have a look how you can use this tool to take regular backups.
Another issue is when you are trying to copy large files through scp and the transfer gets interrupted, you have no other option, but to keep trying. I found some tutorials on the internet which I followed blindly to setup the working backup system. Have a look at this, this, this and this.

Rockbox on my IRiver H10

I am using my IRiver H10 for almost 3 years now. I have never used it to its full potential till now, blame it on my less traveling. Another reason for not using my mp3 player is beacause my earphones were stolen. I am planning to buy Sennheiser earphones soon. Till I buy them, I wanted some revamp so thought of installing Rockbox. It was out of inspiration, and some support from my roommate Sarath, which made me install it so clean.
I downloaded the manual for H10(pdf) to make sure that I don not screw up my player. I downloaded the latest stable release to make sure everything runs smooth. All you have to do is, unzip the utility and run the installer. The Automatic install is very easy to do from the GUI. First, install the bootloader and then install the RockBox. If you want some more features, you can install fonts and themes. Remove the power cord and USB cord and restart the player and you are done. Rockbox is rocking. My IRiver H10 is so much better now, thanks to Rockbox.

Monday, January 26, 2009

अचार 5 पचरंगा


I have decided to write as frequently as possible on offbeat subjects which I have come across in my life. I did my graduation in NIT Kurukshetra. The best and easiest way to reach Kurukshetra is to board a bus from ISBT Bus Depo and get down at Pipli. Now what has the bus journey to do with the title of this post ?
I am pretty sure, no one would have heard this term ever ! "Pachranga" is a brand of pickle very famous in northern India. If you are travelling on GT Road you would find infinite shops selling this pickle. I checked on Google Patent Search and no patent has been filed till now. If there is no patent, how can it be an international quality without being exported ? I am still wondering how pickle can be such a highly consumed item in households! I still do not have a concrete answer. I asked some of my friends, but I found none of the answers satisfactory. It can't be due to appetite of Jaats or the dominance of a single brand of Pickle. One of the most probable reason for putting the "5 Pachranga" dashboards can be the advertisement value the company pays.
The context is similar to having a freeze sponsored by Coca Cola and stocking all kinds of Cola's in it.Marketing and advertising has penetrated every industry by far greater proportion than is thought of but the figures look deceptive.

Bus Ride in Bangalore


If anyone asks me what is the least expensive medium to commute in Bangalore, I would say it has to be a Rick. I am not nouveau riche for making such a statement. AFAIK, if you consider the actual cost of travel, the cheapest medium has to be a BMTC Bus. However, we can't neglect the other hidden expenditures involved when you travel by bus. For example losing your mobile phone, getting your purse flicked. If we apply Hess's law of summation, Rickshaw works out to be the cheapest medium to commute. I am not so good at mathematics, so I am leaving the statistics part for you to work out.
I own a motorbike, and my work timings are flexible. So I prefer to go out on my own. It had been a year since I got my motorbike serviced. I was riding it in a broken-down state for some time. Finally I made up my mind to get my motorbike serviced. I went to the Bajaj showroom from where I had bought it and finished the formalities. I had to reach office somehow! It was damn hot on that day. So I thought an AC Volvo bus is going to be the best option as I had never traveled by AC Volvo before ( and a bus for the last 2 years). You know, all great Laws of Nature always have exceptions. That's the reason we have Exception Handling. Another reason for boarding a AC bus is because they have the signboards written in English. I had to reach MG Road from Manipal Hospital. The people sitting around me seemed to be regular users of AC bus service. No one had patience to even look at me. It took me not more than 15 minutes to reach my destination. I got down at Trinity Circle and walked to my office( barely 5 min walk ). It was a fairy ride.

गणतंत्र दिवस मुबारक हो

I would like to wish "Happy Republic Day" to everyone. On 26th January 1950 the constitution of India came into force and India became a truly Sovereign, Democratic and Republic. I was in Delhi a few years back on Republic Day. Though I could not attend the grand parade, the atmosphere made me feel so good. Kite Flying in Delhi adds a different flavor to the celebrations.
One of my friend, Praveen, sent me a self-composed Poem. It was very touching, so thought of putting it here.

My dear land,
I bow before you, for,
You have filled my stomach, for,
You have provided me shelter, for,
You have satisfied my thirst,
I will carry you in my heart,

Till thy last breath, for,
You carried me like a butterfly underneath a leaf.

My mother,
I will be one among your children who lived only for you.
Till my last breath I will protect you and be one among your children who died only for you.

Oh Mother! you are my lovely mother, for,
You wept so much for me, for,
You bare so much for me.

I have sowed you at the depth of my heart, for I can see you grow everyday,
I nourish you with good thoughts, for you blossom everyday.
I LOVE MY INDIA. EAST OR WEST YOU ARE THE BEST.

Jai Hind.

Sunday, January 25, 2009

Interesting journey of Pink Color

I am not here to be an activist nor a chauvinist. I am here just to express freedom of thought. This post is most targeted towards the male community. All female readers are free to read it and LYAO. What comes to your mind, when you think of Pink color ? I would like to get as many replies to this post to make it more interesting.
Well, I associate Pink color with a guy who sends me mails with a Pink colored font. !!! Here are the basic qualifications.

Pink is so gay
. This is what I feel when I see such stuff. Pink color has been associated with Gay Community from early 20th Century. In professional life, its considered impolite to command over someone to get something done. Email is rather more sensitive as compared to face-to-face talk as there are more chances that some things can be misinterpreted. Its better to be safe than sorry. I have already talked about Email Ethics in my previous post. In an evolving atmosphere I don't recommend everyone to follow the rules strictly. However, if promoting Pink color is a way of propagating the existence of Gay Community, please stay away from official communication.

Saturday, January 24, 2009

Cost cutting Idea

I work as a Developer in a reputed organization. Due to the ongoing financial crisis, declining operating margins and profits, companies are using every possible way to cut the expenditure. Starting from toilet-paper to air conditioner, you wouldn't know what will be off the store as every day passes. Some companies are even resorting to pay cuts. I thought of a noble idea which can be implemented in daily life by every individual to help save company's money just by refining you email sending habits. I would say its not all about money, it can save time of many people who rely on the fast speed of download for work.
I use email on the fly. I would be paralyzed if I don't check my email for more than a day. Could you give up email and go green ? That's not my intension! On an average I get 4 emails with attachments (photos, videos and what not - which I never bother to read or watch) per day. In my office every user has limited storage space on the server, so 10 people sending me forwards can surely fill up the allocated space for my account and all others important mails get bounced. Some of the obvious mistakes which can be avoided are
-> Do not send attachments in email unless necessary. Upload it in a central server if it is a official document and people who desire to read can download it. Believe me, 90% of the audience doesn't even read such emails.
-> Avoid HTML mails and fancy content as much as possible.
-> Use a Forgotten Attachment Detecter
-> Watch your habits. You can get into trouble.
If the file you're about to attach to your Internet email can be found elsewhere on the net, it maybe better to send the address of that location rather than attaching a copy of the file itself. If nothing else, this will save you some time because your system doesn't have to transfer the large attachment. Also, your recipient(s) can decide whether to download the file or not, where as if you had attached it, they may not have any option but to take the time to download it even if they don't want to. The organization can tie up with premium services like YouSendIt which does the heavy lifting for you. Another option is to use an alternative service like Domino Lotus for intranet email and Microsoft Outlook for other email and have strict attachment policies in place.
HTML Email isn't rich. Some of the things I hate the most is "Good Morning" mails. I don't care a shit about how many "Good Morning" mails I get. It takes me a whisker to delete all of them (add a rule), but at the end of the day, company is paying for all the stuff and everyone blames the corporates for cost-cutting measures. Here is a list of Common Email pitfalls and how to avoid them. It's hard to win an argument about saving bandwidth these days. Still, the next time you're about to send an email with large attachments, think twice!. In my next articles I will discuss about the Carbon footprint of email, benefits of using Google Apps and comparison of Outlook vs. Gmail.

Office spam

Its very tough to imagine getting spam in office mails. I categorize all unwanted mails( specially intended for very big mailing lists) as spam. The problem is sometimes I get useful mails from the people who are responsible for spam in office. The Reply to All option in Microsoft Outlook should be used with caution, else it qualifies to be a sin like 'rm -rf'. Last week the company HR sent a mail to "All Employees list" that accommodation has to be arranged to a new recruit. Fortunately, the offer letter in the mail wasn't part of the mail. On an average I get 3 to 4 mails every week due to such mistakes.
My suggestion is to disable the shortcuts for "Reply to All" and have policies who is authorized to send mails to certain mailing lists. If you are using Outlook 2007 or Outlook 2003, you can customize outlook to disable "Reply to All" with ease. Another very simple option is to defer delivery of sent mail.

rm -rf can't be forgiven

This week, I did a blunder. I did 'rm -rf' on a directory. Can this act be forgiven ? In my case, yes but not all the time. If its not, you qualify for a mention on The Daily WTF. Its because I take regular backups and I use some tools to automatically back up data for me. The reason for writing this post is to make linux users aware of the harm you can do to yourself and the system by issuing a single command.

Lets dig more into some trivial mistakes you can make.
rm -rf * .cpp // Intended to remove all cpp files.
rm -rf / // WTF ?
rm -rf .* // Remove all hidden files


If you are using ext2, recovery is easy. Also, if you want to use any tools for data recovery make sure that you don't write anything to the disk. For safety, unmount all partitions and connect your drive to some other computer and try recovering data. The freed blocks will be the first one to be used by the system so data recovery becomes increasingly difficult the longer the time partition is mounted.

The best option is to use an alias for rm command.
alias rm 'rm -i'

However the -f option will override the alias. Improving it further,
mv /usr/bin/rm /usr/bin/rm.bak

#!/bin/bash

mkdir ~/.Trash &> /dev/null

while [ ! -z "$1" ]; do
mv "$1" ~/.Trash/
shift
done

You can put a
rm -f ~/.Trash/*
in .logout in home dir. The disadvantage of this approach is, you will become dependent upon this behaviour of "rm", and you will find yourself someday on a normal system where "rm" is really "rm", and you will get yourself in trouble. So its better to define an alias mydelete for 'rm -rf'.

If you have none of the options implemented as described above, you can refer to Recover from rm and Recovering Linux files and filesystems for more info.

kaushal@twitter

Follow me on Twitter

Memory leak Detection tools

If you are a developer, you would know how important it is to make sure there are no memory leaks in your code. I tried a few tools to examine the leaks in the code. I have tried to group all the information in this post.

A memory leak tracking tool should be
-> Platform Independent and can be cross-compiled for different architectures
-> Should support multi-threaded environment
-> Can be statically or dynamically linked
-> Should be able to generate call stack or line number in the code
-> Should be able to detect double free, memory overwrite, buffer overrun and underrun errors

Valgrind is the most powerful for catching leaks in C/C++ however, it can't be cross-compiled on different architectures. Valgrind also has a inbuilt Heap-Profiler called Massif.
dmalloc is a very useful tool and satisfies all requirements on embedded systems and is supports mips architucture. dmalloc requires source recompilation which is an overhead.
Electric Fence effectively catches overwrites but could not even find even a single memory leak in my test code.
Google Perftools has a excellent heap-profiler. I have not used this framework extensively as it can't be cross-compiled for mips architecture.
Bounds Checker is a very good tool for development with Microsoft Visual Studio.

I did a bit of googling and found some very helpful links. Do visit Memory Leak Detection in Embedded Systems, Memory Checker comparison and my favorite Google-perftools

Kernel Profiling

I got an opportunity to try my hands on a proprietary OS ( lets call it OS-XYZ, If I call it OSX, Steve would sue me)and when I compared the performance with a normal linux machine, OS-XYZ seemed to slow down the system by a factor of 3. The test program runs in userspace and library calls ( eg. glibc ) are translated to system calls in kernel space. The best approach to investigate is bottoms-up approach. See if everything is going fine in the kernel.
The next step is to do "kernel profiling" to find the exact difference and see if the kernel patches in OS-XYZ are affecting the system performance. Please see introduction to kernel profiling.
You need to make sure that the following points are taken care before starting off -
1) Kernel should be compiled in debug mode by executing
make menuconfig
Check the kernel .config file for
CONFIG_PROFILING=y
CONFIG_OPROFILE=m
CONFIG_DEBUG_INFO=y
CONFIG_FRAME_POINTER=y

2) Copy the
System.map
file to say
/boot/System.map
.

3) Boot with the new kernel with profile=2 option. This will generate a profile file
/proc/profile

Execute the following commands to do the profiling when running the test_program.

readprofile -r
readprofile -M1
./test_program
readprofile -v -m /boot/System.map | sort -n +2 | tail -40

This will print the functions called in kernel space, number of ticks, and number of times each function is called. Also see man readprofile


Once you are done with the profiling, examine the data and compare the sources in
/usr/src/linux/arch/mips/kernel/
and get going.

Checklist -
-> Make sure all kernel modules ( *.ko) are present in the patched kernel.
-> Think of ways to restore the box, in case kernel fails to load up or on kernel panic.

One less tooth

It's been a long time I have updated my blog. I don't want to give any excuses, rather would like to clarify that I am not as passionate blogger as some of you may be. I love the concept of blogging, but one has to be dedicated and should devote some time regularly to blog. This is my third attempt. Only time will tell whether I make it this time.
Last few days, I was having immense pain in my right-upper jaw while eating. I had been told earlier that the wisdom tooth hasn't erupted properly and has to be removed. I wasn't so brave at that time and kept my decision of hold (Thanks to some antibiotics which relieved the pain). I remembered the poem by Ogden Nash This Is Going To Hurt Just A Little Bit. I still fear the dentist, because of the sharp pointed tools they use and the way they use them.
The next thing was getting the best consultation. I got the reference of a well known dentist in Jayanagar. I called him up to fix up an appointment. He told me that its a complex procedure, and he cant operate ( I had to go to Oral Surgeon ) on me on the same day I take the first appointment. Finally I made up my mind to visit the dentist . So called him and told him approximate time when I ll be coming.
I had to leave office early to make it on time. It took me a while to find the place ( I don't travel so often in Bangalore and South Bangalore is one of the rarest places where I go ). I was pretty relaxed. He examined my teeth and told me that the wisdom tooth is decayed and has to be removed. He also showed me the injury done to my cheek. I could see a small hole ( kinda ulcer). He gave me an option to get the tooth removed right away or some other day. Considering the fact that traveling in Bangalore city is a PITA, I thought that this is the time to go for it. The dentist had to give local anesthesia for doing the extraction. Believe me, it pains a lot when the doctor administers the anesthesia. Its like getting poked in a bone. It took 5 minutes for the anesthetic to take effect. The doc pulled a nice and sharp instrument. He did something and told me to spit. It was all blood. Doc started the operation again. He made a lining on the outer boundary of the gum, picked up a pair of tweezers and pulled the teeth right away. I was happy that it didn't pain.
The doc offered some advice and a prescription of pain killer ( in case it hurts ). The doc was confident that its not gonna hurt. It took max 15 min the finish the whole procedure. I was fortunate that it was the upper wisdom tooth. If it was lower the procedure is very complex and as per my understanding the bone has to be cut to get it extracted. I took the extracted tooth with me, thanked the doc and left.
I had to come to office for some work. It was still bleeding and I had to swallow everything. In an hour I could feel the pain and as time passed it got more painful. I left for home, picked up some curd rice and medicines on the way. I could barely open my mouth and it was paining like hell. I called up my cousin who is a dentist and asked her for advice. I finished my dinner and took the painkiller. I slept in 30 min or so. I couldn't sleep, but still tried. When I got up today, it was all fine. As a precaution I decided not to eat anything hard.