Posted Sep 10, 2014

To redirect users to the domain page of a website according to the browser default language setting you can use the following .htaccess.

# French
RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.fr$ [NC]
RewriteRule ^$ [R,L,NC]

# German
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.de$ [NC]
RewriteRule ^$ [R,L,NC]

# All other languages
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
RewriteRule ^$ [R,L]

Of course you can add/change/delete languages and domains according to your own needs.

Posted Jun 6, 2014

If you are a big music lover, you probably have a large collection of digital audio on your hard drive. If your collection consist mainly of FLAC files, you have probably ran into some trouble when some piece of software doesn't understand the audio format or the files are simply too big for certain usage like mobile audio players. This is where mp3fs can help you out.

mp3fs is a read-only FUSE filesystem which transcodes between audio formats (currently FLAC to MP3) on the fly when files are opened and read.

It can let you use a FLAC collection with software and/or hardware which only understands the MP3 format, or transcode files through simple drag-and-drop in a file browser.

The big advantages of this wonderful piece of software is that your don't have to manually sync your audio collection twice (once for each format) and that your don't have to sacrifice hard drive space for lossy MP3 files. You can just use or copy the MP3 files like you would with regular files which are then created on the fly for you. As far as your programs are concerned, they are just regular files.

After installation of mp3fs you only have to add one line to /etc/fstab.

mp3fs#/map/to/flac/files /media/mp3 fuse allow_other,ro,quality=2,bitrate=320,gainmode=1 0 0

Now you can mount the virtual filesystem and access your music library in MP3 format.

sudo mount /media/mp3