Thursday, March 26, 2009

About Balance filter in Tomcat

http://localhost:8080/balancer/News
sends to cnn.com

Read apache-tomcat-5.5.27/webapps/balancer/WEB-INF/config/rules.config

Tomcat Users

Wednesday, March 25, 2009

Sar command

sar [options] sample period number of samples

Tuesday, March 24, 2009

Monday, March 23, 2009

Reading and Writing a Properties File

// Read properties file.
Properties properties = new Properties();
try {
properties.load(new FileInputStream("filename.properties"));
} catch (IOException e) {
}

// Write properties file.
try {
properties.store(new FileOutputStream("filename.properties"), null);
} catch (IOException e) {
}

Here is an example of the contents of a properties file:

# a comment
! a comment

a = a string
b = a string with escape sequences \t \n \r \\ \" \' \ (space) \u0123
c = a string with a continuation line \
continuation line
d.e.f = another string

Taken from here

Thursday, March 19, 2009

Findings Logs between two time intervals

awk '{ if ($3>="16:30:00" && $3<="16:42:00"){print $0}}'filename.log

Scenes from Recession

Recession in Photos

Zipping and Unzipping Files in UNIX

Zipping and Unzipping Files in UNIX

There are several methods of archiving files and retrieving archives. We recommend using the "zip" function to compress your files for its ease of use and portability. (Files zipped in Unix can be extracted using WinZip or PKunzip in Windows). We have provided various "unzip" methods. The "right" unzip method depends upon the method used to zip the file. You can tell the zip method by the file extension (e.g., .zip, .tar, .gz, etc.)

Zipping Files Using ZIP

This Unix program is compatible with the zip program for DOS and Windows. To zip files, first have the files uploaded to your server, then log into your account with Telnet. Navigate to the directory where the files are that you want to zip (for instance by typing cd www then cd sounds to move to your /www/sounds directory). Then type:

zip myzip file1 file2 file3

This puts the files named file1, file2, and file3 into a new zip archive called myzip.zip.

Unzipping Files

Please note that the unzip method you use is defined by the filename you are trying to unzip. For example, if you are trying to unzip a file called file.tar - you would use the method described in "tar". Files ending in .gzip or .gz need to be extracted with the method described in "gunzip".

Zip

If you have an archive named myzip.zip and want to get back the files, you would type:

unzip myzip.zip

Typing zip or unzip by itself will give you a usage summary, showing nearly all the options available.

Tar

To extract a file compressed with tar (e.g., filename.tar), type the following command from your telnet prompt:

tar xvf filename.tar

Basically, this command means that you will see the file "explode", so don't worry when you see your screen scrolling wildly. It also means that you will see any errors in the archive.

Gunzip

To extract a file compressed with gunzip, type the following:

gunzip filename_tar.gz

then if you receive no errors, type:

tar xvf filename_tar

Taken From here