Before explaining about this tool , i would like to tell what are the steps i was doing for deploying the application.
Running Managed and admin server everytime after you made code changes(Changing logic etc..) in any “.class” file .
These steps will repeat whenever you do code changes. And developer has to wait until the servers has been brought up. This will kill developer time indeed.
But this tool Java Rebel make no more or less chances to re-deploy webapplication after any code changes in your class file.
You can make changes in your code , and see the effect for your change without re-deploying the servers!! , thats amazing one.
“JavaRebel is a JVM plugin (-javaagent) that enables to reload changes made to Java class files on-the-fly, saving developers
the time that it takes to redeploy an application or perform a container restart. It is a generic solution that works for Java EE
and Java standalone applications“.
The following classes will be reloaded when they are changed and compiled:
- All “.class” classes inside the usual classpath (
WEB-INF/classes, etc). will provide the best JavaRebel experience.
Installation
edit your wisorStartManagedWeblogic.cmd file ,
Add the following to JVM command line (note that it is important that the JAR would be named “javarebel.jar”)
" -noverify -javaagent:/path/to/javarebel.jar "
for example: set JAVA_OPTIONS=-noverify -javaagent:d:\javarebel\javarebel.jar
September 15, 2008 at 5:58 am




I
ts not a dramatic change in me for switching from “Java” to python And i did not. …. well , all i wanted to have fun coding in python rather than “Java” …. Intially i was totally confused whether i should learn ruby or groovy or python or whatever that suppose to make me smile while coding…. But i learned python that its one of the more popular , strong ,dynamic bla bla bla …… And i am still a novice , i started with byte of python tutorial which is excellent tutorial by swaroop (http://www.swaroopch.com/byteofpython/) …. Ya just started out with python shell executing all basic stuffs using IDLE … Its amazing thing to learn python .. if you python then surely you will never turn off from your mind … get addicted to it , like i am . Till now i learned so many things that i wouldn’t have learned from any other language … beacause its very simple , ease … and only thing that you have to apply some common sense while pythoning ….
You can write sophisticated taks within in few lines … what you code in java/c++/c can be done within few lines ….. you will more over concentrate on solution to the problem rather than syntax !… And it has got numerious GUI and Web frameworks and its still amazing .
Today i found libgmail.py library , where i can play around with GMAIL account using python…. (http://libgmail.sourceforge.net/)
Which is a Library to provide access to Gmail via Python
After downloading libgmail … all i have to extract to my /lib directory .
some examples i worked out …..
SEND MAIL
import libgmail
import mechanize as ClientCookie
ga = libgmail.GmailAccount(“username@gmail.com”, “password”)
ga.login()
msg = libgmail.GmailComposedMessage(‘to@gmail.com’,'subject’,'body’)
ga.sendMessage(msg)
print ‘\nEmail sent’
READ MAIL
import libgmail
ga = libgmail.GmailAccount(“username@gmail.com”, “password”)
ga.login()
folder = ga.getMessagesByFolder(“inbox”, True)
for thread in folder:
print “Thread:”, thread.id, “Subject:”, thread.subject
for msg in thread:
print “Msg:”, msg.id, “,Author”, msg.author, “,Subject:”, msg.subject
To send attachment files
import libgmail
ga = libgmail.GmailAccount(“username@gmail.com”, “password”)
ga.login()
myFiles = ["/file1", "/file2", "/file3"]
msg=libgmail.GmailComposedMessage(“friend@gmail.com”, “SubjectHere”, “BodyHere”, filenames=myFiles)
ga.sendMessage(msg)
Infact you can read contacts , read trash , read Unread mails etc ……..
Isnt it amazing !! …. poetic way to python ….
September 1, 2008 at 10:08 am

Hamachi isn’t a brand new utility or idea.
Hamachi is a service that runs in the background and connects your computer to any other computer you wish in a particular network. This creates an encrypted VPN (Virtual Private Network) between you and other PCs in your own network.
This becomes ultra convenient when you have a number of PCs that you want to connect to, for example if you have a work PC, home PC, school PC and/or servers. Once Hamachi is installed, the computers are available via IP address for their file shares, or any other service. Lots of people also use to play video games in a multi-player mode regardless of their location.
I like a few things about Hamachi that set it apart from the other VPN software available:
- Ease of use – Installing the program is a snap!
- Network Compatibility – Works with many types of networks, uses a variety of methods to get around firewalls (NAT, etc.)
- Cross-Platform Availability – Clients include the typical Windows and Mac, but also Linux, Mobile Devices, Windows Mobile and more.
- Security Built In – Communication between Hamachi clients is encrypted.
Windows Hamachi Install
Setting up the client is easy on Windows.

After installing the client, run it for the first time and “power” it on. It will have you create a network, and include a password so that anyone joining it (if it is a personal network, this would just be you) will need a password.
You will then join the network. For now, you will be the only one in this network. On subsequent installations, you can cancel out of the “create” network part. You will just join the network – so supply the password you used while creating the network.
Setting Hamachi up on Linux is a bit more difficult because it is via command line, however it is still easy as long as you are comfortable typing in a few commands.
Linux Install
From the readme for the Linux client:
- Run ‘make install’ and then ‘tuncfg’ from under the root account
- Run ‘hamachi-init’ to generate crypto identity (any account).
- Run ‘hamachi start’ to launch Hamachi daemon.
- Run ‘hamachi login’ to put the daemon online and to create an account.
- Run ‘hamachi join ‘ to join the network.
- Run ‘hamachi go-online ‘ to go online in the network.
- Run ‘hamachi list’ to list network members and their status.
More or less, this is all you will need to do. Depending on which flavor of linux you are installing this on, there may be some tricks you’ll need to use to get it working properly. Also, don’t forget to add it to your init scripts (or rc.local) to load on startup.
There is also a GTK GUI for the Linux client – see this forum post if you are interested in downloading or knowing more about it.
So now what?
So now that you have your machines set up, what can you do with them?
Here is just a random selection of some useful programs or services that you can use between your Hamachi clients:

VNC, Remote Desktop, NoMachine, etc. – Remotely access any PC on the VPN. The connection is encrypted, so you feel secure using even unencrypted protocols (like default VNC).File Shares – Whether you use Windows file sharing, Samba or other protocols, you can access files on any other Hamachi PC. For Windows shares, just use the IP: \\5.x.x.x\. You can also map these shares to a drive, giving you access to your files like a local drive.
Music or Video Streaming – Use a streaming media server, such as Jinzora, to stream music from one PC to another.
Gaming – Play multi-player games with friends even if you’re on different networks.
Really anything you can think of that would be handy via a VPN, P2P network would work really well with Hamachi. Most connections are direct, so bandwidth is limited by your direct internet connection. In some cases a ‘relay’ is used to maintain connectivity, but this is only used in rare cases (Hamachi claims that 95% of connections are direct).
Finally, there are two versions of Hamachi. The free version has a few limitations – namely it will not run as a system service, is limited to the number of networked clients and uses ‘low speed’ relays (when necessary). The paid version takes away these limitations – for a full description see the comparison page.
The only two downsides that I can see to Hamachi is that it is closed-source, and that it depends on mediation servers. Being closed source, it is impossible to audit the code to ensure it is 100% secure and encrypted. The mediation servers have always worked well for me, but this adds in a 3rd party which some people may not like.
Hopefully you will find Hamachi as useful as I have! This program was purchased by LogMeIn a few years back but has retained its free and useful nature. If you have any particular issues with it, their forum is a great resource with lots of knowledgeable users.
Alternatives: OpenVPN is a similar service, but since there is no mediation server – configuration is a good bit more complex.
source :www.makeuseof.com
August 1, 2008 at 9:42 am
By default, Linux can only see his own partition(s).
But what if you need some data stored on a partition readable by Windows (wich uses an NTFS or FAT filesystem)?
Of course Linux allow you to read the content of both FAT and NTFS partitions, but you have to mount them: I’ll show you how.
mount a filesystem means that you virtually place the whole partition on a directory under the root directory /, and you specify what the system is allowed to do with it: you can mount a filesystem as read-only, or as writable.
The command is mount, and the syntax is the following:
mount -t filesystem_type device directory [options]
Let’s explain: this command mounts the filesystem found on device (which is formatted with filesystem_type) on directory (properly called mount point) with the specified [options].
Devices are usually listed under /dev; hard disk partitions are identified from the letters hd, followed by the disk order in letters (A for the first disc, B for the second, and so on) and then the number that identifies the number of the partition on the phisycal drive (1, 2, 3…).
Usually, the only options you will need to care about are -ro for read-only and -w for read-write.
Let’s make a practical example.
Say that you want to mount the partition in which is installed Windows XP, that is on /hda2 (then, /dev/hda2 under Linux) and you want to show its content, as read-only, in /mnt/windows. The command for that will be the following:
mount -t ntfs /dev/hda2 /mnt/windows -ro
Now, you can go to /mnt/windows, and you will see your so-called C: disc here. Quite simple, isn’t it?
So, now we know how to manually mount partitions.
How to mount partitions automatically at the system boot?
The key is on this file: /etc/fstab. This file contains informations about partitions and storage devices on your computer. During the boot, Linux reads its instructions and mount filesystems accordingly.
In this file, every row contains informations about a partition. The structure of a row is:
<device> <mount point> <type> <options> <dump> <check>
Let’s explain:
Device is your device (/dev/hda2 accordingly to the previous example), mount point is the directory where you will see your data, type is the filesystem (e.g. “ntfs” for windows), options have to be comma-separated (I will return on them in a moment), dump and check refers, respectively, to “do you want a backup of this” and “do you want the system to check this disc”. Both these values can be 0 or 1, respectively for True or False. If you’re mounting a Windows partition, leave 0 for both.
Options: they are almost the same allowed for mount command. When mounting a Windows unit, the only really useful options are: ro (or rw, respectively for Read-only and Read-write), and user (or nouser: default is nouser, and if you don’t change this to user, the system will not mount your device unless you are logged in as root).
Going on with the example, a row in /etc/fstab that will automatically mount the Windows XP partition found on /dev/hda2 in /mnt/windows as read-only, would look as the following:
/dev/hda2 /mnt/windows ntfs ro,user 0 0
Now, every time you boot, you will able to read contents from C: into /mnt/windows!
If you wish, you can read a more extensive documentation on fstab.
June 19, 2008 at 12:14 pm
or 
The competition between these two IDE’s play mind games in programmer’s mind these days. Choosing right IDE for your needs makes us to think twice . Eventually , we choose the best or even not !. I have been using eclipse for around 2 to 3 years on my development , and i found comfortable , later i heard about Sun’s Netbeans IDE . So i tried to experiment on version 5 which was long back i used . And i found little bit programmer friendly , ofcourse it gives same basic thing what eclipse can do . But what highlighted me is much ease use of plugin’s and integration with multi-language capability. Afterall , we end up coding in java even we choose any “IDE’s” .
There is perhaps no area of programming tools where competition is as intense as in the Java IDE market. Even though there are only four primary players — Eclipse, NetBeans, IntelliJ IDEA, and Oracle JDeveloper (Rational and CodeGear JBuilder build on Eclipse).The competition is most intense between Eclipse, NetBeans, and IntelliJ IDEA, likely because those products have the most active communities of users and those users tend to be personally attached to their preferred environment. Of the three, only Eclipse and NetBeans are free and open source.
I will mention One of the weirdest thing about eclipse and nebeans i came across . Eclipse installation consists of unzipping a download file. As long as you have Java 5 installed on your system, simply clicking on the Eclipse icon will get you started. Once you do, however, you are confronted with an annoyance particular to Eclipse — workspaces. If you later create a project and don’t place it at the first-level subdirectory of your Eclipse workspace, you receive an error message.
Installing NetBeans is better but not. For example, if at the time of installation on Windows, the JDK is not specifically located in C:\Program Files\Java, the installation fails with a dialog stating that no instance of the JDK was found. NetBeans does not ask where the JDK is located: it simply doesn’t run. It does give the option of re-running the installation from a command line and specifying the location using a command-line switch, but it provides no example.
The editing experience
Table 1. Editing features
| Feature |
Eclipse 3.3 |
NetBeans 6.0 |
| Code refactorings |
22 |
17 |
| Generates |
Getters/Setters and similar, javadoc, unit tests, UML |
Getters/Setters and similar, javadoc, unit tests, UML, BPEL |
| Spell checking comments and literals |
Yes |
No |
| Other Java-related editors |
JSP, JSF, XML, HTML |
JSP, JSF, XML, HTML |
Language support
Eclipse officially supports C/C++, COBOL, PHP, and AspectJ. Its dynamic language toolkit project unofficially supports Ruby.
NetBeans supports C/C++ and two versions of Ruby: regular Ruby and JRuby, which runs on the JVM rather than the Ruby VM.
Plugins
Eclipse dominates in all aspects of plugins. Nearly all new commercial plugins that ship for Java (such as recent Java products from Agitar and Enerjy) ship for Eclipse first. Actually, most of them ship for Eclipse only. A few are ported to NetBeans, but not many.
Rate ‘em
Personal preference plays a uniquely important role in choosing the development environment . Consequently, any head-to-head comparison that results in a rating will be useful to only the fraction of readers who weigh the given features the same way the reviewer does. Below list tells about the weightings for the features I think are important. You should change these weightings to reflect your preferences and then calculate your own final score.
Table 2. NetBeans 6.0 vs. Eclipse 3.3: Rated
| Feature |
Weighting |
Eclipse 3.3 |
NetBeans 6.0 |
| Ease of use/editing features |
40% |
2.8 |
3.6 |
| Scripting/other languages |
10% |
3.0 |
3.6 |
| Enterprise support |
20% |
3.2 |
3.0 |
| Plugin ecosystem |
30% |
3.8 |
2.7 |
| Total score |
|
3.20 |
3.21 |
During that time, Eclipse-based IDEs have regularly won top honors, while versions of NetBeans have lagged badly. This is the first review in which NetBeans truly stands on a par with Eclipse, and depending on your weightings could finish ahead. NetBeans has definitely arrived and is worthy of careful evaluation.
June 12, 2008 at 6:41 am
Important changes that occurred are:
- New drag-and-drop capabilities in the file manager
- Improved Wi-Fi support (through ndiswrapper, madwifi, and other modules)
- New GUI interfaces for changing system preferences, managing printers and other tasks
- Kernel upgrade to 2.4.31, which means better power management and device support
Damn Small Linux now includes
XMMS (MP3, CD Music, and MPEG), FTP client, Dillo web browser, Netrik web browser, FireFox, spreadsheet, Sylpheed email, spellcheck (US English), a word-processor (Ted), three editors (Beaver, Vim, and Nano [Pico clone]), graphics editing and viewing (Xpaint, and xzgv), Xpdf (PDF Viewer), emelFM (file manager), Naim (AIM, ICQ, IRC), VNCviwer, Rdesktop, SSH/SCP server and client, DHCP client, PPP, PPPoE (ADSL), a web server, calculator, generic and GhostScript printer support, NFS, Fluxbox and JWM window managers, games, system monitoring apps, a host of command line tools, USB support, and pcmcia support, some wireless support.
Download Damn Small Linux here by choosing the download mirror.
source : http://www.renjusblog.com/2007/10/linux-os-less-than-50mb-for-pen-drives.html
June 10, 2008 at 7:08 am
Some website prompt you to enter dynamic number generated in the image , especially when you are filling registration form ….and usually found at the end of registration form. User must enter exactly same number or alphanumeric character found on the image , this is because to make sure that Human is using webapplication and keeping away from robots/sypwares or any hacking software’s to fill the form.
Below is simple java code for how to generate dynamic image .This is a sample servlet that dynamically generates JPEG images. Currently all image properties are hard-coded, but it should be trivial to provide a jsp form to collect them (e.g., color, font, dimensions, messages). The generated image contains dynamic data such as the appserver name, and OS name.
import com.sun.image.codec.jpeg.JPEGCodec;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class ImageServlet extends HttpServlet {
private static final int WIDTH = 450;
private static final int HEIGHT = 200;
private static final Color BACKGROUND_COLOR = new Color(100,149,237);
private static final Color COLOR = new Color(0,0,139);
private static final Font FONT = new Font("Times New Roman", Font.BOLD, 46);
private static final Font FOOT_FONT = new Font("Courier", Font.ITALIC, 14);
private static final Color FOOT_COLOR = Color.BLACK;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
response.setContentType("image/jpg");
ServletOutputStream out = response.getOutputStream();
BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_BYTE_INDEXED);
Graphics graphics = image.getGraphics();
graphics.setColor(BACKGROUND_COLOR);
graphics.fillRect(0, 0, image.getWidth(), image.getHeight());
graphics.setColor(COLOR);
graphics.setFont(FONT);
graphics.drawString("Hello World!", 10, HEIGHT/2); //insert String or any random number
graphics.setFont(FOOT_FONT);
graphics.setColor(FOOT_COLOR);
graphics.drawString("Created by " + getServletContext().getServerInfo(), 10, HEIGHT - 30);
graphics.drawString("for http://javahowto.blogspot.com/ on " + System.getProperty("os.name"), 10, HEIGHT - 10);
JPEGCodec.createJPEGEncoder(out).encode(image);
}
}
The web.xml file is as simple as declaring and mapping a servlet:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>image</servlet-name>
<servlet-class>ImageServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>image</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
And i hope you know rest of the things to deploy the webapp ......
output...


