Skip to main content

Posts

Showing posts from 2008

Some Useful Unix commands

I find myself using the below comments day to day. Enjoy!! 1. ps 2. find 3. df 4. du ps Display memory size of the process running sorted 1. ps -e -o vsize,command,time |sort -gr |more for full command line (os x) 1. ps -ax -www |grep Java find find files that matches the filename pattern 1. find . -name "*.*" find anything of type file 1. find . -type f find anything of type directory 1. find . -type d find files (and display contents) that matches the filename pattern and matches content 1. find . -name "*.*" -exec grep 'search me' {} \; find files (and display filenames) that matches the filename pattern and matches content 1. find . -name "*.*" -exec grep -l 'search me' {} \; 2. find . -name "*.*" |xargs grep 'department' df display partition information in human readable format 1. df -h du display disk usage from the current directory in human readable format 1. du -h display disk usage

Oracle Data Tricks

Oracle is not a very friendly enviornment to deal with date types. I always find myself googling around to find a proper method to deal with date arithmetics. The below is a method I came across that helps adding and subtracting years, months, and days from a date type. Enjoy! update employee set SERVICE_DATE = add_months(SERVICE_DATE, -1200) where employee_id in (select e.EMPLOYEE_ID from INTERFACE_EXTRACT et, danaher.employee e where et.NUMBER = e.EMPLOYEE_ID and et.HIRE_DATE != e.SERVICE_DATE and to_number(to_char(e.SERVICE_DATE, 'YYYY'), '9999') > 2010) The above query for example sets the SERVICE_DATE column to be 1200 months earlier. The return value of the add_months function is of type date .

Geronimo and Mysql Driver

I was trying to deploy Alfresco Content Management system into Geronimo. I downloaded the community war version and simply used the deploy script of Geronimo located in GERONIMO_HOME/bin/ to deploy the war file. As soon As I started Alfresco through Geronimo console, I ran into problems with Alfresco not being able to load MySQL Driver. Needless to say, MySQL database was chosen for this deployment. I ended up solving the problem by deploying MySQL driver into Geronimo. You can do this easily through the Geronimo console. On the left navigation of the console, there is a link called Common Libs below the Services folder. When you click on this, you will see an html form that lest you choose the jar file (in this case mysql-connector.jar). With in the form, you can give groupId, artificatId and version to the file. Once you submit the form, mysql connector will be deployed into Geronimo. What you need to do next is to create a geronimo-web.xml file and place it under WEB-INF directory o