Sunday, August 30, 2009

easy_install read pip requirements.txt file

No way to feed PIP requirements file into easy_install, so the following snippet do the job:-


import os

f = open("requirements.txt")
reqs = f.read().split("\n")

for req in reqs:
# ignore comments or pip options
if req.startswith('--') or req.startswith('#'):
continue
# ignore blank lines
if len(req) > 0:
os.system("easy_install %s" % req)

Stopwatch - Measuring page loading time

Nice tools - http://www.numion.com/Stopwatch/index.html

Saturday, August 29, 2009

Sed: Delete next n lines after match


ALTER TABLE some_table ......
CREATE VIEW user_log_view AS
SELECT some_column .....
SELECT * FROM some_table ...


cat dump.sql | sed "/CREATE VIEW user_log_view/,+2d" Would delete CREATE VIEW statement definition.

Monday, August 24, 2009

Bookmark

Found few interesting stuff:-
Pressflow, kind of Drupal distro aim for faster performance - http://pressflow.org/

Drupal module for OpenLayers - http://drupal.org/project/openlayers

Flunc, web functional test - http://www.coactivate.org/projects/flunc/project-home

Kind of heard about Twill before never look into it. Look quite interesting. Flunc act as a wrapper to twill script.

Sunday, August 23, 2009

Meta blog

With www.k4ml.com being abandoned and not updated anymore, I've decided to start blogging here. The old site probably would being resurrected as a business site some other time. For now, all stuff would end up here.