Archive for January, 2008

LDAP Authentication using Java

Hier ist ein Stück Javacode mit dem man eine LDAP Authentifizierung realisieren kann:


import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;

/**
 * Demonstrates how to create an initial context to an LDAP server
 * using simple authentication.
 */

class Simple {
    public static void main(String[] args) {
    	Hashtable authEnv = new Hashtable(11);
    	String userName = "johnlennon";
    	String passWord = "sushi974";
    	String base = "ou=People,dc=example,dc=com";
    	String dn = "uid=" + userName + "," + base;
    	String ldapURL = "ldap://ldap.example.com:389";

    	authEnv.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
   		authEnv.put(Context.PROVIDER_URL, ldapURL);
   		authEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
   		authEnv.put(Context.SECURITY_PRINCIPAL, dn);
   		authEnv.put(Context.SECURITY_CREDENTIALS, passWord);

    	try {
    		DirContext authContext = new InitialDirContext(authEnv);
    		System.out.println("Authentication Success!");
    	} catch (AuthenticationException authEx) {
    		System.out.println("Authentication failed!");

    	} catch (NamingException namEx) {
    		System.out.println("Something went wrong!");
    		namEx.printStackTrace();
    	}
    }
}

mjelly.com: free ringtones

Um sein Handy zu pimpen und nicht allzuviel Kohle auszugeben, kann man sich auf mjelly.com [1] einige nette Klingeltöne herunterladen.

(Natürlich braucht man zum Download nicht unbedingt sein Handy zu benutzen, man kann den Link auch in die Adressliste [2] des Browsers reinkopieren).

[1] http://mjelly.com/tags/ringtone
[2] http://m.mjelly.com/get

HTML Purifier

Etwas aus der Fundgrube:

HTML Purifier [1] is a standards-compliant
HTML filter library written in
PHP. HTML Purifier will not only remove all malicious
code (better known as XSS) with a thoroughly audited,
secure yet permissive whitelist,
it will also make sure your documents are
standards compliant, something only achievable with a
comprehensive knowledge of W3C’s specifications.
Tired of using BBCode due to the current landscape of deficient or
insecure HTML filters? Have a
WYSIWYG editor but never been able to use it? Looking
for high-quality, standards-compliant, open-source components for that
application you’re building? HTML Purifier is for you!

[1] http://htmlpurifier.org/

Inside Mac OS X Kernel

Der 24C3 [2] ist schon eine Weile her, aber erst jetzt bin ich dazu gekommen, mir ein paar Vorträge anzusehen. Besonders sehenswert finde den Vortrag [2] über die Geschichte des OS X Kernels, nett und interessant vorgetragen.

Auch den Vortrag [3] über “Portscanning Improved” find ich gelungen.

[1] http://berlin.ccc.de
[2] inside_the_macosx_kernel.mkv.torrent
[3] port_scanning_improved.mkv.torrent