61 cards

Drupal clean urls and lighttpd

If you are using lighttpd as webserver and host drupal websites you probably have used some lua script and mod_magnet to get clean urls.
Recent versions of lighttpd (1.4.26+) are able to handle rewrites better through the url.rewrite-if-not-file command.
The config for your [virtual] server should look like this:

# deny access to drupal files
url.access-deny = ( "~", ".inc", ".engine", ".install", ".module", ".info", ".sh", ".sql", ".theme", ".tpl.php", ".xtmp...

Javascript Unit Tests under TeamCity using JSTestDriver

To write unit tests for your javascript code you can use a testing framework like JSTestDriver which is able to run under TeamCity.

Usage and configuration instructions for JSTestDriver are available on their website. For integration with TeamCity you'll have to write an ant build file. But to be able to run browsers on your build agent machine you'll have to use Xvfb. The test task in your ant fil…

Running Drupal tests under TeamCity

The annoying thing about Drupal's tests is that they seem to be optimized for running them manually which is insane in my opinion.
Using some hacks it is possible to run them under TeamCity.


  1. a working TeamCity instance
  2. a webserver
  3. a MySQL server

Create a project and build configuration in TeamCity and configure it according to your vcs settings. In the build configuration the following build steps are needed.

TeamCity build steps

  1. Install site via dru…

Uninstall all ruby gems from your system

Sometimes you'll want to remove all ruby gems from your system. This is very easy (at least under unix like operating systems). Just issue the following command:

$ gem list | cut -d" " -f1 | xargs sudo gem uninstall -aIx

Implementing your own scheduler functions for SugarCRM

If you want to implement custom scheduler functions for SugarCRM you should create the file custom/modules/Schedulers/_AddJobsHere.php and implement your functions there:

if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

array_push($job_strings, 'my_task');

 * Description of what my_task does.
 * @return boolean Returns TRUE on success and FALSE otherwise.
function my_task() {
  // Add your code here.
  return TRUE;   ...

Mass renaming files with zmv

The zsh contains a very usefull extension called zmv. You can load it via autoload -U zmv. The man page is located under zshcontrib. A very usefull flag is -n which does not execute the command but prints the command that would be executed. Use this if you are unsure about your patterns.

Here are two simple examples:

Replace all spaces in filenames with underscores.

zmv '* *' '$f:gs/ /_'

Rename all files according to a pattern.

zmv '*.(*).(*).([0-9][0-9])*.mkv' '$1_$2-$3.mkv'

This …

Compiling Sylpheed under FreeBSD

Download the latest tarball from the Sylpheed homepage and unpack it. Afterwards go into the source directory and execute the following commands:

$ export CPPFLAGS="-I/usr/local/include"
$ export LIBS="-L/usr/local/lib"
$ ./configure
$ make
$ sudo make install

Be sure to have required dependencies installed.

This website uses cookies to improve usability and analyze traffic.
Accept or learn more