Vitalie Lazu old blog

Another blog about ruby, rails, debian and system administration. Other useful staff for developers and system administrators.

Monday, December 01, 2008

Rake tasks to help you with family photos

Yesterday while I tried once again to download photos from my camera with digikam, it gave me a SIGABRT crash, I'm using kde 4.1.3, so I tried to build new deb package for digikam 0.10.beta6 and I did not succeed, many kde dependencies and I could not want to break my installation.

So as quick solution I wrote a small Rakefile to help me download photos from my camera and arrange them in folders by photo date (Like I used digikam). I want to share this rake tasks, maybe it will save time to other people. Currently it only support jpeg files. Bonus: it can rotate photos based on exif information related photo information.


rake ph:get # Get photos from camera to current folder
rake ph:delete # Delete all photos from camera
rake ph:arrange # Arrange photos in folders by date
rake ph:rotate # Rotate photos from exif info
rake ph:list # Show photos info


Here is a source code: http://gist.github.com/30716

Labels: , , , ,

Monday, November 05, 2007

Apache process hangs in memory with mode operation L.

I have a heavy loaded website with 12req/second and I use apache 2.2.6 with mpm_event_module, because threaded and prefork modules suck already. Apache server with 5 mongrels in cluster: 3 on the same server and 2 remote. MYSQL is also remote. Memcached runs on the same server. NFSD also running. Below is apache tuning for mpm_event module:

StartServers 1
MaxClients 150

MinSpareThreads 15
MaxSpareThreads 25
ThreadsPerChild 25
MaxRequestsPerChild 0
It works great, with some exceptions: some apache processes hangs in memory with mode operation L (logging request to disk)
Mod status says that pid 31159 hangs for 1278 seconds (20 minutes) and it wastes system resources, making website to load slower. I had to kill hanging processes manually for some time, but in last weekend I wrote a simple ruby script that use hpricot gem to parse mod status and detect hanging processes wit h status L, then it kill them. I put it in a cron job to run every 10 minutes and i forget about the problems.

Labels: , , ,