Thursday, December 21, 2006

Search Engine Add On for Firefox 2.0


Search Engine Add On for Firefox 2.0

Interesting search engines needed for Research work:

Google Scholar Search Add-On

Citeseer Search Add-On


Installing: Copy the xml files into C:\Program Files\Mozilla Firefox\searchplugins

Tuesday, December 12, 2006

Stop Apache from listening on 443 and run sshd on 443

Stop Apache from listening on 443 and run sshd on 443

What is SSH? It stands for "Secure SHell", a kind of Telnet but where the data is encrypted. By default, sshd, the SSH daemon is running on the Linux box on port 22. The idea is to have sshd also listening on port 443, so that we can connect from behind firewall.

Aache webserver is running HTTPS on port 443. We need to stop this service.

#vi /etc/httpd/conf.d/ssl.conf

Comment out "Listen 443"

#/etc/init.d/httpd restart

Next run another instance of sshd on port 443: Leave the default service running on 22 so that others can access it

#/usr/sbin/sshd -p 443

Incase we want to change the default port of sshd, this is the way to do it:

#vi /etc/ssh/sshd_config

Comment out Port 22 and add Port 443

#Port 22
Port 443

Now restart the SSH daemon:

$/etc/init.d/sshd restart

Friday, December 08, 2006

Opening RAR files using a simple bat file and UnRAR.exe

Extract the following zip file to C:\ drive.

UnRAR can also be obtained from WinRAR website

The batch file given below creates a folder under the name of the rar file being extracted and extracts the entire content of the folder

UnRAR.bat

@echo off
rem Extracting RAR files into folders
for %%a in (%1) do mkdir %%~na & cd %%~na & C:\UnRAR.exe x %%a
pause

To set UnRAR.bat as the default program for opening RAR files
  1. Right Click on an .rar file
  2. Click Open With
  3. Browse and select UnRAR.bat
  4. Check Always use the selected program to open this kind of file



Thanks
Debprakash





Saturday, November 18, 2006

Java2Html - Download

http://www.java2html.de/download.html

Netbeans Module Development

Netbeans Module Development - 1

Date: 18 Nov' 2006

This example adds "Export Sources" menu item to File Menu in the IDE. Onclicking it displays a message box and creates an output tab and writes into in.

Requires:

Dialogs API, I/O API, Utilities API


package org.deb.exportmodule;

import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.IOProvider;
import org.openide.windows.InputOutput;
import org.openide.windows.OutputWriter;

public final class ExportFiles extends CallableSystemAction
{

public void performAction()
{
InputOutput io = IOProvider.getDefault().getIO("Hello", true);
NotifyDescriptor d = new NotifyDescriptor.Message("I am plugged in!", NotifyDescriptor.INFORMATION_MESSAGE);
DialogDisplayer.getDefault().notify(d);
io.getOut().println("Hello from standard out");
io.getErr().println("Hello from standard err"); //this text should appear in red
io.getOut().close();
io.getErr().close();
}

public String getName()
{
return NbBundle.getMessage(ExportFiles.class, "CTL_ExportFiles");
}

protected void initialize()
{
super.initialize();
// see org.openide.util.actions.SystemAction.iconResource() javadoc for more details
putValue("noIconInMenu", Boolean.TRUE);
}

public HelpCtx getHelpCtx()
{
return HelpCtx.DEFAULT_HELP;
}

protected boolean asynchronous()
{
return true;
}

}















Friday, November 17, 2006

Mailing in Java Using Lotus Notes

Mailing in Java Using Lotus Notes
Date: 17 November' 2006

Add to Class Path:
C:\Program Files\Lotus\Notes\Notes.jar
Add to Environment Variable:
Path=C:\Program Files\Lotus\Notes;

Download the JAR domino-1.1.jar and place in class path

http://domingo.sourceforge.net/installation.html


Source Code



import de.bea.domingo.DDocument;
import java.util.Date;
import java.util.Iterator;

import de.bea.domingo.DDatabase;
import de.bea.domingo.DNotesException;
import de.bea.domingo.DNotesFactory;
import de.bea.domingo.DSession;
import de.bea.domingo.DView;
import de.bea.domingo.DViewEntry;
import lotus.notes.addins.util.MailMessage;


//http://www-128.ibm.com/developerworks/lotus/library/ls-Java_Mail_Forwarding_Agent/index.html

public class LotusMailer {

public static void main(String[] args) throws DNotesException {

// get an instance of the domingo factory
DNotesFactory factory = DNotesFactory.getInstance();

// create a session to the local Lotus Notes client
DSession session = factory.getSession();

// get the local database names.nsf
//DDatabase database = session.getDatabase("", "names.nsf");//names.nsf
DDatabase database = session.getDatabase("SERVER", "path\\to\\mailbox.nsf");

//MailMessage
System.out.println(database.getTitle());
DView view = database.getView("($Inbox)");
Iterator allEntries = view.getAllEntries();
System.out.println("Content of view ($Inbox)");

while (allEntries.hasNext())
{
DViewEntry entry = (DViewEntry) allEntries.next();
System.out.println("Entry :: " + entry.getDocument().getAuthors());
for (int i = 0; i < entry.getColumnValues().size(); i++)
{
System.out.println(i + "." +
entry.getColumnValues().get(i).getClass().getName() + " : " +
":" + entry.getColumnValues().get(i));
}
break;
}

DDocument d = database.createDocument();
d.setSaveMessageOnSend(true);
d.appendItemValue("Subject", "Automail");
d.appendItemValue("Body", "Today " + new Date());
d.appendItemValue("SentTo", "anyone@mail.com");
d.send("anyone@mail.com");
System.out.println("Mail sent !!!");
}
}