ScribeFire : Desktop blogging from web browser

This is an attempt to blog from ScribeFire within Firefox.

Kinda cool. Plus, ScribeFire supports Firefox, Chrome and Safari. :-)

Bash : Compound condition using && (AND) and || (OR) operators

To have compound conditions in bash using && or ||:-
if [ $VAR1 -eq 1 ] && [ "$VAR2" == "true" ]
then
    # do something
fi
 
if [ "$VAR1" == "String 1" ] || [ "$VAR2" == "String 2" ]
then
    # do something
fi

Reference: http://www.museum.state.il.us/ismdepts/library/linuxguides/abs-guide/ops.html#ANDOR

Bash : Compare Strings With Spaces

To compare two strings that contain spaces in bash, enclose them with a double quote (e.g.  "$VAR" ). Example below:-

if [ "$VAR" == "this is a string with spaces" ]
then
    # do something
fi

Reference: http://hacktux.com/bash/string

Exclude files/directories when using linux tar command

To exclude files/folders when archiving using tar in linux, use the following command:-

tar -czvf filename.tar.gz --exclude 'path1/*' --exclude 'path2/*' --exclude 'path3/*' folder_or_files_to_be_archived

References:-
http://www.wallpaperama.com/forums/how-to-exclude-a-directory-in-a-tar-l...
http://www.cyberciti.biz/faq/exclude-certain-files-when-creating-a-tarba...
http://www.linuxtopia.org/online_books/linux_tool_guides/tar_user_guide/...

Configure multiple log4j instances in different contexts

The problem:
We needed to use different log4j.properties file for each context.

We have one library (directory.jar) which resides in tomcat's shared lib that uses log4j. We also have three contexts (core, admin & user contexts) that will be using log4j for logging too.

Initially, we put the log4j library in tomcat's shared lib, and specify log4j.properties for each context's web.xml. But we found out that only one context is able to initialize the log4j properly. The other two contexts doesn't seem to be able to use log4j properly.

Syndicate content