May 21, 2008 at 7:06 am
Its been month i have logged into ubuntu … and the sad news is i forgot many commands … moreover i love to do lots of stuffs in console rather than choosing GUI … Whenever i forget some command , the best option for me search in google … But today i found something interesting , where i can stick some useful commands in my brain …or even you can stick to your wall too !!

Click the image above to download a full PDF. Print it out, stick it on your wall, and pass it on. It’s licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license, so feel free do distribute and modify it, even for commercial use!
May 18, 2008 at 7:33 am
Well its been long i have tried something new or learn something new …. Today i started with Google’s AJAX Search API . I started with simple local search using simple search and i learned how to embed samething in my blog see this example : http://madhucm.blogspot.com.
I would have included in this blog but i dont know how to edit <body> tag. And also it doesn’t allow you to do … well it doesn’t matter however.
The first thing i did was getting the JAX Search API key so that it is valid within a single directory on your web server. And after getting the key, i tweaked my blog template , and finally included the script. Well if you know javascript it damn easy to create you own search.
ex: var localSearch = new google.search.LocalSearch();
searchControl.addSearcher(localSearch); // This is local search
searchControl.addSearcher(new google.search.WebSearch()); // search on web
searchControl.addSearcher(new google.search.VideoSearch()); // video search
searchControl.addSearcher(new google.search.BlogSearch()); // blog search….
You can also customize your view , like :- TABBED, LINEAR .
// create a drawOptions object
var drawOptions = new GdrawOptions();
// tell the searcher to draw itself in linear mode
drawOptions.setDrawMode(GSearchControl.DRAW_MODE_LINEAR);
or
drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
searchControl.draw(element, drawOptions);
more info:http://code.google.com/apis/ajaxsearch/
May 16, 2008 at 10:14 am
An easy low cost method to check the activity of the garbage collector in the JVM is to tell the JVM to create an activity log. This is achieved for Sun JVMs using the non-standard command line option “-Xloggc:file_name“. This will tell the JVM to create a log file with a content similar with this:
0.806: [GC 8064K->1211K(30912K), 0.0051670 secs]
1.363: [GC 9275K->1856K(30912K), 0.0061070 secs]
1.944: [GC 9920K->2602K(30912K), 0.0115890 secs]
2.351: [GC 10666K->3289K(38976K), 0.0083440 secs]
3.159: [GC 19417K->4316K(38976K), 0.0325310 secs]
3.948: [GC 20444K->5735K(56192K), 0.0083630 secs]
35.812: [GC 37671K->7896K(56512K), 0.0152040 secs]
525.368: [GC 39832K->8066K(89600K), 0.0082710 secs]
As one can guess the log entries show the time of the garbage collection activity, the memory before and after and the duration of the garbage collection. This can prove very useful when monitoring the activity of a server application for memory leaks and for memory activity.
If the information about the garbage collection activity is only needed at the console the “-XX:+PrintGC” and “-XX:+PrintGCDetails” options can be used. The last one will produce an output with more details lke this one:
[GC [PSYoungGen: 33584K->1312K(33600K)] 36545K->6656K(55104K), 0.0141310 secs]
…
Heap
PSYoungGen total 33920K, used 8802K [0×00002aaac91c0000, 0×00002aaacd790000, 0×00002aaad39c0000)
eden space 30976K, 19% used [0×00002aaac91c0000,0×00002aaac97840a8,0×00002aaacb000000)
from space 2944K, 98% used [0×00002aaacd4b0000,0×00002aaacd784978,0×00002aaacd790000)
to space 4096K, 0% used [0×00002aaaccf90000,0×00002aaaccf90000,0×00002aaacd390000)
PSOldGen total 21504K, used 5344K [0×00002aaab41c0000, 0×00002aaab56c0000, 0×00002aaac91c0000)
object space 21504K, 24% used [0×00002aaab41c0000,0×00002aaab46f8340,0×00002aaab56c0000)
PSPermGen total 21248K, used 19211K [0×00002aaaaedc0000, 0×00002aaab0280000, 0×00002aaab41c0000)
object space 21248K, 90% used [0×00002aaaaedc0000,0×00002aaab0082d50,0×00002aaab0280000)
The behavior of the logging option seems to produce identical results as “-XX:+PrintGC” even if personally I would’ve expect more details in the log file. Maybe this will change in a future version of Java.
May 15, 2008 at 11:40 am
Older Posts