1) User accounts should be provided limited priviledges and strengthen ur Passwords.
2) Use security softwares such as AppArmor, SELinux and Iptables (Ubuntu 8.04 default installation already hardened by AppArmor package. You need to sepeartly install and configure SE Linux and IP Tables
# sudo apt-get install SELinux
# sudo apt-get install Iptables
3) Always mount system files and user files on seperate partition. So that, even if anyone partition corrupted, you can retrive the other.
4) Stop Unnecessary services and Ports
5) Provide limitations on using external devices, drives.,
Friday, July 8, 2011
Integrate Apache and Tomcat
This integration is to provide more security on hosting.
- Install Apache2.2, Tomcat5.5 and libapache2-mod-jk 1:1.2.25-2
root # apt-get install apache2 tomcat5.5
root # apt-get install libapache2-mod-jk
- Enable jk module in apache if not enabled.
root # a2enmod jk
- Restart Apache
root # /etc/init.d/apache2 stop
root # /etc/init.d/apache2 start
- Create/Edit jk.conf file in /etc/apache2/mods-available to contain the following contents and create a soft link from apache2/mods-enabled
<IfModule mod_jk.c>
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkRequestLogFormat "%w %V %T"
</IfModule>
- Create a file workers.properties in /etc/apache2/ with contents,
workers.tomcat_home=/etc/tomcat-5.5/ # Tomcat Installation Directory
workers.java_home=/usr/lib/jvm/java-6-sun-1.6.0.07/ # Java Installation Directory
ps=/
# Worker properties
worker.list=ajp13 # This name should be given in the JkMount
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
- In /etc/apache2/sites-available/default, add the following at the end of the file.<VirtualHost *>
ServerName test.otc.nic.in
DocumentRoot /usr/share/tomcat5.5-webapps/ROOT
ErrorLog /var/log/apache2/error.log
Alias / "/usr/share/tomcat5.5-webapps/ROOT"
<Directory "/usr/share/tomcat5.5-webapps/ROOT">
Options Indexes +FollowSymLinks
</Directory>
JkMount /* ajp13
</VirtualHost>
- Restart Apache
root # /etc/init.d/apache2 stop
root # /etc/init.d/apache2 start
CSRF Attack on Logout Menu
By Default, Drupal 6 Menus are Vulnerable to CSRF Attack. To Overcome this, try with Tokens module.
Create a custom module and append the token with the URL. A sample module to avoid CSRF on Logout menu is illustrated below:
<?php
menu_cache_clear($menu_name = 'navigation');
function csrfval_menu_alter(&$items) {
$items['logout']['page callback'] = 'csrfval_logout';
$items['logout']['type'] = MENU_CALLBACK;
return $items;
}
function csrfval_logout($token = NULL) {
if (drupal_valid_token($token)) {
user_logout();
}
else {
drupal_goto();
}
}
menu_cache_clear($menu_name = 'navigation');
function csrfval_menu_alter(&$items) {
$items['logout']['page callback'] = 'csrfval_logout';
$items['logout']['type'] = MENU_CALLBACK;
return $items;
}
function csrfval_logout($token = NULL) {
if (drupal_valid_token($token)) {
user_logout();
}
else {
drupal_goto();
}
}
Convert .doc to .pdf
Install Headless VCL plugin for openoffice.
Then Create a sh file containing the following code :
#!/bin/sh
DIR=$(pwd)
DOC=$DIR/$1
/usr/lib/openoffice/program/soffice.bin -headless "macro:///Tools.MSToPDF.ConvertMSToPDF(boiuserid.doc)"
Execute it.
Labels:
OpenOffice
அப்பா...
எப்படி எப்படி
எல்லாமோ
தன் பாசம்
உணர்த்துவாள் அம்மா
ஒரேயொரு
கைஅழுத்தத்தில்
எல்லாமே
உணர்த்துவார்
அப்பா...
எல்லாமோ
தன் பாசம்
உணர்த்துவாள் அம்மா
ஒரேயொரு
கைஅழுத்தத்தில்
எல்லாமே
உணர்த்துவார்
அப்பா...
முன்னால்
சொன்னதில்லை
பிறர் சொல்லித்தான்
கேட்டிருக்கிறேன்
என்னைப்
பற்றி பெருமையாக
அப்பா
பேசிக்கொண்டிருந்ததை...
அம்மா
எத்தனையோ முறை
திட்டினாலும்
உறைத்ததில்லை
உடனே
உறைத்திருக்கிறது
என்றேனும்
அப்பா
முகம் வாடும் போது
உன் அப்பா
எவ்வளவு உற்சாகமாக
இருக்கிறார் தெரியுமா
என என் நண்பர்கள்
என்னிடமே சொல்லும்
போதுதான் எனக்குத்
தெரிந்தது
எத்தனை பேருக்குக்
கிடைக்காத தந்தை
எனக்கு மட்டும் என...
கேட்ட உடனே
கொடுப்பதற்கு
முடியாததால் தான்
அப்பாவை அனுப்பி
இருக்கிறாரோ
கடவுள்..?
சிறுவயதில்
என் கைப்பிடித்து
நடைபயில
சொல்லிக்கொடுத்த
அப்பா
என் கரம் பிடித்து
நடந்த போது
என்ன நினைத்திருப்பார்..?
லேசாக என் கால்
தடுமாறினாலும்
பதறுவார் அப்பா
இன்று அவர்
தடுமாறிய போது
அருகில் நான் இல்லை...
அம்மா செல்லமா
அப்பா செல்லமா
என கேட்டபோதெல்லாம்
பெருமையாகச் சொல்லி
இருக்கிறேன்
அம்மா செல்லமான
அப்பா செல்லம் என.
எத்தனையோ பேர்
நான் இருக்கிறேன்
எனச் சொன்னாலும்
அப்பாவை போல்
யார் இருக்க முடியும்..?
நானும் காட்டியதில்லை
அவரும் காட்டியதில்லை
எங்கள் பாசத்தை...
இருந்தும் காட்டிக்
கொடுத்த கண்ணீரைத்
துடைக்க இன்று
அப்பாவும் அருகில் இல்லை..
அம்மாவிடம்
பாசத்தையும்
அப்பாவிடம்
நேசத்தையும்
இன்றே உணர்த்துங்கள்
சில நாளைகள்
அவர்கள் அருகில் இல்லாமலும் போகலாம்...
Chanakya Mantra
- "A person should not be too honest. Straight trees are cut first and honest people are screwed first."
- "Even if a snake is not poisonous, it should pretend to be venomous."
- "The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you."
- "There is some self-interest behind every friendship. There is no friendship without self-interests. This is a bitter truth."
- "Before you start some work, always ask yourself three questions - Why am I doing it, What the results might be and Will I be successful. Only when you think deeply and find satisfactory answers to these questions, go ahead."
- "As soon as the fear approaches near, attack and destroy it."
- "The world's biggest power is the youth and beauty of a woman."
- "Once you start a working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest."
- "The fragrance of flowers spreads only in the direction of the wind. But the goodness of a person spreads in all direction."
- "Whores don't live in company of poor men, citizens never support a weak company and birds don't build nests on a tree that doesn't bear fruits."
- "God is not present in idols. Your feelings are your god. The soul is your temple."
- "A man is great by deeds, not by birth."
- "Never make friends with people who are above or below you in status. Such friendships will never give you any happiness."
- "Treat your kid like a darling for the first five years. For the next five years, scold them. By the time they turn sixteen, treat them like a friend. Your grown up children are your best friends."
- "Books are as useful to a stupid person as a mirror is useful to a blind person."
- "Education is the best friend. An educated person is respected everywhere. Education beats the beauty and the youth."
Put the GLASS Down ...
A Professor began his class by holding up a glass with some water in it.
He held it up for all to see & asked the students,' How much do you think
this glass weighs?'
'50gms!' .... '100gms!' .....'125gms' .....the students answered.
'I really don't know unless I weigh it,' said the professor, 'but, my question is: What would happen if I held it up like this for a few minutes?'
'Nothing' the students said.
'Ok what would happen if I held it up like this for an hour?' the professor asked.
'Your arm would begin to ache' said one of the students.
'You're right, now what would happen if I held it for a day?'
'Your arm could go numb, you might have severe muscle stress & paralysis & have to go to hospital for sure!' ventured another student & all the students laughed.
'Very good. But during all this, did the weight of the glass change?' asked the professor.
'No'
'Then what caused the arm ache & the muscle stress?' The students were puzzled.
'Put the glass down!' said one of the students.
'Exactly!' said the professor.' Life's problems are something like this. Hold it for a few minutes in your head & they seem OK. Think of them for a long time & they begin to ache. Hold it even longer & they begin to paralyze you. You will not be able to do anything. It's important to think of the challenges (problems) in your life, but EVEN MORE IMPORTANT to 'put them down' at the end of every day before you go to sleep. That way, you are not stressed, you wake up every day fresh & strong & can handle any issue, any challenge that comes your way!' So, as it becomes time for you to leave office today, Remember friend to 'PUT THE GLASS DOWN TODAY!
He held it up for all to see & asked the students,' How much do you think
this glass weighs?'
'50gms!' .... '100gms!' .....'125gms' .....the students answered.
'I really don't know unless I weigh it,' said the professor, 'but, my question is: What would happen if I held it up like this for a few minutes?'
'Nothing' the students said.
'Ok what would happen if I held it up like this for an hour?' the professor asked.
'Your arm would begin to ache' said one of the students.
'You're right, now what would happen if I held it for a day?'
'Your arm could go numb, you might have severe muscle stress & paralysis & have to go to hospital for sure!' ventured another student & all the students laughed.
'Very good. But during all this, did the weight of the glass change?' asked the professor.
'No'
'Then what caused the arm ache & the muscle stress?' The students were puzzled.
'Put the glass down!' said one of the students.
'Exactly!' said the professor.' Life's problems are something like this. Hold it for a few minutes in your head & they seem OK. Think of them for a long time & they begin to ache. Hold it even longer & they begin to paralyze you. You will not be able to do anything. It's important to think of the challenges (problems) in your life, but EVEN MORE IMPORTANT to 'put them down' at the end of every day before you go to sleep. That way, you are not stressed, you wake up every day fresh & strong & can handle any issue, any challenge that comes your way!' So, as it becomes time for you to leave office today, Remember friend to 'PUT THE GLASS DOWN TODAY!
Pay attention to critical Things in ur Life
When things in your life seem almost too much to handle, when 24 hours in a day are not enough, remember the mayonnaise jar and 2 cups of coffee.
A professor stood before his philosophy class and had some items in front
of him. When the class began, wordlessly, he picked up a very large and empty mayonnaise jar and proceeded to fill it with golf balls. He then asked the students if the jar was full. They agreed that it was. The professor then picked up a box of pebbles and poured them into the jar. He shook the jar lightly. The pebbles rolled into the open areas between the golf balls. He then asked the students again if the jar was full. They agreed it was.
The professor next picked up a box of sand and poured it into the jar. Of
course, the sand filled up everything else. He asked once more if the jar was full. The students responded with a unanimous "yes." The professor then produced two cups of coffee from under the table and poured the entire contents into the jar, effectively filling the empty space between the sand. The students laughed."Now," said the professor, as the laughter subsided, "I want you to recognize that this jar represents your life. The golf balls are the
important things - God, family, Children, health, friends, and favorite passions -- things that if everything else was lost and only they remained, your life would still be full.
The pebbles are the other things that matter like your job, house, and car.
The sand is everything else -- the small stuff.
"If you put the sand into the jar first," he continued, "there is no room for the pebbles or the golf balls. The same goes for life. If you spend all your time and energy on the small stuff, you will never have room for the things that are important to you.
So...Pay attention to the things that are critical to your happiness.
Play with your children. Take time to get medical checkups. Take your partner out to dinner. There will always be time to clean the house and fix the disposal. "Take care of the golf balls first -- the things that really matter. Set your priorities. The rest is just sand."
One of the students raised her hand and inquired what the coffee represented.
The professor smiled. "I'm glad you asked. It just goes to show you that
no matter how full your life may seem, there's always room for a couple of
cups of coffee with a friend."
A professor stood before his philosophy class and had some items in front
of him. When the class began, wordlessly, he picked up a very large and empty mayonnaise jar and proceeded to fill it with golf balls. He then asked the students if the jar was full. They agreed that it was. The professor then picked up a box of pebbles and poured them into the jar. He shook the jar lightly. The pebbles rolled into the open areas between the golf balls. He then asked the students again if the jar was full. They agreed it was.
The professor next picked up a box of sand and poured it into the jar. Of
course, the sand filled up everything else. He asked once more if the jar was full. The students responded with a unanimous "yes." The professor then produced two cups of coffee from under the table and poured the entire contents into the jar, effectively filling the empty space between the sand. The students laughed."Now," said the professor, as the laughter subsided, "I want you to recognize that this jar represents your life. The golf balls are the
important things - God, family, Children, health, friends, and favorite passions -- things that if everything else was lost and only they remained, your life would still be full.
The pebbles are the other things that matter like your job, house, and car.
The sand is everything else -- the small stuff.
"If you put the sand into the jar first," he continued, "there is no room for the pebbles or the golf balls. The same goes for life. If you spend all your time and energy on the small stuff, you will never have room for the things that are important to you.
So...Pay attention to the things that are critical to your happiness.
Play with your children. Take time to get medical checkups. Take your partner out to dinner. There will always be time to clean the house and fix the disposal. "Take care of the golf balls first -- the things that really matter. Set your priorities. The rest is just sand."
One of the students raised her hand and inquired what the coffee represented.
The professor smiled. "I'm glad you asked. It just goes to show you that
no matter how full your life may seem, there's always room for a couple of
cups of coffee with a friend."
Life Goes On ...
Friend: Happy birthday!
She : Haan...tha......nk yo....u...was just getting up from the bed.
Friend : Oh! That means I am the first to wish you!
She : Naa! He has already wished me at 12 in the night.
Friend : Who???
She : Come on, who else, Nitin.
Friend : Oh, ok. So, what's the plan for
today?
She : Nitin told me that he has a surprise gift for me for my Birthday.
And also we are going to Flower Show today. I am excited!
I have never seen the flower show that happens in Lal Baug. Actually that itself is the most wonderful gift for me.
-----------------------------------------------------------------------------------------------------------
Friend : "Did you go to Palace grounds all the way from Basavanagudi, to see Bryan Adam's show!!! Who accompanied you?"
She : Nitin
Friend : By the way, who referred your CV in SoCrates? I mean you don't know anyone there, right?
She : No, he forwarded my CV to one of his friends there.
Friend : I heard that the HR round interview went on till 8pm in the night. I think you faced difficulty in returning to your room.
She : No, he had come to pick me up. He came from his office, dropped me to my room and he returned to his room at around 11pm.
He didn't have dinner also. I asked him to have at my room. Poor Nitin.
-----------------------------------------------------------------------------------------------------------
Friend : If you are supposed to go home tomorrow itself then what about reservation?
She : I have told him, he will go to Majestic and would get it done, and he told he has some work in Majestic.
That's why I am relaxed a bit.
-----------------------------------------------------------------------------------------------------------
Friend : How was your written test in Philips?
She : I failed yaar. The day before the test I had prepared perfectly. Nitin had come to our room.
He taught me the basics of embedded programming concepts. I was very confident only because of him.
But something else was in store for me.
Friend : Then, what did you do on Sunday?
She : We had gone to see "Lakshya". He doesn't see Hindi movies. But as I was upset after failing in the Philips written test,
he took me for movie. I was very happy and surprised that he himself decided for a Hindi movie,
and he was very happy that I enjoyed the movie. And you know; we had dinner in Pizza hut.
It was his belated B'day treat!
Friend : And, what was your belated gift ;-)
She : Gift!! I had given the gift on his B'day itself. I was the first to call him at 12 in the night,
he was busy throughout the day, and somehow we could meet in the evening and
I gifted him with a cute time piece with a nice quote on it. He doesn't have time sense,
so my time piece must always remind him of this. That day he didn't give me any treat as
he had to go back to office. Yesterday I had a fight over this, you know! Poor kid.
-----------------------------------------------------------------------------------------------------------
Friend : Hello...what about our sari shopping program in Malleshwaram?
She : Listen, I will call you later.
Friend : You didn't call me back in the morning, so I called now.
She : Yeah, when you called I was in Koramangala, with Nitin. He was very upset in the morning.
He had a fight with his elder brother. So, it wouldn't have been fair on my part to leave him alone.
If I am with him in such situation very soon he comes back to normalcy. So I postponed the Malleshwaram program.
-----------------------------------------------------------------------------------------------------------
Friend : Hey! What happened? You seem to be very happy today.
She : Why not? You know today is one of the most happiest days for me. Nitin got an onsite assignment in
UK , for 6 months! That's why I am very happy. All of his hard work paid today.
He had been waiting for this opportunity since long. He'll be leaving next month.
Friend : You will miss him.
She : Badly. I am so much dependent on him. I must thank Sanju, through him only I got to know Nitin.
Without Nitin it would have been very difficult for me to stay in this alien city with no friends,
relatives and on top of all, no job. He has been so caring friend all through my tough times in this city,
he is so mature, so understanding, so trustworthy...a true friend.
Friend : He loves you yaar.
She : I know.
Friend : And you? Don't you love him?
She : I don't want to.
Friend : Don't tell me. You also feel for him.
She : I know yaar. He has everything that I expect in my dream-life-partner.
I know I can never get a true life partner like him. But I don't want to commit.
Friend : What is stopping you? I really don't understand. When Miya-beevi are razi kya karega kazi?
She : Please...don't say like that. I never told him that I love him or something like that.
Friend : Is he a fool not to
understand your feelings which are so clear from outside only? Poor fellow, don't leave him alone.
She : I have told him everything about my family. He knows how orthodox my parents are.
They can never expect me marrying a guy from a different caste. They trust me. Come what may,
I will not hurt my parent's feelings. I cannot imagine also. Now they are happily searching a guy for me in my native place.
Friend : Hmm, I don't understand at all.
-----------------------------------------------------------------------------------------------------------
She : This Saturday I have to go home, a guy is coming to see me.
Friend : Oh! Is it? Good news yaar. Your first interview! Wish you all the best.
Friend : Any guesses, who is he?
She : Please yaar. I am least bothered and least interested. For the sake of my parents' happiness I have agreed for this.
-----------------------------------------------------------------------------------------------------------
Friend : What about the interview, I was expecting your call actually?
She : Nothing so special. I didn't like the guy's attitude. I told my parents clearly.
My parents are very understanding and so they too told me that they won't go ahead with this matter.
Friend : But still you should have analyzed properly.
She : I shared my views with Nitin. He had
called me the next day. He didn't suggest me anything. He didn't tell me to say "yes" or "no",
he didn't preach what is right or what is wrong. But after talking to him I was satisfied that whatever decision I took was right.
-----------------------------------------------------------------------------------------------------------
Friend : Yesterday your mobile was engaged for more than half an hour. I kept trying, but I slept after 11pm.
She : Yeah, I was talking to Nitin. He is very much worried about my marriage.
He is concerned whether I would get a guy of my choice or not, whether I would be happy with him or not.
I was very sad to know this. But I am helpless. I pacified him and convinced that whatever my parents do,
that will be the best for me, so no need to worry.
Friend
: How Nitin will feel after you get married? Will he not be upset all the time?
She : Time will change everything. He will start living again. Was he not leading a normal life before
I came into his life? It's all matter of time. Even I can't do anything other than pacifying him and
myself with these philosophical statements.
-----------------------------------------------------------------------------------------------------------
Finally " She" got engaged with a guy of her parent's choice (with her "yes" of course).
She is in touch with both Nitin and the new "him" regularly through chatting in Yahoo Messenger.
Finally " She" got happily married to "him", very soon
converting Nitin into memories, but deleting the memories was slow and almost impossible for Nitin.
-----------------------------------------------------------------------------------------------------------
Why do girls do like this?
She needs him when she is new to the city.
She needs his help in finding out a PG or hostel for her
She makes him prepare a good-format-CV for her
She needs him to drop her to the venue of a walk-in interview
She expects him to collect all the consultants' mail ids
She needs him while preparing for the interviews
She needs his help in identifying HER skill sets, strengths and weakness!
She wants him to conduct a mock-interview for her!
She gives her yahoo mail id password so that he can forward her CV to consultants through internet in his office (in office hours!)
She needs him for boosting her confidence when she fails in the 1
st written test in her life
She wants him to take her to M.G Road , Brigade Road, Forum and Big bazaar
She needs his company while visiting all the temples in Malleshwaram on Vijayadashami, though he is not a believer of God.
She asks his opinions on importance of marriage
She wants him to be a shoulder to cry when her parents force her for marriage
She needs his help in preparing her mind for the first interview with a guy
She needs his help in deciding about the marriage proposal
She loves to share her happiness with him when she gets engaged
She expects him to attend her marriage (Come on guys, he is a true friend of her!)
The guy does all this honestly, without saying a single "No".
He loves her.
He cares for her.
Whatever he is today; it is only because of her entry in to his life.
He treats her as his life.
She changed him.
It is only
because of her, he is smiling.
It is only because of her, he has forgotten the past bitter experiences.
She is the first person in his life to influence him so much.
He was the " bhatka hua musafir" and she came as his "manzil".
He threw the cigarette in the dust-bin because of her.
He has cultivated a positive attitude towards marriage and family because of her.
She is the perfect Indian woman he has ever seen.
He keeps a photo of Lord Krishna in his purse now; only because of her (also it is her favorite deity!).
Weekends come and go without his notice; it is only because of her.
He stopped going to office on Weekends; it is only because of her.
Onsite project was his dream; he puts all his efforts now, not to get an onsite assignment but to get a job for her in
Bangalore .
-----------------------------------------------------------------------------------------------------------
The girl depends on the guy as if she never lived and can never live without him.
Guy behaves as if he has taken birth on this earth only to care for that lady.
She treats him as a shoulder to cry and he treats her as a puppy in a rain storm.
She loves to depend and he loves to take care, finally they fall in so called "love",
ultimately adding an unnecessary trauma to life. Girls want a perfect life partner
but they don't want to hurt their parents' feelings, guys know that they can't
get her but still they want to care for her(because they want her to be happy
wherever she is and with whoever she is).Great! Or shall I say crap!
Or I think no need to be so serious about it.
She gets engaged, life goes on...
Long lasting phone calls become short
and sweet, life goes on...
A heart which was used to "Good morning" SMSs learns to be happy with just the "Happy weekend" SMSs, life goes on...
No more "Unread messages" in the yahoo mail, life goes on...
No one to share coffee at "Barista" at the end of a tiring working day, life goes on...
No more consultants' calls to be diverted and life goes on...
He starts smoking again, life goes on...
He is still living in flashback, and no looking back for her, but life goes on...
He gets promoted, he is a manager, she is mother of two kids, and life goes on...
He is in his late twenties, happily married to a beautiful, understanding, mature, caring, broad minded wife! Anyway life goes on...
He LOVED her....but MARRIED another....One became the WIFE,,,another became the PASSWORD,,,...Still LIFE goes on and on...
She : Haan...tha......nk yo....u...was just getting up from the bed.
Friend : Oh! That means I am the first to wish you!
She : Naa! He has already wished me at 12 in the night.
Friend : Who???
She : Come on, who else, Nitin.
Friend : Oh, ok. So, what's the plan for
today?
She : Nitin told me that he has a surprise gift for me for my Birthday.
And also we are going to Flower Show today. I am excited!
I have never seen the flower show that happens in Lal Baug. Actually that itself is the most wonderful gift for me.
-----------------------------------------------------------------------------------------------------------
Friend : "Did you go to Palace grounds all the way from Basavanagudi, to see Bryan Adam's show!!! Who accompanied you?"
She : Nitin
Friend : By the way, who referred your CV in SoCrates? I mean you don't know anyone there, right?
She : No, he forwarded my CV to one of his friends there.
Friend : I heard that the HR round interview went on till 8pm in the night. I think you faced difficulty in returning to your room.
She : No, he had come to pick me up. He came from his office, dropped me to my room and he returned to his room at around 11pm.
He didn't have dinner also. I asked him to have at my room. Poor Nitin.
-----------------------------------------------------------------------------------------------------------
Friend : If you are supposed to go home tomorrow itself then what about reservation?
She : I have told him, he will go to Majestic and would get it done, and he told he has some work in Majestic.
That's why I am relaxed a bit.
-----------------------------------------------------------------------------------------------------------
Friend : How was your written test in Philips?
She : I failed yaar. The day before the test I had prepared perfectly. Nitin had come to our room.
He taught me the basics of embedded programming concepts. I was very confident only because of him.
But something else was in store for me.
Friend : Then, what did you do on Sunday?
She : We had gone to see "Lakshya". He doesn't see Hindi movies. But as I was upset after failing in the Philips written test,
he took me for movie. I was very happy and surprised that he himself decided for a Hindi movie,
and he was very happy that I enjoyed the movie. And you know; we had dinner in Pizza hut.
It was his belated B'day treat!
Friend : And, what was your belated gift ;-)
She : Gift!! I had given the gift on his B'day itself. I was the first to call him at 12 in the night,
he was busy throughout the day, and somehow we could meet in the evening and
I gifted him with a cute time piece with a nice quote on it. He doesn't have time sense,
so my time piece must always remind him of this. That day he didn't give me any treat as
he had to go back to office. Yesterday I had a fight over this, you know! Poor kid.
-----------------------------------------------------------------------------------------------------------
Friend : Hello...what about our sari shopping program in Malleshwaram?
She : Listen, I will call you later.
Friend : You didn't call me back in the morning, so I called now.
She : Yeah, when you called I was in Koramangala, with Nitin. He was very upset in the morning.
He had a fight with his elder brother. So, it wouldn't have been fair on my part to leave him alone.
If I am with him in such situation very soon he comes back to normalcy. So I postponed the Malleshwaram program.
-----------------------------------------------------------------------------------------------------------
Friend : Hey! What happened? You seem to be very happy today.
She : Why not? You know today is one of the most happiest days for me. Nitin got an onsite assignment in
UK , for 6 months! That's why I am very happy. All of his hard work paid today.
He had been waiting for this opportunity since long. He'll be leaving next month.
Friend : You will miss him.
She : Badly. I am so much dependent on him. I must thank Sanju, through him only I got to know Nitin.
Without Nitin it would have been very difficult for me to stay in this alien city with no friends,
relatives and on top of all, no job. He has been so caring friend all through my tough times in this city,
he is so mature, so understanding, so trustworthy...a true friend.
Friend : He loves you yaar.
She : I know.
Friend : And you? Don't you love him?
She : I don't want to.
Friend : Don't tell me. You also feel for him.
She : I know yaar. He has everything that I expect in my dream-life-partner.
I know I can never get a true life partner like him. But I don't want to commit.
Friend : What is stopping you? I really don't understand. When Miya-beevi are razi kya karega kazi?
She : Please...don't say like that. I never told him that I love him or something like that.
Friend : Is he a fool not to
understand your feelings which are so clear from outside only? Poor fellow, don't leave him alone.
She : I have told him everything about my family. He knows how orthodox my parents are.
They can never expect me marrying a guy from a different caste. They trust me. Come what may,
I will not hurt my parent's feelings. I cannot imagine also. Now they are happily searching a guy for me in my native place.
Friend : Hmm, I don't understand at all.
-----------------------------------------------------------------------------------------------------------
She : This Saturday I have to go home, a guy is coming to see me.
Friend : Oh! Is it? Good news yaar. Your first interview! Wish you all the best.
Friend : Any guesses, who is he?
She : Please yaar. I am least bothered and least interested. For the sake of my parents' happiness I have agreed for this.
-----------------------------------------------------------------------------------------------------------
Friend : What about the interview, I was expecting your call actually?
She : Nothing so special. I didn't like the guy's attitude. I told my parents clearly.
My parents are very understanding and so they too told me that they won't go ahead with this matter.
Friend : But still you should have analyzed properly.
She : I shared my views with Nitin. He had
called me the next day. He didn't suggest me anything. He didn't tell me to say "yes" or "no",
he didn't preach what is right or what is wrong. But after talking to him I was satisfied that whatever decision I took was right.
-----------------------------------------------------------------------------------------------------------
Friend : Yesterday your mobile was engaged for more than half an hour. I kept trying, but I slept after 11pm.
She : Yeah, I was talking to Nitin. He is very much worried about my marriage.
He is concerned whether I would get a guy of my choice or not, whether I would be happy with him or not.
I was very sad to know this. But I am helpless. I pacified him and convinced that whatever my parents do,
that will be the best for me, so no need to worry.
Friend
: How Nitin will feel after you get married? Will he not be upset all the time?
She : Time will change everything. He will start living again. Was he not leading a normal life before
I came into his life? It's all matter of time. Even I can't do anything other than pacifying him and
myself with these philosophical statements.
-----------------------------------------------------------------------------------------------------------
Finally " She" got engaged with a guy of her parent's choice (with her "yes" of course).
She is in touch with both Nitin and the new "him" regularly through chatting in Yahoo Messenger.
Finally " She" got happily married to "him", very soon
converting Nitin into memories, but deleting the memories was slow and almost impossible for Nitin.
-----------------------------------------------------------------------------------------------------------
Why do girls do like this?
She needs him when she is new to the city.
She needs his help in finding out a PG or hostel for her
She makes him prepare a good-format-CV for her
She needs him to drop her to the venue of a walk-in interview
She expects him to collect all the consultants' mail ids
She needs him while preparing for the interviews
She needs his help in identifying HER skill sets, strengths and weakness!
She wants him to conduct a mock-interview for her!
She gives her yahoo mail id password so that he can forward her CV to consultants through internet in his office (in office hours!)
She needs him for boosting her confidence when she fails in the 1
st written test in her life
She wants him to take her to M.G Road , Brigade Road, Forum and Big bazaar
She needs his company while visiting all the temples in Malleshwaram on Vijayadashami, though he is not a believer of God.
She asks his opinions on importance of marriage
She wants him to be a shoulder to cry when her parents force her for marriage
She needs his help in preparing her mind for the first interview with a guy
She needs his help in deciding about the marriage proposal
She loves to share her happiness with him when she gets engaged
She expects him to attend her marriage (Come on guys, he is a true friend of her!)
The guy does all this honestly, without saying a single "No".
He loves her.
He cares for her.
Whatever he is today; it is only because of her entry in to his life.
He treats her as his life.
She changed him.
It is only
because of her, he is smiling.
It is only because of her, he has forgotten the past bitter experiences.
She is the first person in his life to influence him so much.
He was the " bhatka hua musafir" and she came as his "manzil".
He threw the cigarette in the dust-bin because of her.
He has cultivated a positive attitude towards marriage and family because of her.
She is the perfect Indian woman he has ever seen.
He keeps a photo of Lord Krishna in his purse now; only because of her (also it is her favorite deity!).
Weekends come and go without his notice; it is only because of her.
He stopped going to office on Weekends; it is only because of her.
Onsite project was his dream; he puts all his efforts now, not to get an onsite assignment but to get a job for her in
Bangalore .
-----------------------------------------------------------------------------------------------------------
The girl depends on the guy as if she never lived and can never live without him.
Guy behaves as if he has taken birth on this earth only to care for that lady.
She treats him as a shoulder to cry and he treats her as a puppy in a rain storm.
She loves to depend and he loves to take care, finally they fall in so called "love",
ultimately adding an unnecessary trauma to life. Girls want a perfect life partner
but they don't want to hurt their parents' feelings, guys know that they can't
get her but still they want to care for her(because they want her to be happy
wherever she is and with whoever she is).Great! Or shall I say crap!
Or I think no need to be so serious about it.
She gets engaged, life goes on...
Long lasting phone calls become short
and sweet, life goes on...
A heart which was used to "Good morning" SMSs learns to be happy with just the "Happy weekend" SMSs, life goes on...
No more "Unread messages" in the yahoo mail, life goes on...
No one to share coffee at "Barista" at the end of a tiring working day, life goes on...
No more consultants' calls to be diverted and life goes on...
He starts smoking again, life goes on...
He is still living in flashback, and no looking back for her, but life goes on...
He gets promoted, he is a manager, she is mother of two kids, and life goes on...
He is in his late twenties, happily married to a beautiful, understanding, mature, caring, broad minded wife! Anyway life goes on...
He LOVED her....but MARRIED another....One became the WIFE,,,another became the PASSWORD,,,...Still LIFE goes on and on...
Draw a thin line between UR professional and personal life ...
This one touched me very much.....
The cell-phone beeped, just enough to grab the attention of the totally engrossed Mithun who was trying hard to fix an issue in the code that he had just written. The message of course stole a portion of his attention as it was from his better-half Diya and it just said 'Honey, I have met with a minor accident, nothing to worry I am on my way back' home.
"Mithun, you got to hurry the boss is already at his seat, I hope you are done with the presentation" was the curt reminder call given by his Lead. Mithun who was about to dial Diya's number had to momentarily postpone the enquiry call!!!!
Hurrying his eyes through the monitor he took a final look at his ppt.Reaching the conference room Mithun hardly knew that the session would take away his time and memory enough to even forget that he was to ask Diya how she was!!!!
It was a usance for Mithun to give a daily evening call to Diya. The cell rang and by the ringtone Diya knew it was Mihtun's call. Excitedly walking towards the cell, she opened the flip of her phone and said a 'Hello' in a tone enough for even a lame man to know she needed someone to cheer her up. 'Hi, what's my baby doing, don't ask me I am going nuts trying to fix this code, I don't know if I'll be able to complete this module even today' Mithun said. There was a long drawn silence from Diya's end.
"Hello, You there"
"You forgot"
"Forgot what?" Mithun had still not gathered from the hint.
"Never mind forget it, what time are you coming home?"
"No tell me, what happened? I am sorry I am really stressed out, Please…What happened" was all Mithun said.
"My accident, you forgot so soon, what If I had really injured myself,Godddd how can you be so uncaring"
Mithun knew he had called for yet another hen-pecking session from Diya, but he truly regretted for having totally forgotten about it.
"When will you ever understand It's not always your work, don't I mean anything to you, just tell me, you always do this"
"Look I can't fight when I am here at office" was what Mithun whispered in return and the phone went blank on Diya's end.
As she slowly closed the flap of her cell, an unknown fear sank in Diya's heart. Where was her marriage heading? This was not the same Mithun she knew during her college days even a sneeze would have called for a dozen medical counseling!
That day Mithun returned at 5a.m in the morning, and saw Diya snug fast asleep in the mink blanket. She looked as cute and warm as ever. Whatever she did or said had never failed to loose even an ounce of Mithun's love.
Slowly tiptoeing across the room, he reached up to her forehead and planted a feathery kiss.
Mithun sank in his arm chair slowly getting lost in issues that definitely needed his thinking. He was getting more stressed at his work; he too had begun to realize that there had to be an end to all that. He was working like a maniac, No food ,no sleep, Traffic jams on the way back home,' THE MACHINE' had taken over his life. By the end his long thought process Mithun had decided something concrete. Something that would change everything from then on.
Diya was always the first to return home from work, the next day trying to unlock the door a lot of times, Diya suddenly got scared who it could be inside her house at 6.30p.m!!!! Had someone found the secret place where she kept keys for Mithun when he returned late in the morning at times!!! Frantically searching for her cell in her purse, she finally reached for it and dialed Mithun's number.
'The Hutch number you have called is busy, Please try again later'
Diya thought Mithun was in 'YET ANOTHER' one of his company meetings!!!
Just then the door went 'Click!! Clack!!'OPEN and it was Mithun standing there.
"How tough was it for you to understand that if the door is not locked by the keys and hatched from inside then it has got to be me" Mithun grinned as he said this.
Diya was surprised he was home by 6.30!!! The earliest he had ever returned was 8.30p.m!!!
"How come you are back so soon?" "You Ok?"
"Of course how do I look?" Mithun snapped back…
"Forget all that now and tell me how much more time you are going to take for getting ready?"
"Ready, for what?" Diya queried.
"Got tickets for Pirates of Caribbean, 7.15 show, so…"
"Coolll, will be right back" Diya said chirpily.
As she entered her room,She found a huge box of her favorite chocolates. She came out and
"Kinna, who gave you this box of chocolates" Kinna was the name she used to call Mithun, when she was all in lovey-dovey mood. Moving across to her and giving her a cozy hug "Actually one of my admirers gave me, but I have been good enough to give it to you" he said with a wink in his eyes.
"Yeah right! It's not good to give one's gift to another and by the way for this partly bald and grey haired husband of mine I assume even an admirer would give nothing more than a hair dye or a wig" Diya laughed.
"Very funny, I got it and it's for you, really sorry about yesterday, I don't know how it slipped out of my mind so easily, but I am really thankful to god that you are perfectly allright"Mithun said.
"Thank you, you always make me feel so special, I guess I should have been more understanding" Diya replied back and gave Mithun a warm hug, with a smile on her lips. She had realized that Nature had taught her lesson to Mithun.
All our lives are closely related to the story above, it's in our hands to draw a thin line between professional and personal lives and plan and organize things in such a way to know where former ends and the latter begins.
"Mithun, you got to hurry the boss is already at his seat, I hope you are done with the presentation" was the curt reminder call given by his Lead. Mithun who was about to dial Diya's number had to momentarily postpone the enquiry call!!!!
Hurrying his eyes through the monitor he took a final look at his ppt.Reaching the conference room Mithun hardly knew that the session would take away his time and memory enough to even forget that he was to ask Diya how she was!!!!
It was a usance for Mithun to give a daily evening call to Diya. The cell rang and by the ringtone Diya knew it was Mihtun's call. Excitedly walking towards the cell, she opened the flip of her phone and said a 'Hello' in a tone enough for even a lame man to know she needed someone to cheer her up. 'Hi, what's my baby doing, don't ask me I am going nuts trying to fix this code, I don't know if I'll be able to complete this module even today' Mithun said. There was a long drawn silence from Diya's end.
"Hello, You there"
"You forgot"
"Forgot what?" Mithun had still not gathered from the hint.
"Never mind forget it, what time are you coming home?"
"No tell me, what happened? I am sorry I am really stressed out, Please…What happened" was all Mithun said.
"My accident, you forgot so soon, what If I had really injured myself,Godddd how can you be so uncaring"
Mithun knew he had called for yet another hen-pecking session from Diya, but he truly regretted for having totally forgotten about it.
"When will you ever understand It's not always your work, don't I mean anything to you, just tell me, you always do this"
"Look I can't fight when I am here at office" was what Mithun whispered in return and the phone went blank on Diya's end.
As she slowly closed the flap of her cell, an unknown fear sank in Diya's heart. Where was her marriage heading? This was not the same Mithun she knew during her college days even a sneeze would have called for a dozen medical counseling!
That day Mithun returned at 5a.m in the morning, and saw Diya snug fast asleep in the mink blanket. She looked as cute and warm as ever. Whatever she did or said had never failed to loose even an ounce of Mithun's love.
Slowly tiptoeing across the room, he reached up to her forehead and planted a feathery kiss.
Mithun sank in his arm chair slowly getting lost in issues that definitely needed his thinking. He was getting more stressed at his work; he too had begun to realize that there had to be an end to all that. He was working like a maniac, No food ,no sleep, Traffic jams on the way back home,' THE MACHINE' had taken over his life. By the end his long thought process Mithun had decided something concrete. Something that would change everything from then on.
Diya was always the first to return home from work, the next day trying to unlock the door a lot of times, Diya suddenly got scared who it could be inside her house at 6.30p.m!!!! Had someone found the secret place where she kept keys for Mithun when he returned late in the morning at times!!! Frantically searching for her cell in her purse, she finally reached for it and dialed Mithun's number.
'The Hutch number you have called is busy, Please try again later'
Diya thought Mithun was in 'YET ANOTHER' one of his company meetings!!!
Just then the door went 'Click!! Clack!!'OPEN and it was Mithun standing there.
"How tough was it for you to understand that if the door is not locked by the keys and hatched from inside then it has got to be me" Mithun grinned as he said this.
Diya was surprised he was home by 6.30!!! The earliest he had ever returned was 8.30p.m!!!
"How come you are back so soon?" "You Ok?"
"Of course how do I look?" Mithun snapped back…
"Forget all that now and tell me how much more time you are going to take for getting ready?"
"Ready, for what?" Diya queried.
"Got tickets for Pirates of Caribbean, 7.15 show, so…"
"Coolll, will be right back" Diya said chirpily.
As she entered her room,She found a huge box of her favorite chocolates. She came out and
"Kinna, who gave you this box of chocolates" Kinna was the name she used to call Mithun, when she was all in lovey-dovey mood. Moving across to her and giving her a cozy hug "Actually one of my admirers gave me, but I have been good enough to give it to you" he said with a wink in his eyes.
"Yeah right! It's not good to give one's gift to another and by the way for this partly bald and grey haired husband of mine I assume even an admirer would give nothing more than a hair dye or a wig" Diya laughed.
"Very funny, I got it and it's for you, really sorry about yesterday, I don't know how it slipped out of my mind so easily, but I am really thankful to god that you are perfectly allright"Mithun said.
"Thank you, you always make me feel so special, I guess I should have been more understanding" Diya replied back and gave Mithun a warm hug, with a smile on her lips. She had realized that Nature had taught her lesson to Mithun.
All our lives are closely related to the story above, it's in our hands to draw a thin line between professional and personal lives and plan and organize things in such a way to know where former ends and the latter begins.
Don't Blame anyone for mistakes ...
A Boy was born to a couple after eleven years of marriage. They were a loving couple and the boy was the gem of their eyes. When the boy was around two years old, one morning the husband saw a medicine bottle open.
He was late for office so he asked his wife to cap the bottle and
keep it in the cupboard. His wife, preoccupied in the kitchen totally forgot the matter.
The boy saw the bottle and playfully went to the bottle fascinated by its color and drank it all. It happened to be a poisonous medicine meant for adults in small dosages.
When the child collapsed the mother hurried him to the hospital, where he died. The mother was stunned. She was terrified how to face her husband.
When the distraught father came to the hospital and saw the dead child he looked at his wife and uttered just five words.
He was late for office so he asked his wife to cap the bottle and
keep it in the cupboard. His wife, preoccupied in the kitchen totally forgot the matter.
The boy saw the bottle and playfully went to the bottle fascinated by its color and drank it all. It happened to be a poisonous medicine meant for adults in small dosages.
When the child collapsed the mother hurried him to the hospital, where he died. The mother was stunned. She was terrified how to face her husband.
When the distraught father came to the hospital and saw the dead child he looked at his wife and uttered just five words.
QUESTIONS:
1. What were the five words?
2. What is the implication of this story?
Scroll down for the Answer...
ANSWER :
The husband just said" "I am with you Darling"
The husband's totally unexpected reaction is a proactive behavior. The child is dead. He can never be brought back to life. There is no point in finding fault with the mother.
Besides, if only he had taken time to keep the bottle away,
this would not have happened.
No one is to be blamed. She had also lost her only child.
What she needed at that moment was consolation and sympathy
from the husband. That is what he gave her.
If everyone can look at life with this kind of perspective, there would be much fewer problems in the world.
"A journey of a thousand miles begins with a single step."
Take off all your envies, jealousies, unforgiven, selfishness, and fears. And you will find things are actually not as difficult as you think.
MORAL OF THE STORY :
Sometimes we spend time in asking who is responsible or whom to blame, whether in a relationship, in a job or with the people we know. By this way we miss out some warmth in human relationship.
Keep Going
One day I decided to quit...
I quit my job, my relationship, my spirituality... I wanted to quit my life.
I went to the woods to have one last talk with God.
"God," I said. "Can you give me one good reason not to quit?"
His answer surprised me...
"Look around," He said. "Do you see the fern and the bamboo?"
"Yes," I replied.
"When I planted the fern and the bamboo seeds, I took a very good care of them. I gave them light. I gave them water.
The fern quickly grew from the earth. Its brilliant green covered the floor. Yet nothing came from the bamboo seed. But I did not quit on the bamboo.
In the second year, the fern grew more vibrant and plentiful. And again, nothing came from the bamboo seed. But I did not quit on the bamboo," He said.
"In the third year, there was still nothing from the bamboo seed. But I would not quit. In the fourth year, again, there was nothing from the bamboo seed. I would not quit," He said
"Then in the fifth year a tiny sprout emerged from the earth. Compared to the fern it was seemingly small and insignificant... But just 6 months later the bamboo rose to over 100 feet tall.
It had spent the five years growing roots.
Those roots made it strong and gave it what it needed to survive. I would not give any of my creations a challenge it could not handle."
He said to me. "Did you know, my child, that all this time you have been struggling, you have actually been growing roots?"
"I would not quit on the bamboo. Neither will I ever quit on you."
"Don't compare yourself to others," He said. "The bamboo had a different purpose than the fern. Yet, they both make the forest beautiful."
"Your time will come," God said to me. " You will rise high! "
"How high should I rise?" I asked.
"How high will the bamboo rise?" He asked in return.
"As high as it can?" I questioned.
"Yes," He said. "Give me glory by rising as high as you can."
I left the forest and bring back this story. I hope these words can help you see that God will never give up on you. He will never give up on you.
Never regret a day in your life.
Good days give you happiness
Bad days give you experiences;
Both are essential to life.
I quit my job, my relationship, my spirituality... I wanted to quit my life.
I went to the woods to have one last talk with God.
"God," I said. "Can you give me one good reason not to quit?"
His answer surprised me...
"Look around," He said. "Do you see the fern and the bamboo?"
"Yes," I replied.
"When I planted the fern and the bamboo seeds, I took a very good care of them. I gave them light. I gave them water.
The fern quickly grew from the earth. Its brilliant green covered the floor. Yet nothing came from the bamboo seed. But I did not quit on the bamboo.
In the second year, the fern grew more vibrant and plentiful. And again, nothing came from the bamboo seed. But I did not quit on the bamboo," He said.
"In the third year, there was still nothing from the bamboo seed. But I would not quit. In the fourth year, again, there was nothing from the bamboo seed. I would not quit," He said
"Then in the fifth year a tiny sprout emerged from the earth. Compared to the fern it was seemingly small and insignificant... But just 6 months later the bamboo rose to over 100 feet tall.
It had spent the five years growing roots.
Those roots made it strong and gave it what it needed to survive. I would not give any of my creations a challenge it could not handle."
He said to me. "Did you know, my child, that all this time you have been struggling, you have actually been growing roots?"
"I would not quit on the bamboo. Neither will I ever quit on you."
"Don't compare yourself to others," He said. "The bamboo had a different purpose than the fern. Yet, they both make the forest beautiful."
"Your time will come," God said to me. " You will rise high! "
"How high should I rise?" I asked.
"How high will the bamboo rise?" He asked in return.
"As high as it can?" I questioned.
"Yes," He said. "Give me glory by rising as high as you can."
I left the forest and bring back this story. I hope these words can help you see that God will never give up on you. He will never give up on you.
Never regret a day in your life.
Good days give you happiness
Bad days give you experiences;
Both are essential to life.
How to recover password in PostgreSQL ?
- If password is not provided for the super user while installing postgresql, it can be changed by following steps:
- Open pg_hba.conf, change authentication method to trust.
- Restart Database Server
- Login into psql. (# psql -d <database name> -U <super user>
- Inside psql prompt,Alter role <rolename> with password 'yourpassword';
- Then quit. Now change trust authentication to md5 in pg_hba.conf.
- Restart Database Server
- Now, while log in to psql, you need to supply password while prompting.
- By default, authentication method of postgres is by ident_user type. Change it to md5 or trust in pg_hba.conf file. Md5 is recommended.
Labels:
PostgreSQL
Secure your Apache Hostings
Some Important ways to secure your hosting servers :
1)Configure Apache to right
Most of the problems arise from improper configuration of the apache web server. Please take note on
a) ServerSignature (Off)
b) ServerTokens (Prod)
c) AllowOverride (None, have this configured to all only to the necessary folders)
d) Options (Only FollowSymlinks)
directives.
2) Enable SSL
3) Strict Permission levels.
Let the apache user can have only Read and execute permissions and the hosted folders and allow write permissions only to necessary folders. Let root user hold the ownership of the folders and files and add apache user to group.
4) Separate Virtual Hosts
Provide virtual hosts to each application and their document root is the application folder alone. From this virtual host, no other folders or applications should be accessed.
5) File Downloads
Force Files to be downloaded and viewed instead of displaying it in the browser itself.
File Extension Testing Module
In Drupal 6, Whenever you try to upload a file, it checks only the extension from file name. I found this by trying this :
1) Create a file with some HTML contents and save it as .pdf or .jpg.
2) Upload it to drupal whose allowed extensions are jpg, pdf.
3) It will upload the files. This is wrong.
To Overcome this, i have written a module which is shown below :
filevalidate.php
<?php
function filevalidateinit($node_type, $form) {
$field_obj = $form['field_file'];
$cnt = count($form['nid']['#post']['field_file']);
$file_field = 'field_form_upload';
file_upload_validation($field_obj, $cnt, $file_field);
}
common.php
<?php
function file_upload_validation($field_obj, $cnt, $field_name) {
$finfo = finfo_open(FILEINFO_MIME, "/usr/share/misc/magic.mgc");
if (!$finfo) {
echo "Opening fileinfo database failed";
exit();
}
/* get mime-type for a specific file */
for ($i=0;$i<$cnt;$i++) {
$filepath = $field_obj[$i]['#value']['filepath'];
$filename = $field_obj[$i]['#value']['filename'];
$mimetyy = finfo_file($finfo, $filepath, FILEINFO_MIME_TYPE);
$tyy = explode("/", $mimetyy);
$path_info = pathinfo($filepath);
$extt = $path_info['extension'];
if($extt === $tyy[1]) { }
else {
file_set_status(&$filename, FILE_STATUS_TEMPORARY);
//file_delete($filename);
form_set_error($field_name, $filename." is not a ".$extt." Format");
}
}
/* close connection */
finfo_close($finfo);
}
security.module
<?php
function filevalidateinit($node_type, $form) {
$field_obj = $form['field_file'];
$cnt = count($form['nid']['#post']['field_file']);
$file_field = 'field_form_upload';
file_upload_validation($field_obj, $cnt, $file_field);
}
common.php
<?php
function file_upload_validation($field_obj, $cnt, $field_name) {
$finfo = finfo_open(FILEINFO_MIME, "/usr/share/misc/magic.mgc");
if (!$finfo) {
echo "Opening fileinfo database failed";
exit();
}
/* get mime-type for a specific file */
for ($i=0;$i<$cnt;$i++) {
$filepath = $field_obj[$i]['#value']['filepath'];
$filename = $field_obj[$i]['#value']['filename'];
$mimetyy = finfo_file($finfo, $filepath, FILEINFO_MIME_TYPE);
$tyy = explode("/", $mimetyy);
$path_info = pathinfo($filepath);
$extt = $path_info['extension'];
if($extt === $tyy[1]) { }
else {
file_set_status(&$filename, FILE_STATUS_TEMPORARY);
//file_delete($filename);
form_set_error($field_name, $filename." is not a ".$extt." Format");
}
}
/* close connection */
finfo_close($finfo);
}
security.module
<?php
require_once('common.php');
function security_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'validate':
include_once ('php/filevalidate.php');
filevalidateinit($node->type, $a3);
}
}
require_once('common.php');
function security_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'validate':
include_once ('php/filevalidate.php');
filevalidateinit($node->type, $a3);
}
}
Hope this helps you.
Monday, July 4, 2011
How to install Mysql 4 on Ubuntu 8.04
Download and install mysql 4.1 server and client from debian packages
Then Stop mysql service (if running)
Create the directory /var/run/mysqld and change the ownership to mysql user
$ mkdir /var/run/mysqld
$ chown -R mysql:mysql /var/run/mysqld/
$ chown -R mysql:mysql /var/run/mysqld/
Edit my.cnf and mysql_config(if installed) and change the socket value
$ vi /etc/my.cnf
change socket to /var/run/mysqld/mysqld.sock
$ vi /usr/local/mysql/bin/mysql_config
change socket to /var/run/mysqld/mysqld.sock
change socket to /var/run/mysqld/mysqld.sock
$ vi /usr/local/mysql/bin/mysql_config
change socket to /var/run/mysqld/mysqld.sock
Start mysql service.
How to recover mysql Password ?
When Installing Mysql on Linux, sometimes it will not prompt for passwords (eg: ssh installation), in such cases you can recover the password by:
1) Stop the mysql service
2) Run mysqld_safe ----skip-grant-tables
3) Then use mysql -u root and loginto the database
4) Then use the update command to change the password :
mysql> update user set password=PASSWORD("NEW-PASSWORD") where User='root';
5) Quit and stop mysqld_safe.
6) Start the mysql Service.
Subscribe to:
Posts (Atom)