Sunday, November 7, 2010

Dumps: Packaging web apps using Phing and Debhelper

Minutes ago I added a sample application, foobar drupal site, that is:
- build with drush_make Drush plugin
- packaged as debian package, using Debhelper
- "duck tapped" everything with Phing

Source code here: https://github.com/cbalan/bg-sandbox/tree/master/drupal-phing-deb/

The cool thing about this is build/generic-build.xml's debian-package target that basically allows you to package anything by just overriding properties or adding new files (ie. links conffiles, install, etc)

Currently, I'm using this approach to package all sorts of apps, from basic php scripts, custom php extensions, drupal/magento sites to java apps.

Wednesday, August 4, 2010

Dumps: Magento URL Rewrites

If you'll ever need to get something like:
 /path/product/12321.html to point to /path/product/view/id/12321/type/html/
 /path/product/12321.json to point to /path/product/view/id/12321/type/json/
you can add this in your Magento extension config.xml:
...
<global>
  <rewrite>
    <Namespace_Module>
      <from><![CDATA[#^/path/product/(\d+)\.(json|html)$#]]></from>
      <to><![CDATA[/path/product/view/id/$1/type/$2/]]></to>
    </Namespace_Module>
  </rewrite>
...

Tuesday, July 27, 2010

Dumps: Install Drupal 6.x site from cli

Problem: Install Drupal 6.x site from cli.

Solution: The following bash script is being translated into a drush command available here: http://drupal.org/project/drush_site_install6

Tuesday, September 22, 2009

Dumps: Fun with pipes

Problem: Checking out who accessed some webapp. Log file format:
[21/Sep/2009:10:31:21 -0400] cbalan "GET /webapp/some_url HTTP/1.1" 200
[21/Sep/2009:10:31:21 -0400] robocop "GET /webapp/some_url HTTP/1.1" 200

[21/Sep/2009:10:31:21 -0400] cbalan "GET /webapp/some_url HTTP/1.1" 200
[21/Sep/2009:10:31:21 -0400] cbalan "GET /webapp/some_url HTTP/1.1" 200
[21/Sep/2009:10:31:21 -0400] bad_monkey "GET /webapp/some_url HTTP/1.1" 200

[21/Sep/2009:10:31:21 -0400] cbalan "GET /webapp/some_url HTTP/1.1" 200
[21/Sep/2009:10:31:21 -0400] webrat "GET /webapp/some_url HTTP/1.1" 200
[21/Sep/2009:10:31:21 -0400] webrat "GET /webapp/some_url HTTP/1.1" 200

[21/Sep/2009:10:31:21 -0400] cbalan "GET /webapp/some_url HTTP/1.1" 200
Solution:
#bash> cat /var/log/apache2/webapp_log | cut -f 3 -d ' ' | sort | uniq

Friday, September 4, 2009

Bike: Route around Campina/Romania

For this weekend(9/5) I'm planning to do this route: http://www.bikemap.net/route/252473
Updates tomorrow.

BTW, awesome site: http://www.bikemap.net/

Update: Some pictures here: http://picasaweb.google.com/catalin.balan/20090905Breby#

Dumps: Patching Testlink-1.8.3 & LDAP & fallback to MD5

Patch for Testlink-1.8.3 that allows LDAP users auto-creation & local MD5 fallback.
Patch availabel here: http://testlink-dev.googlegroups.com/web/testlink-1.8.3-autocreate_ldap_users.patch