Tuesday, September 20, 2011

Bulk mail shell script

#!/bin/bash -x
#Thank God
EMAIL_LIST=/root/script/email_list.txt
RESUME_PATH=/root/script/RESUME/pdftest.pdf
NAME_OF_RESUME=Damanjeet.pdf
BODY_CONTENTS_FILE=/root/script/RESUME/BODY_CONTENTS_FILE.txt
SUBJ="Send mail from Unix with file attachments"
CC=mailtodaman@gmail.com
for TO in `cat $EMAIL_LIST`;do
(cat $BODY_CONTENTS_FILE ;uuencode $RESUME_PATH $NAME_OF_RESUME )| mail -s "$SUBJ" -c $CC mailto @gmail.com $TO
done

Migrate Mdaemon user to zimbra

#Thank God
#RUN THIS SCRIPT FROM ZIMBRA USER
IFS=$'\n'
echo "This script is written by Damanjeet."
for i in `cat Accounts.csv | grep @xyz.com`; do
CHECK=`echo $i | grep @xyz.com`
#echo $i
if [ "$CHECK" == "" ]; then
echo
else
#echo $CHECK
EMAIL_ID=` echo $CHECK|awk -F\, '{ print $1}'`
#| awk -F\" '{print $2}'`
PASSWORD=`echo $CHECK|awk -F\, '{ print $6}'`
#| awk -F\" '{print $2}'`
echo "E-mail $EMAIL_ID PASSWORD $PASSWORD"
#UNCOMMENT BELOW LINE
zmprov ca $EMAIL_ID $PASSWORD
fi
done

Sed to remove space

sed "/^[press space and then tab]/d" file_name

Wednesday, August 17, 2011

The art of public speaking

A renowned Management Guru entered a large lecture hall to deliver a lecture on Motivation to the employees of a large industrial organization.

To his horror he found that the large hall was empty except for a young man seated in the front row.

The Management Guru asked the solitary audience who he was.

“I am a Cook in the Industrial Canteen,” said the young man.

The Management Guru, pondering whether to speak or not, asked the Cook, “You are the only one here. Do you think I should speak or not? Tell me frankly, should I deliver my lecture?”

The Cook said to the Management Guru: “Respected Sir, I am a simple man and do not understand these things. But, if I came into the Dining Hall and saw only one man sitting there, I would certainly give him food.”

The Management Guru took the Cook’s insightful answer to heart and with full gusto began to deliver his lecture.

He spoke passionately for over two hours delving in great detail on each and every aspect of the theory and practice of Motivation.

Immensely proud after his virtuoso performance, the Management Guru felt highly elated, on top of the world, and wanted his audience to confirm how fantastically illuminating and effective his lecture had been.

So the Management Guru pompously asked the Cook, “How did you like my lecture?”

The Cook answered, “Respected Sir, I told you already that I am a simple man and do not understand these things very well. However, if I came into the dining hall and found only one man sitting there I would feed him, but I wouldn’t give him all the food I had prepared in the kitchen.”

Wednesday, August 10, 2011

Good one!!

A group of alumni, highly established in their careers, got together to visit their old university professor. Conversation soon turned into complaints about stress in work and life.

Offering his guests coffee, the professor went to the kitchen and returned with a large pot of coffee and an assortment of cups -porcelain, plastic, glass, crystal, some plain looking, some expensive, some exquisite - telling them to help themselves to hot coffee.

When all the students had a cup of coffee in hand, the professor said: "If you noticed, all the nice looking expensive cups were taken up, leaving behind the plain and cheap ones. While it is but normal for you to want only the best for yourselves, that is the source of your problems and stress.

What all of you really wanted was coffee, not the cup, but you consciously went for the best cups and were eyeing each other's cups.

Now if life is coffee, then the jobs, money and position in society are the cups. They are just tools to hold and contain Life, but the quality of Life doesn't change. Some times, by concentrating only on the cup, we fail to enjoy the coffee in it."

Don't let the cups drive you... Enjoy the coffee instead

Wednesday, July 20, 2011

How to close port in linux?

lsof -i -n | grep port
kill -9 PROCESS ID

Monday, July 18, 2011

Quote

"As for worrying about what other people might think - forget it.

They aren't concerned about you. They’re too busy worrying about what you and other people think of them."

-- Michael le Boeuf