My very own 360°s

I finally got my XBOX 360, without a doubt the best console eva!

mmm, what have i been playing? 

  • Project Gotham Racing III (aka PGR III)
  • Dead or Alive 4
  • Crackdown
  • GRAW 2
  • Burnout Revenge
  • Kameo
  • Gears of War (My Favourite) :b
  • Ninety-Nine Nights

and now my very own gamecard, though iam still a n00b :(

IP VPN with Hamachi

Want to setup a VPN? but don’t have the time, or you are just plain old lazy to setup something like OpenVPN? Well then Hamachi is for you!.  Hamachi is a zero-configuration virtual private networking application with an open security architecture and NAT-to-NAT traversal capabilities. Ok, why a VPN? u ask. An IP VPN is a partitioned private network constructed over a shared IP-based backbone that utilizes technologies to ensure privacy of data, so you can setup your own private network over the internet and still communicate with the peers securely. You can setup a VPN just to do something very simple as playing a multi-player game over the internet and simulate a local LAN. Setting up Hamachi is a piece of cake!. Just download the windows installer if you use windows or get the tarball of the binaries for linux. Setup is as simple as running the installer and you are all set to go :b

But Hamachi is not a replacement for something like OpenVPN it still has some disadvantages

- dependends on a third party mediation server – if necessary, you can firewall your Hamachi connection (although this sort of negates the convenience of not having to open up ports on your computer for certain games that you would have if you don’t firewall your Hamachi-NIC: the regular NIC would still be firewalled without problems as things are being tunneled), but firewalling your connection is global for ALL Hamachi networks you have joined whereas OpenVPN creates a separate virtual NIC for each "network" that you and your peers create

- some games act up with the predefined 5.0.0.0 mask 255.0.0.0 network, which in Hamachi you cannot change, although a workaround would be IPX on all Hamachi clients if the game supports it. In OpenVPN you decide any IP ranges and settings yourself

- so far, Hamachi cannot be "bridged" with other NIC’s on your system like you can with OpenVPN or at least I haven’t been able to

- perhaps Hamachi cannot be forced into promiscuous mode which is necessary for this to work or simply refuses to use static IP addresses if you manually enter the 5.0.0.0 address

– no Windows 98 support, which some gamers still use especially with older games that require IPX or even NetBEUI.

You can get Hamachi from http://www.hamachi.cc/

So what are you waiting for? go, give it a try! :D  

Groovy – Dynamic Language for Java Platform

Well i know its been a long time since i posted somethin, and yes shame on me :p

I came across somethin today which is pretty amazing for what it can do for you, Its like a small scripting engine for java or you may just call it a seperate language of its own. The best part is the amount of code you would write in groovy compared to java to perform the same task. For most part groovy sounds more like "Ruby for Java". For a quick start install the groovy eclipse plugin from http://groovy.codehaus.org/Eclipse+Plugin. Groovy scripts are compiled to Java Class files and they are nothing different than normal class file. So in your application you could write some portions in Groovy and some in Java, since compiled Groovy class files can be used in Java and Java classes can be used in Groovy without doin anything extra. You will know what I am talkin about once you start coding in it, so stop wasting time and get to work!

Resources:

http://groovy.codehaus.org/
http://www-128.ibm.com/developerworks/java/library/j-pg09196.html 

XGL is here!

Always wanted something new on the Linux user interface, something similar to Aero on Windows Vista?

Well then here comes XGL, according to the offical statement

Xgl is a new Xserver architecture layered on top of OpenGL.

As XGL improves, i guess it would put Windows Vista far behind. The best way to install XGL if u are using Open SUSE 10.2 is open up Yast Package Manager and search for XGL and Compiz (Window Manager, that works great with XGL)

some of the  features of XGL include:

  • Decouple window resolution from display resolution. Applications may render windows at a particular resolution, but may be seen on-screen at a different resolution. Consider a background/root gradient. Such a window (texture) may only be a few pixels in size but appear at 1600×1200 or larger.

  • Fast, simple screen rotation/flipping/panning/magnification.

  • Advanced font rendering, including on-the-fly outline font rendering using textures and fragment programs (see [WWW]http://www.loria.fr/~levy/publications/papers/2005/VTM/vtm.pdf).

  • Simulated hardware overlay planes. This long-time workstation graphics feature could be implemented with texture compositing.

  • Full-screen color manipulation, including gamma correction, contrast enhancement, dimming/brightening, etc.

  • Mixed pixel depths on one screen. Redirected, top-level windows could all have different color depths (8, 16, 24, 32bpp). For example: XTerms may be created with 8bpp (requiring 1/4 the texmem of a 32bpp visual) and displayed with a color-lookup table (fragment program texel lookup).

  • Arbitrary per window colormaps (fragment program texel lookup)

  • Alternate window color spaces. "video" windows may be stored as YCbCr (smaller than RGB) and converted to RGB on the fly when displayed using texture hardware.

  • Window image compression: Use S3TC texture compression to compress windows whose contents seldom change. Best use would be the desktop background stored in the root window. Potentially big memory savings.

  • New opportunities for antialiased X rendering with OpenGL multisampled surfaces.

You want to try out XGL and dont have Open SUSE installed? try out DreamLinux  (http://www.tuxmachines.org/node/8358)
run the Live CD version of DreamLinux 2.0 XGL Edition to check out all the EyeCandy of XGL.

There goes Vista..and here comes XGL!…hail Open Source! 

Some Links:

http://en.opensuse.org/Xgl
http://www.novell.com/coolsolutions/feature/17174.html
http://www.dreamlinux.com.br

 

I am back!

Well after a long time of inactivity, which was the result of lots of things goin on with me including a new job and relocating to singapore. I am finally back into maintaining the blog. I have been doin a lot of interesting projects at Singapore Press Holding (http://sph.com.sg , the company that i work for)  including playing my part in the upgradation of Business Times (http://business-times.asiaone.com ) and a totally new project which includes a Newsletter System using (Apache Velocity, Apache MyFaces and Spring Framework) , more on that later. Its been interesting to know that there are really people who come across my blog eventhought there is not much in it, which i assure is goin to change, and contain a lot of usefull articles about the work that i do, and part of which can be helpfull to someone in need ;)  

hmm…too much talkin and a long way to go

MySQL 5.0 Stored Procedures

MySQL 5.0 comes with some really cool additions like stored procedures, functions and views.

I was experimenting with writing a procedure at work and, this is what i came up with.

DELIMITER $$;
 
 DROP PROCEDURE IF EXISTS `vms_database`.`FixSafety`$$
 
 CREATE PROCEDURE `FixSafety`()
 BEGIN
     DECLARE id, b int ;   
     DECLARE serial_no1 varchar(255) ;
     DECLARE track_id varchar(255) ;   
     DECLARE cur_1 CURSOR FOR SELECT MAX(SAFETY_VALVE_REPAIR_ID) AS id , SERIAL_NO , SAFETY_VALVE_EQUIPMENT_TRACK_ID AS track_id  FROM safety_valve_repair WHERE SERIAL_NO IS NOT NULL AND trim(SERIAL_NO)!= GROUP BY SERIAL_NO;
   
     DECLARE CONTINUE HANDLER FOR NOT FOUND
     SET b = 1 ;   
     OPEN cur_1 ;   
     REPEAT
         FETCH cur_1 INTO id, serial_no1, track_id ;       
         UPDATE safety_valve_repair SET SAFETY_VALVE_EQUIPMENT_TRACK_ID=id,MOST_RECENT_FLAG=‘N’ WHERE SERIAL_NO = serial_no1 AND SAFETY_VALVE_REPAIR_ID!=id ;
         UPDATE safety_valve_repair SET MOST_RECENT_FLAG=‘Y’ WHERE SAFETY_VALVE_REPAIR_ID = id ;
         UNTIL b = 1
     END REPEAT ;
     CLOSE cur_1 ;
 END$$
 
 DELIMITER ;$$

The procedure that i wrote was 2-3 times faster, than a piece of java code that, i wrote to perform the same operation.
Eventhough i still don’t like much of how procedures are written in MySQL 5.0, its still a good start.

JBoss Seam (EJB3+JSF+WORKFLOW)

Ok you wanted a sneak peak into EJB3? find a way to integrate JSF with EJB3?

Well here comes JBoss Seam it has everything u need to get started with EJB3 and also to find out how cool JSF can be when integrated with EJB3. I came across some nice features about Seam when i visited the Linux Asia 2006 conference held in New Delhi, India. I met Subramaniam Satyamoorthy (Director of Operations and Services (Asia Pacific)) , quite a funny guy :) . He showed us some of the workings of Seam, that got me hooked into it. And i am still experimenting with a lot of interesting stuff in it, not to mention JBoss jBPM which i had no idea about untill i knew about JBoss Seam. EJB3 uses Hibernate for persistance so you got best of both worlds :p. Maybe after a while i might  just post some code for download regrading Seam. Eventhough Seam is still in beta its still a handfull.  So check it out at http://www.jboss.com/products/seam 

and oh btw, you need to either select "ejb3 cluster" or "ejb3" profile while installing Jboss Application Server .

Integrating Codesnippet and Editormonkey plugin for Wordpress 2.x

I just tried out one of the best wordpress plugins out there the Codesnippet and Editormonkey , since for people like me who like to paste code everywhere they can :p and also since wordpress is not so kind to us :( , i had to go search for a plugin that would make my life a bit easier. Codesnippet is a great plugin to get syntax highlighting done for your code. Similarly Editormonkey replaces the default WYSIWYG editor in Wordpress 2.x with a much more advanced WYSIWYG editor with choices to either use TinyMCE or FCKEditor. Well i tried them both and was very impressed but when i started using the both together, came across some gliches Codesnippet stopped working since Editormonkey would change much of my code into HTML with "<" and ">" etc converted to  &lt; and &gt; and i could no longer use "code" blocks with "lang" attributes. So i tried hacking into it and came up with a few fixes for Codesnippet to work with Editormonkey. So if you are one of those who likes to use both you can download the modified "Codesnippet.php" from here.

You might also want to change the css for "Codesnippet" under Options->Code Highligting to something like this

border:1px solid #ccc; background:#eee; padding: 5px;margin:10px; font-size: xx-small; overflow:auto

 

looks much nicer in firefox.

Don’t forget to visit Codesnippet’s page at http://blog.enargi.com/codesnippet/   and Editormonkey at http://www.rajprasad.net/plugins/editormonkey
really great plugins….

Update: looks like the codesnippet site is down but u can download codesnippet from here

This is not the exact release, its just a tar of the files in my plugins directory . I have put it up just coz there is no download available elsewhere. 

Cheers!

Single Sign-On with CAS (Central Authentication Service)

First things first,

What is Single Sign-On?
: Wikipdedia has this definition for it.

CAS (Central Authentication System): Its a project started by Yale university to provide a trusted way for an application to authenticate a user (ref: The JA-SIG CAS Project)

I came across CAS when i was searching for a Single Sing-On framework for a project, i did find another similar project Java Open Single Sign-On Project (www.josso.org). And the reason why i choose CAS is its Proven track record. CAS has been successfully implemented in a lot of projects not to mention Yale University has been using it for a long time now (Ok you could have guessed that :p).

When i downloaded the source and deployed the web application that came with it, i thought the java cas-client would work just out of the box. Well it would have, if i had a valid server certificate for my tomcat server, compared to my self-signed certifcate to make tomcat work with SSL. Wasn’t too long until i realized what was causing the problem the class edu.yale.its.tp.cas.util.SecureURL (inside the Java Cas Client) that was downloaded from http://www.ja-sig.org/products/cas/client/javaclient/index.html which didn’t accept my self-signed certificate from the server. So i just went back and changed it :) Everything after that went super smooth, not to mention trying to use CAS everywhere i could :p

I played around with it a bit and installed a simple LDAP Authentication handler for the CAS Server application, this is an extract from the file WEB-INF/deployerConfigContext.xml

<bean id=“ldapAuth” class=“org.tecnova.cas.authentication.handler.support.LDAPAuthenticationHandler”>
     <property name=“providerUrl”>
         <value>ldap://localhost:389</value>
     </property>
 
     <property name=“credentialQueryString”>
         <value>cn=#username#,ou=Employees,dc=tecnova,dc=com</value>
     </property>
 
 </bean>
 …
 …
 …
 
 <property name=“authenticationHandlers”>
     <list>
         <bean class = “org.jasig.cas.authentication.handler.support.
 HttpBasedServiceCredentialsAuthenticationHandler”
  />

         …
         …
         <ref local=“ldapAuth” />
     </list>
 </property>

and to enable CAS authentication on the client application all we need are the following entries in the WEB-INF/web.xml of the Client web application.

<web-app>
 …
 …
     <filter>
         <filter-name>CAS Filter</filter-name>
         <filter-class>edu.yale.its.tp.cas.client.filter.CASFilter</filter-class>
       
         <init-param>
             <param-name>edu.yale.its.tp.cas.client.filter.loginUrl</param-name>
             <param-value>https://localhost/cas/login</param-value>
         </init-param>
 
         <init-param>
             <param-name>edu.yale.its.tp.cas.client.filter.validateUrl</param-name>
             <param-value>https://localhost/cas/proxyValidate</param-value>
         </init-param>
 
         <init-param>
             <param-name>edu.yale.its.tp.cas.client.filter.serverName</param-name>
             <param-value>localhost</param-value>
         </init-param>
 
     </filter>
 
     <filter-mapping>
         <filter-name>CAS Filter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
 …
 …
 </web-app>

Remember my tomcat is set to listen on port 80 and has SSL enabled, CAS won’t work without SSL enabled on your app server.

For rest of the details on what I did I have attached a sample Server and Client web application. Which can be downloaded here.

Using Apache Axis to create Web Services

Apache axis, is one of the best way to deploy Web Services without needing to buy those expensive Application Servers out there. Axis is deployed as a simple web application, with web services deployed as either simple .jws files or more complex compiled classes. Web Services can either be coded as simple java classes and later renamed to .jws rather than the usual .java, when invoked via axis using a url like http://localhost:8080/axis/services/MyService.jws, Axis compiles the code and exposes it as a SOAP Web Service. The other way of deploying a web service is by compiling the code and writing something called as the "Web Service Deployment Descriptor (WSDD)" WSDD files describe a Web Service,ex: the actual class and the methods that have been exposed in the Web Service, the scope of the Web Service etc. A sample axis Web Application which contains both a service (Calc) and a Client for the Web Service (Calc.jsp) can be found here.

« Previous PageNext Page »