From _en_ into a translatable _en_

On a multi language site it is desirable to translate the drupal English into the customers Englich likings.

Steps taken

  1. Goto /admin/settings/language/add
    1. Add a custom languages with language prefix en, name en-ours, english English @ Our place and native English @ Our Place
    2. Make your new language the default.
    3. Disable drupal's en
    4. Change the name en-ours into en

Relocating the files directory

Trying best practices I occasionally move the files directory from DRUPAL_ROOT/files/ to DRUPAL_ROOT/sites/my-sites/files

Doing this has some implications for the files table content. All file-path are pointing to the wrong location.

Quick solution for this is an mysql replace update query.

select replace(filepath, 'files/my-site/', 'sites/my-site/files/') from files;
# update files set filepath=replace(filepath, 'files/my-site/', 'sites/my-site/files/')"

Or through drush

Managing your svn repository with external ones

So you finally have your own svn repository. But you need to use external code as well. And you want to keep track of changes in those external code. Then use svn:externals. This tells subversion there are external subversion repositories destined to blend into the current folder. I learned this from a script thanks to Wim Leers

First let's create an externals to a repository in the current directory.

svn propedit svn:externals .
If this fails configure an editor like this
export EDITOR=vi

Subversion setup with apache

Setting up an apache based subversion needs a little more work then doing it with a plain or svnserve setup.

My steps are described here and executed on two computers.

Create your repository

# the switch --fs-type fsfs is the default 
# but I was a little worried of getting the bdb file system
svnadmin create --fs-type fsfs demo

Make sure apache is capable of reading the repo and other cannot

# /var/lib/svn is owned by root so let www-data (apache) access the repos dir.
chmod o+rx /var/lib/svn
chmod -R o-rwx demo
chown -R www-data:www-data demo


These pages describe my interpretation of a subversion setup.

Remote File module

Subversion setup with svnserve

After using bazaar for some time I decided to turned back to subversion. The main reason is time. For some reasons my webservers bazaar version is way of my laptop version. So here is my laptop svn configuration. Not clean, not finished.

(This solution with svnserve is not workable in an open source enviroment. People need shell access for this method)

On the server side do

# Make the storage
mkdir /var/lib/svn
# Make sure nobody can read your repo directory
chmod o-rwx /var/lib/svn
cd /var/lib/svn
# Make a test repo
svnadmin create test
# Add test user

get the audio from of a flash movie

Did you know? Did I knew? I needed to extract the audio from a flash movie. Quite simple right? So why took it 2 minutes my first time? Because I forgot the no interest in video switch. I found this one on

# -vn : video kill switch
ffmpeg -i video.flv -vn -acodec copy audio.mp3

That -acoder copy still puzzles me. It is a copy the audio codec. But my flash movie had a mp2 codec. Is that a problem for mp3 players?

free form: 

Importing languages the rough way.

Guess it's not intended to do but this is how I import languages into Drupal 6.

  1. wget the language files needed
  2. run the script below which creates *_full.po files.

    #!/usr/bin/env bash

    for FILE in *.tar.gz
    DIR=`basename $FILE ".tar.gz"`
    [ -f $OUT ] && rm $OUT && echo "File $OUT removed ... "
    [ -d $DIR ] && rm -r $DIR && echo "directory $DIR gemoved ..."
    [ ! -d $DIR ] && mkdir $DIR && echo "directory $DIR created ..."
    cd $DIR
    tar xzf ../$FILE
    find . -type f -name "*.txt" -exec rm {} \;
    rm $OUT