Thursday, March 29, 2007

Using To Send Mail

Here is a snippet of code I wrote to use to send mails.
Please use vaild email address.

import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;

* @author prasad

public class MailInfo {
public void send() throws EmailException {
Email email = new SimpleEmail();
String authuser = "";
String authpwd = "**********";
// Very Important, Don't use email.setAuthentication()
email.setAuthenticator(new DefaultAuthenticator(authuser, authpwd));
email.setDebug(false); // true if you want to debug
"mail.smtp.starttls.enable", "true");

email.setFrom("", "SenderName");

email.setMsg("This is a test mail?");

email.addTo("", "ToName");

Wednesday, March 28, 2007

JavaProxy -- HTTP Proxy In Java

I decided to write this JavaProxy as I was looking for a proxy similar to CGIProxy implemented in Java.

After checking out HTMLParser library,
I got my implementation of JavaProxy working. Here is the download link.

Just copy the JavaProxy.war file into your Tomcat/webapps folder and you should be able to use it,
using http://localhost:8080/JavaProxy/

I have released it under Apache License 2.0, so make the best use of it.
Let me know if you liked it or found some use in your application.

I have got this project on google's Subversion Repository

[NOTE: Steps to import your project on
  1. To host your project on googlecode, signin for an account at

  2. Create a new project (myproject).

  3. Go to MyProfile (note down Username) and under Settings (note down Password).

  4. From your terminal type (assuming your are under project folder):
    svn import -m "Initial Import" . --username Username
    You will be prompted for Username and Password, enter the one you had notedown.
  5. Now your code is in subversion repository.

Sunday, March 11, 2007

Eclipse Profiler Plugin

Was looking for eclipse profile plugin and got this link:
Download link is here.

I could not get the plugin working with eclipse-3.2 but I could see the Profiler perspective as described when I tried with eclipse-3.1.

When I tried to run the profiler I got some error like this:
Plug-in unable to load class ru.nlmk.eclipse.profiler was unable to load class

Check out more discussion on this problem here.

I tried to use the bug fixed plugin for eclipse-3.1, use this link.

After getting this patched version of plugin:
1. Unzip it to eclipse/plugin folder.
2. For windows:
Copy ProfilerDLL.dll to ${JAVA_HOME}/jre/bin folder

For Linux Box:
Get from native/profiler_linux.tgz and copy it to in native/profiler_linux.tgz to ${JAVA_HOME}/jre/lib/i386/

[NOTE] I had to recompile a new version of Its simple to do. Just set the right path for your java installation in the shell script m [you get it after untaring native/profiler_linux.tgz], execute it (you will need right permission to copy the shared library)

Shell script m (used to recompile and copy
export JAVA_HOME=/usr/java/j2sdk1.4.2_06

g++ -O0 -DLINUX -shared -Wall -I. -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux ProfilerDLL.cpp -o
cp ${JAVA_HOME}/jre/lib/i386/

Enjoy Profiling!

Are you hit by Email-Worm?

My System got affected by Email-Worm.Win32.Brontok Virus few months back from now.
Although Anti-Virus cleaned up this worm, but I had to spend sometime to get the system configuration back to normal. Here are few links which helped me in the process.

Email-Worm.Win32.Brontok Virus:

and more about similar virus W32.Rontokbro@mm:

My system configuration has landed to proper state, I can now breathe easy, (Quite successfully avoided usual Windows RE-INSTALL!)

This page is powered by Blogger. Isn't yours?