June 2010

guaka: I found out (in French): Proprietes systeme->Materiel->Gestion de l'ordinateur->Stockage->Gestion des disques, then reformat(!) and choose t

I found out (in French): Proprietes systeme->Materiel->Gestion de l'ordinateur->Stockage->Gestion des disques, then reformat(!) and choose t

guaka: how to create a H: drive in Windows? (proprietary software sucks and wants me to jump through burning hoops)

how to create a H: drive in Windows? (proprietary software sucks and wants me to jump through burning hoops)

(mdb to) csv to MySQL

Quick and dirty PHP script to turn a CSV file into a table in a MySQL database. Used for a Drupal project, so I ran it with drush php-script. Couldn't find anything better online. Feel free to use it.

If I need it again some time I will probably make it a bit nicer (I might also make it nicer if you ask me nicely and/or pay me to do it).

In the project I'm using it, I first converted an .mdb file to .csv with mdbtools.

<?php

$handle = fopen("/tmp/test.csv", "r");
$headers = fgetcsv($handle);

guaka: 94,80 EUR for return ticket Brussels-Utrecht Lunetten? On trains that are mostly empty anyway? Why not budget trains, like budget airplanes?

94,80 EUR for return ticket Brussels-Utrecht Lunetten? On trains that are mostly empty anyway? Why not budget trains, like budget airplanes?

Rewrite Rules (not) - Lowercase URLs, but only for some specific paths

This took me enough time to get right to post a little blog post about it:

        RewriteEngine on
        RewriteMap lc int:tolower
        RewriteCond %{REQUEST_URI} (shared|Shared|download|Download)/[A-Z]
        RewriteRule (.*) ${lc:$1} [R=301,L]

Note that this doesn't work in .htaccess - you have to put it higher up in the Apache configuration.