Author Archives: niteartadmin

Replace end of lines with commas in sed

Need to extract numbers and create a comma separated list: $ sed -e :label -e N -e ‘s/\n/, /’ -e ‘s/[ |]//g’ -e tlabel <<xxxx > |     919 | > |    1027 | > |    1593 … Continue reading

Posted in unix | Tagged , , , | Leave a comment

Useful java parameters

“Good” set of java parameters to run “generic” application like tomcat: JAVA_OPTS=”-d64 -Xms512m -Xmx512m -XX:MaxPermSize=128m” JAVA_OPTS=”-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true $JAVA_OPTS” JAVA_OPTS=”-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-TraceClassUnloading $JAVA_OPTS” JAVA_OPTS=”-XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak -XX:HeapDumpPath=/home/tomcat/snapshots $JAVA_OPTS” These are not good but they are working options to enable jmxremote console. … Continue reading

Posted in java | Tagged , , , , | Leave a comment

Weblogic starts slow

I had a lot of troubles starting Oracle Weblogic 10.3g under linux (CentOS 5.2). It took anywhere between 5 to 20 minutes from the time I ran startup script to the point when Weblogic actually started. Here is typical log: … Continue reading

Posted in Uncategorized | Tagged , , , | 26 Comments

strace – trace system calls and signals

Nice little program that might be used in linux to find what files were open by the process. For example: strace ls 2>&1|grep “open”

Posted in unix | Tagged , , , | Leave a comment

How to find what application is using network port in linux?

netstat -nlp will give you an idea. [root@os]# netstat -nlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name tcp        0      0 0.0.0.0:9921                0.0.0.0:*                   LISTEN      10982/ora_d000_orcl tcp        0      0 10.10.10.10:1521           0.0.0.0:*                   LISTEN      12516/tnslsnr tcp        … Continue reading

Posted in unix | Tagged , , , , | Leave a comment

Bacula backup

Backup job stopped with: Device is BLOCKED waiting to create a volume for: It means that bacula ran out of volumes or space on disk and want you to create new volume manually. Use “Label”, enter new volume name, assign … Continue reading

Posted in unix | Tagged , , , | Leave a comment

When you use ‘find’ and ‘zip’ in one sentence…

Instead of find albums -name *.jpg -not -name *.sized.jpg -not -name *.thumb.jpg -not -name *.highlight.jpg -exec zip -r -1 album.zip {} ;& use find albums -name *.jpg -not -name *.sized.jpg -not -name *.thumb.jpg -not -name *.highlight.jpg -print| zip -1 album.zip … Continue reading

Posted in unix | Tagged , | Leave a comment

Permanent Redirects in Apache

These are simple and often overlooked rewrite rules to generate Permanent Redirects for sister domains. UseCanonicalName On ServerName www.olegshpak.com ServerAlias olegshpak.com ServerAlias www.niteart.com ServerAlias niteart.com RewriteEngine on RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD)$ RewriteRule .* – [F] RewriteCond %{HTTP_HOST} ^niteart.com$ [OR] RewriteCond %{HTTP_HOST} … Continue reading

Posted in Apache Tips | Tagged , , , | Leave a comment

Disable “WARNING: Parameters: Invalid chunk ignored.” messages in Tomcat log

To disable this message you need to modify logging properties file. If you have logging.properties in your tomcat/conf folder then make changes there. Otherwise modify jre’s file. Add to the end of /usr/local/java/jre/lib/logging.properties this line: org.apache.tomcat.util.http.Parameters.level = SEVERE Restart tomcat. … Continue reading

Posted in Tomcat Tips | Tagged , , | 7 Comments