Archive

Archive for January, 2012

Agnipath Poem in Hindi – अग्निपथ कविता

January 29, 2012 12 comments

आदरणीय श्री हरिवंश राय बच्चन जी की कविता “अग्निपथ”

वृक्ष हो भले खड़े, हो घने हो बड़े, एक पत छाव की |
मांग मत, मांग मत, मांग मत ||
अग्निपथ, अग्निपथ, अग्निपथ |||

तू न थकेगा कभी, तू न थमेगा कभी, तू न मुड़ेगा कभी |
कर शपथ, कर शपथ, कर शपथ ||
अग्निपथ, अग्निपथ, अग्निपथ |||

ये महान दृश्य है, चल रहा मनुष्य है, अश्रु स्वेद रक्त से |
लथपथ, लथपथ, लथपथ ||
अग्निपथ, अग्निपथ, अग्निपथ |||

श्री बच्चन जी को शत शत वंदन.

Simple Java AD/LDAP Authenticaion Code

January 20, 2012 Leave a comment

There are so much of code and reference available for AD/LDAP integration in Java. I also searched a lot and the below code worked for me.
As a non-java developer I found so interesting while working on some complex java stuff.

 

import java.util.*;
import javax.naming.*;
import javax.naming.directory.*;
public class ADTestNew {
    public static void main(String[] args) {
    try {
        Hashtable env = new Hashtable();

        env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");

        env.put(Context.PROVIDER_URL,"ldap://192.168.100.225:389"); //replace with your server URL/IP

        // This line is optional based on environment. You can try with comment or without comment also.
        env.put(Context.SECURITY_AUTHENTICATION,"DIGEST-MD5"); //No other SALS worked with me

        env.put(Context.SECURITY_PRINCIPAL,"login"); // the user name.

        env.put(Context.SECURITY_CREDENTIALS, "Passw0rD"); //the password.

        DirContext ctx = new InitialDirContext(env);

        ctx.close();

    } catch(NamingException ne) {
        System.out.println("Error authenticating user:");
        System.out.println(ne.getMessage());
        return;
    }
    //if no exception, the user is already authenticated.
    System.out.println("OK, successfully authenticating user");
    }
}

Happy Java.

2011 in review

January 1, 2012 Leave a comment

The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.

Here’s an excerpt:

Madison Square Garden can seat 20,000 people for a concert. This blog was viewed about 61,000 times in 2011. If it were a concert at Madison Square Garden, it would take about 3 sold-out performances for that many people to see it.

Click here to see the complete report.

Categories: General, me Tags: , ,
Follow

Get every new post delivered to your Inbox.