Search This Blog

Wednesday, November 29, 2006

How to find which file is opened on windows (similar to fuser in linux)

Download the tool from

http://www.microsoft.com/technet/sysinternals/utilities/handle.mspx

Ever wondered which program has a particular file or directory open? Now you can find out. Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.

handle.exe > dd.txt will get all the files

handle AppEvent.evt

Handle v3.2
Copyright (C) 1997-2006 Mark Russinovich
Sysinternals - www.sysinternals.com

services.exe pid: 1224 2D0: C:\WINDOWS\system32\config\AppEvent.evt

Monday, November 27, 2006

How to test the x-forwarded-for with the Apache

1. Create the file AdjustRemoteAddrAccordingToHeader.pm
with the following ,

package Apache::AdjustRemoteAddrAccordingToHeader;

sub handler
{
my $r = shift;
my $configuredValue = $r->dir_config ("UseIPFromHeader");
if ($configuredValue)
{
my $ip = $r->header_in($configuredValue);
if ($ip)
{
$r->connection->remote_ip($ip);
}
}
else
{
print STDERR "AdjustRemoteAddrAccordingToHeader: PerlSetVar UseIPFromHeader is not set, so I did not do anything\n";
}

# Adjust for Oracle HTTP Server and REMOTE_ADDR
# Remove this line if not necessary
$r->header_in("ClientIP", $r->connection->remote_ip());

return OK;
}

return 1;

2. Open the httpd.conf file and add the following lines to the end ,

PerlRequire /home/ias/AdjustRemoteAddrAccordingToHeader.pm
PerlPostReadRequestHandler Apache::AdjustRemoteAddrAccordingToHeader
PerlSetVar UseIPFromHeader X-Forwarded-For

3. Run the command to validate whether this works or not ,

apachectl configtest

4. Use some tool , like say ProtocolExplorer.jar and add the following ,

GET /j2ee/examples/jsp/snp/snoop.jsp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Accept-Language: en-us,et;q=0.9,cs;q=0.7,de;q=0.6,fi;q=0.4,ja;q=0.3,fr;q=0.1
Accept-Encoding: gzip, deflate
Host: incq128ad.idc.oracle.com:7779
x-forwarded-for: 123.111.22.15
Connection: Keep-Alive

Check the following output ,



Remote address: 123.111.22.15


Remote host: 123.111.22.15



The same addredd will appear in the Apache access log's also as we are replacing the
remotehost with the header for the X-Forwarded-For header.

Using Apache DERBY

http://db.apache.org/derby/integrate/SQuirreL_Derby.html

http://db.apache.org/derby/papers/DerbyTut/ns_intro.html

Wednesday, November 22, 2006

How to redirect to an URL with out the quesry string

When ever you want to access the URL

/j2ee/examples/jsp/num/numguess.jsp?guess=500 you want to redirect to http://indl224ad.idc.oracle.com:7777/j2ee/examples/jsp/jsp2/el/basic-arithmetic.jsp
without the query string parameters

RewriteEngine on
RewriteLog "c:\rewrite.log"
RewriteLogLevel 9
RewriteCond "%{REQUEST_URI}" "/j2ee/examples/jsp/num/numguess.jsp"
RewriteCond "%{QUERY_STRING}" "^guess=500"
RewriteRule ^/(.*) http://indl224ad.idc.oracle.com:7777/j2ee/examples/jsp/jsp2/el/basic-arithmetic.jsp? [L,R=permanent]

Tuesday, November 07, 2006

Lost Windows in JDeveloper 10.1.3 Preview

Lost Windows in JDeveloper 10.1.3 Preview



Ran
across a silly problem this morning with the log window in JDev. I'd
been plugged in at the office running across both my laptop screen and
an extra crt that happened to be lying around, with my desktop extended
onto that extra screen. Whilst working I'd undocked the log window and
pushed it onto the other screen.

This morning in the hotel room I was unplugged from the external crt of
course and when I ran JDev, you guessed it the log window was still in
the same place, about 4 inches above the top of my laptop screen.
Fortunately this one's pretty easy to recover from, just rename or
delete the /jdev/system/oracle.ide.10.1.3.[some number]/windowinglayout.xml and JDev will restore to the default layout again



powered by performancing firefox



powered by performancing firefox