Posts

Building log4cxx from dev trunk [new incubation repo]

Log4CXX recently moved to Apache incubation. So its trunk[dev branch] is moved to http://svn.apache.org/repos/asf/incubator/log4cxx/trunk Here I'll explain how to build log4cxx from trunk. In additionally to log4cxx, you need Apache Portable Runtime and , APR-Utils libraries. Because, Log4CXX depends on APR. I'm using Ubuntu 12.04 version here. Download APR and APR-Utils from APR site at: http://apr.apache.org/download.cgi I've tree my downloaded folder here, with latest[at blogging date]. Using wget will be easier for apr and apr-utils. ├── apr-1.5.0 ├── apr-util-1.5.3 └── trunk     └── src         ├── ant         ├── assembly         ├── changes         ├── examples         ├── main         │   ├── cpp         │   ├── include         │   └── resources         ├...

Killing a file handled process

You may have faced the problem which a dead/unreferenced process is holding a file descriptor to a file, so that you cant delete it using rm command, and giving an error message like below: Cannot delete folder with rm -rf. Error: device or resource busy Here what you have to do is to identify the process been hanged and kill it. lsof +D this will give you a list of process which are accessing files in the given folder. kill that session using: kill if you still couldn't kill it use below. kill -s SEGV 'via Blog this'

Upgrade SVN client in older ubuntu versions

Ubuntu LTS version[12.04] doesn't have svn client 1.7 installed. If you tried to use a newer svn local repository with default version, you get an error: This is the fix: sudo apt-add-repository ppa:dominik-stadler/subversion-1.7 If you already have subversion previous intalled, remove it sudo apt-get remove subversion sudo apt-get update Now, reinstalling subversion will fix your issue. But it may required to download some files [about 4 MB] from subversion site. sudo apt-get install subversion

Make your Ubuntu Terminal - Case-Insensitive.

Sometimes its annoyed when you type a command on the terminal. Because it doesn't find a directory or an application, just because you miss capital/simple letters. Using below command you can avoid such issues if [ ! -a ~/.inputrc ]; then echo "\$include /etc/inputrc" > ~/.inputrc; fi echo "set completion-ignore-case On" >> ~/.inputrc

Oracle pagination query example

    select         *      from         ( select             row_.*,             rownum rownum_          from             (  YOUR SELECT STATEMENT WITH WHERE,GROUP,ORDER,AGGREGATES,ETC  ) row_ )          where             rownum_ <= ?              and rownum_ > ?

Important Oracle queries

SELECT s.inst_id,        s.sid,        s.serial#,        p.spid,        s.username,        s.program FROM   gv$session s        JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id WHERE  s.type != 'BACKGROUND'; ALTER SYSTEM KILL SESSION '8,11'; SELECT O.OBJECT_NAME, S.SID, S.SERIAL#, P.SPID, S.PROGRAM,S.USERNAME, S.MACHINE,S.PORT , S.LOGON_TIME,SQ.SQL_FULLTEXT FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S, V$PROCESS P, V$SQL SQ WHERE L.OBJECT_ID = O.OBJECT_ID AND L.SESSION_ID = S.SID AND S.PADDR = P.ADDR AND S.SQL_ADDRESS = SQ.ADDRESS;   SET AUTOTRACE ON;   SET TIMING ON;   SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());     explain plan FOR ...          alter user e2etracking identified by e2etracking account unlock;

Using ComboPooledDataSource in Spring context

destroy-method="close"> jdbc.Driver=oracle.jdbc.OracleDriver jdbc.url=jdbc:oracle:thin:@serverhost:1521:XE jdbc.username=xxxxx jdbc.password=xxxxxx #jdbc.url=jdbc:oracle:thin:@serverhost:1521/SERVICE_NAME jdbc.initialSize=2 jdbc.maxActive=5 jdbc.maxIdle=2 jdbc.minIdle=1 jdbc.validationQuery=select 1 from dual jdbc.removeAbandoned=true