Saturday, May 28, 2011

WHO AM I

Journey of life begins with quest.
The day we are BORN our parents are asked A boy or a Girl ???
Stepping in our life we are stamped with most common question.
It is -- WHO AM I ??

We grow up ,We are asked our name..!!!
Religion - Hindu, Muslim, Sikh or Christian (where's Humanity !!!)
We reply with ease the name given by our parents
But do we know --- WHO AM I?

We start our studies to gain knowledge,
Continues studying to be at top
To show to teacher the best among all
But do we know -- WHO AM I?

We come to college and we go for specialization
Nothing just to prove self to get JOB
But in interview the foremost and most important question pop ups -- Tell be about yourself ?
Either way -- WHO AM I?

We meet people of our age group who becomes our life,
Whom we call FRIENDS.
We spend time with them and loose our self.
What remains is --- WHO AM I?

In our adolescence teenage age we fall in love
Do everything possible and put effort for impossibles as well.
We even forget about our ego.
But what we forget is --- WHO AM I?

We get married and live as two bodies one SOUL
We start a new life and settling a new course of life
We are blessed with babies and start thinking about their life and their future
But on the whole there remains -- WHO AM I?

A day will come when we will be lying on our death bed
Lot many people surrounding us
Few crying and few to make their presence.
Words will be shared either good or bad
(Generally they speak good of you although in their whole lifetime they might have hated you the most...!!! Strange but TRUE)

LIFE ends but unanswered ---- WHO AM I .....??????

Before it's too late, try to find...
WHO R U...??? 

Monday, May 16, 2011

Confused

In day to day life we come across many people. Few stay back and few leave us. Seldomly we meet who changes many things around us in a single instance of time. They make u go crazy, some make u curious and some make u lose urself and some gives mixed feelings and so on.
Fewdays back I met a similar person. That person changed my thoughts .
I felt something and followed.it .
Giving it a serious thought first question arose was --- Am I Correct ????

For me it was different, it kept in puzzled @#$!!
Still trying to figure it out Am I Correct ????

But there are things I FeeL !!!
I think of it most of d time,but don't want to talk about it....
I want to run behind it, but don't want to follow it....
I want it,but i don't want to put effort for it...
I FeeL !!!
I want to play, but don't want to make fun of it...
I want to run away from it,but still go behind it....
I want to write about it, but i don't want to think more about it....

But  I'm CONFUSED- "I FeeL"

Wednesday, February 23, 2011

Certain - Uncertain

Time is the only constant that moves with its own pace, rest all is variant. Today might not be the same as it was yesterday and may not be the same tomorrow, changes occur in few seconds as well. Time brings changes and change brings experiences. Even knowing the Changes(challenges) we resists it, and by the time we realize it, its too late.
Having given a thought about this i felt few aspects that we think, act or possess.

certain
we are here
uncertain
we will be here ?
certain
time passes by so fast
uncertain
can we make it last ?
certain
we got a life
uncertain
do we know when will we die ?
certain
working hard is a key to success
uncertain
Does everyone posseses ?
certain
work pays indeed
uncertain
Do we have friend in need ?
certain
death is certain, why make life in vain....?
and what is uncertain
the one who knows this, SUSTAINS.....!!!!


Before its too late we should accept the desirable "CHANGE".
Think before you act, as its a quest of survival -"BEST".

Regards,
Gaurav

Tuesday, December 14, 2010

Golden Era : School Life

After a long time i would like all to gather,
To enlighten the memorable time we spent all together.

To rejoice the past we lived,
Which wont be re-kindled.
To the time which is the most cherished one,
Without any restrictions.

After a long time i would like all to gather......,

When meeting you soon, meant a gap of few hours,
That today turned into a matter of days and their powers.
Once again, let's go back to the same time,
when we played “pakadam pakdai” , in the meal time.

After a long time i would like all to gather......,

To those days when we played truth & dare,
Which was just to spend the time we always had in spare.
To those time when Sadhana Ma'am taught us Hindi,
Which felt like paying for the punishment which we were not guilty.

After a long time i would like all to gather......,

To the time when we have to study Computer,
Of whom Anand Sir was the only tutor.
It was a time when we studied maths by Ranjan Sir,
Who made it a lot easier.

After a long time i would like all to gather......,

To the day when almost everyone failed in Biology,
And later complaining about Renu Ma’am psychology.
It was a time when Digvijay sir taught us Physics,
Who use to dwell himself in "laal chari maidaan khari" lyrics,

After a long time i would like all to gather......,

To the time when Kusum Ma'am taught us English,
Like Julius Caesar, Images of life & figments of imagination seemed rubbish.
To those days when Sabeena Ma'am taught us Chemistry,
Which was like a organic  & inorganic hell full of chemical mystery.

After a long time i would like all to gather,
To enlighten the memorable time we spent all together.

Bringing a small tribute to those beautiful time and memory,
All yours Gaurav urf Gandhi.....


Friday, December 10, 2010

Journey : Enginering till Joining Date.....

Getting into engineering stream,
Was like a dream.
But getting job while pursuing,
Was like sweet over a full diet meal.
Even though we had troubles,
But my dear friend, just wait for the ball to dribble.
Feel the day will come soon,
When our time will be at boom.
Today after a long break,
i got my placement cake.
So much of waiting is over as of now,
And the time came to say WOW...!
By the time i enjoyed the spark,
i was drowned in another dark.
Its again the waiting of few months,
That will soon come to an end.
Hope the days will past by soon,
Just like sunrise after the dark night without moon.......!

Thursday, October 7, 2010

Configuring Realm


Hi,

After you have decided the type of connection(jdbc or file) you have to configure your realm as

Creating custom realm -------
1. Go to GlassFish(GF) admin Console http://localhost(IP):4848/.
2. Left panel Configuration --> Security --> Realm
tht will look like the image SERVERREALM
3. Right Panel Click New
4. Give any name you like just as MyRealm



5. ClassName you can use predefined class or provide your own class name.
6. Provide JAAS_CONTEXT as sampleRealm
this is the name same as u provide in
/SUNWappserver/domains/domain1/config/login.conf
sampleRealm {
complete path custom login module with required;
};
7. Now place this custom Class file making the proper packaged jar of
loginModule and RealmClass(If Custom Realm).
Put this jar in the /home/gaurav/SUNWappserver/lib
8. Now Restart the server.

Custom Login Module

import com.sun.appserv.security.AppservPasswordLoginModule;
import com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm;
import javax.security.auth.login.LoginException;

/**
* Class SimpleCustomLogin is used for designing our own custom module
* it extends a class provided by GF server that helps us authenticating the user
* Using this we need to take care of single method authenticateUser() that will
* have our logic to confirm about the user.
*/
public class SimpleCustomLoginModule extends AppservPasswordLoginModule {

public SimpleCustomLoginModule() {

//maintaining the log to ensure that our LoginModule is initialized.
log("SimpleCustomLoginModule: Initialization");

}//end of constructor

/**
* this method helps us maintain server log
* so that we can make amendments according to our need
* and it also helps determining the flow.
*/
private void log(String s) {
System.out.println((new StringBuilder())
.append("SimpleCustomLoginModule::").append(s).toString());
}//end of log()

/**
* This is the method we need to overrdide which will have our LOGIC for
* authentication .In this we are using the DATABASE as backend for user.
* So we need to use the JDBCRealm ( Realm - is a set of roles of user
* with their respective users to know more about realm check this out
* http://download.oracle.com/javaee/5/tutorial/doc/
* OR
* http://download-llnw.oracle.com/javaee/6/tutorial/doc/bncas.html).
* Now we need to configure this realm in
* our web.xml under login-config tag from where the server retrieves it.
* Also maintaining evrything in the server log as well.
* We paas authenticated user group(roles here) to commitUserAuthentication
* method for authorization.

*/
@Override
protected void authenticateUser() throws LoginException
{
System.out.println("in authenticate user.....");
//getting the instance of current realm as JDBCRealm
JDBCRealm samplerealm = (JDBCRealm)_currentRealm;
System.out.println("jdbc realm as ....." +samplerealm);

/**
* Checking the instance of the realm whether its taking our JDBC realm
* or not. This will load the user's from database with their name,
* password and roles. Else if not will throw LoginException.
*/
if ( !( _currentRealm instanceof JDBCRealm ) ) {
String msg = sm.getString("filelm.badrealm");
System.out.println("not instance of jdbc realm ....");
throw new LoginException(msg);
}

/**
* Here we get the user's roles from the database in grplist array.
* But here we get only one element in the array.So we need to check.
* Since the value stored in table is in form of varchar(simple strings)
* as roles -- "user,test,......so on"
* Hence we separate it later in groupListToForward.
*/
String[] grpList = samplerealm.authenticate(_username, _password);
System.out.println("username " + _username + "password " + _password);
System.out.println("length from jdbc authenticate ... groups are.." + grpList);

/**
* This id to check whether the user group(role) is null or not.
*/
if ( grpList == null ) { // JAAS behavior
String msg = sm.getString("filelm.faillogin", _username);
throw new LoginException(msg);
}//endif


/**
* make a copy of groupList to pass to LoginModule.
* DO NOT PASS the grpList as is - as it will get overwritten.
* Resulting in logins passing only once.
* In the above grouplist we get only string with multiple user's role.
* grplist value will be like "user,weballow,test"
* But here we split them into multiple roles as roles as
* 1. user 2. weballow 3. test
* That will be passed for proper authorization.
*/
String[] groupListToForward = grpList[0].toString().split(",");
System.out.println("values of group array ..." + groupListToForward.length);
for (int i = 0; i< groupListToForward.length; i++) {
System.out.println("value of groups " + groupListToForward[i].toString());
 }
System.out.println("calling commit...");
commitUserAuthentication(groupListToForward);
  }//end of authernticateUser()

}//end of SimpleCustomLoginModule