tail a file that is recreated
tail -f –follow=name –retry fie This will tail a file even if the file is recreated. Typical use includes tailing a log file that is rolled over. (e.g. apache logs)
tail -f –follow=name –retry fie This will tail a file even if the file is recreated. Typical use includes tailing a log file that is rolled over. (e.g. apache logs)
kill $(ps aux | grep “java” | grep -v ‘grep’ | awk ‘{print $2}’) kills all java processes. grep -v ‘grep’ ignores the current grep command If you need to give them a chance to gracefully shut down first then do this pids=”$(ps -C “java” -o pid,bsdstart | fgrep -v “:” | awk ‘{print $1}’)” … Read more
find . ! -name ‘*gz’ -type f -delete This deletes all files that do not contain ‘gz’ in its filename
find . ! -name ‘*gz’ -type f This searches recursively in the current folder for all files that do not contain ‘gz’ in its name.
To search a folder recursively for files that contain a specific string using this grep -rnw -e ” . Note that this searches the file content. to search for string in file name use this find . ! -name ‘*gz’ -type f -delete
I went on a trip to Singapore recently and took around 500 photographs. I am not very good behind a camera, so i just got trigger happy and clicked whatever i could. After coming back i transferred the photographs to my laptop and started organizing them. I had some photos in my cell phone, some … Read more
If you have a site developed in J2EE and deployed on apache tomcat or glassfish, then implementing a wordpress blog on your site would be challenging since wordpress is all PHP. In this article we show how to install wordpress on a J2EE server. In the previous article we saw how to install Quercus on … Read more
In this article we look at how to run a php file in apache tomcat using Quercus. For those of you who have no clue why this article should exist, here is the complete story; Apache Tomcat is a J2EE application server, which means, it can run web applications that have been written in java … Read more
This article looks at how to merge shapefile polygons using Quantum GIS. you can download Quantum GIS from Here. We demonstrate the merging using an example. We have a France shapefile that shows all the regions in France. We want to merge all the regions and create a single shapefile for France. Here are the … Read more
Debugging PHP pages for a web application may be challenging. However, firePHP, a firefox extension can make debugging PHP pages very simple. Here are the steps to start debugging using firePHP. 1. Install firebug from https://getfirebug.com/downloads. 2. Install the firePHP extension from https://addons.mozilla.org/en-US/firefox/addon/firephp/. The browser is now ready to receive the PHP logs that are sent from … Read more