Tag search

Easily remove unused MySQL databases

by Sander Marechal

I use PHPUnit and the DbUnit extension for my unit tests. Because I use InnoDB tables with foreign keys I cannot use an SQLite database or temporary tables to run my unittests on. So, I have set up a separate MySQL server to run all my unittests on. My PHPUnit bootstrap script simply generates a random database name and imports the schema so that DbUnit can use it.

The only downside is that after a while, you get a bunch of unused databases on the server. So, I have written a simple bash cronjob that deletes all databases from the server that have not been used for 30 days. This script uses the debian-sys-maint MySQL user that is automatically set up on all Debian systems for maintenance tasks.

Open Source News from FOSDEM 2009 - Day 2

by Sander Marechal

In the weekend of 7 and 8 February, the 9th Free & Open Source Developers' Europe Meeting (FOSDEM) took place at the Université Libre Bruxelles (ULB) in Brussels. Your editors Sander Marechal and Hans Kwint attended this meeting to find out for you what's hot, new in the area of the Linux environment and might be coming to you in the near future. This is our report of the second day covering the talks about Thunderbird 3, Debian release management, Ext4, Syslinux, CalDAV and more. Coverage of the first day can be found in our previous article.

This article was originally posted on LXer Linux News.

Open Source News from FOSDEM 2009 - Day 1

by Sander Marechal

A week ago, the 9th Free & Open Source Developers' Europe Meeting (FOSDEM) took place at the Université Libre Bruxelles (ULB) in Brussels. Your editors Sander Marechal and Hans Kwint attended this meeting to find out for you what's hot, new in the area of the Linux environment and might be coming to you in the near future.

Here is the blow-by-blow of the first day with talks about Mozilla's future, the role of Debian, two OSI talks, Reverse engineering and much, much more.

This article was originally posted on LXer Linux News.

Patching exuberant-ctags for better PHP5 support in vim

by Sander Marechal

Thanks to the taglist vim plugin, vim users have access to a decent tag browser. A tag browser allows you to view a list of all variables, functions and classes and quickly jump to their definitions. Taglist is built on exuberant ctags so it support a large amount of languages. Unfortunately however, when the exuberant ctags people replaced their old PHP lexer with a brand new regexp-based parser the quality of parsing PHP code decreased dramatically. Ctags suddenly could not distinguish real class and function declarations from mere mentions of the words “class” and “function” in multi-line comments. This is because the ctags regular expression parses is inherently line oriented.

In this article I have two patches that greatly improve PHP support in exuberant-ctags. I will also show you how you can apply these patches on a Debian-based system.

Update 2009-07-07: David Mudrak has written an updated patch for Gentoo. I have ported his improvements back to my patch here. It fixed a problem with old-style functions without a visibility declaration and it applied the same trick to interfaces as well.

Setting up dual monitors system-wide with XRandR on Debian Lenny

by Sander Marechal

I have been playing with my monitor setup again on my Dell D530 laptop. The internal monitor of the laptop is 1400x1050 pixels, but I usually use a 19" external monitor set to 1280x1024. With Etch this worked flawlessly. When the external monitor was hooked up and the lid on my laptop was closed, then my desktop would be 1280x1024. When I booted with the lid open and no monitor attached, the desktop would be 1400x1050. When I upgraded to Lenny this stopped working. I had to change the resolution each time I changed from external screen to internal screen and back. I reported a bug about this but the answer came down to “It’s not a bug but a feature. Use XRandR to change your displays if you don’t like it.”

So, I dove into XRandR. I wanted this to work for all users, so simply sticking some XRandR commands in the gnome session startup wasn’t going to suffice. At the same time I also got interested in trying a dual-head setup instead of only an external monitor when one was connected. I was going to need completely different layouts depending on the external monitor. It took a while before I figured out how to do it, it took a little longer to fight GNOME into submission, but here is how to make it work.

Digg this article: This article on Digg

How to install Tracks on Debian Lenny with Apache mod_fcgid

by Sander Marechal

I have recently read Getting Things Done (GTD) by David Allen. My geek life is the usual “too much to do in so little time” and I keep forgetting all kinds of important stuff. I saw a lot of FOSS sites covering GTD in the past few months so I decided to give it a go, read the book and play with all kinds of software. I quickly came across Tracks, a nice looking GTD application to manage your actions.

Unfortnately it's written in Ruby on Rails which can be a bit of a pain to set up under Linux, especially if you want to use Apache as the webserver instead of the built-in WEBrick server. I'm already running Apache on my server and I didn't feel like running a second webserver on a different, non-standard port just for this one app. It took me quite a bit of time to piece it all together, but here’s how I set up Tracks in Debian Lenny.

Moving LVM volumes to a different volume group

by Sander Marechal

I recently ordered a brand new PowerEdge T105 server from Dell because my current home server, a HP ProLiant G3, is much too power hungry for my liking. It consumes about 300 Watt round the clock, increasing my power bill by nearly € 50 a month. The T105 consumer about a third of that, usually less. The new server came with an 80 GB hard disk. I partitioned it with LVM, installed Debian Lenny and moved over the bulk of my things from the old server to the new server. I did that manually over the course of two weeks because it was a good time to restructure and upgrade many other things in the process.

When I was done only one thing remained: my media collection, which is stored on a 500 GB RAID1 array on the old server. That RAID1 array is also partitioned using LVM in a single 500 GB volume group. I took the two drives out of the old server, put them in the new server, copied over /etc/mdadm/mdadm.conf from the old server and all was well. Nearly. My media collection only uses a small part of the 500 GB volume group, so I wanted to move the OS volumes from the 80 GB volume group to the 500 GB volume group. That way I could take out the 80 GB disk and save some power. Problem: There is no obvious way to move a logical volume from one volume group to another. Additional problem: I can’t run the OS from the 80 GB volume group when I am migrating them. Cue SytemRescueCD.

Package Management Sudoku

Russell Coker recently wrote a post entitled “Ownership of the Local SE Linux Policy”. This post has nothing to do with the substance of his post, which is a discussion of how distributions should configure SELinux by default. I know nothing about SELinux, but something that Russell said in passing caught my attention:

I am not aware of the Debian package dependencies (or those of any other distribution) being about to represent that the postfix package depends on selinux-policy-default-postfix if and only if the selinux-policy-default package is installed. Please note that I am not suggesting that we add support for such things, a package management system that can solve Sudoku based on package dependency rules is not something that I think would be useful or worth having.

As it happens, a little-known fact about the Debian packaging system is that you can, in fact, describe Sudoku puzzles in it!

From: Daniel Burrows’ Blog.

Howto: build and install the intl PECL extension for PHP5 in Debian

by Sander Marechal

For the past few days I have been looking for a proper i18n (internationalisation) and l10n (localisation) method for PHP. PHP has quite a few locale aware functions such as strftime and sprintf. In combination with gettext this can work quite well. The major downside is that you need to install all the locales that you want to support on your server. Want to serve your websites in Russian? Then you need to generate a Russian locale system-wide. That won’t work when you’re on a shared hosting account somewhere.

PHP6 is promising to solve that problem with the intl functions. Even better, the intl functions are also available as a PECL extension and works on PHP 5.2.4 and newer. Debian Etch currently packages PHP 5.2.0 which is too old, but Lenny—Debian’s upcoming version—is up to PHP 5.2.6. There is no package (yet) for php5-intl in Debian Lenny but building and installing the extension yourself is really easy. Here’s a short tutorial.

Automatically mounting and unmounting Samba/Windows shares with CIFS

by Sander Marechal

Last updated on 2007-12-03@23:55. At my work the employees are in the fortunate position that they are free to choose whatever OS they want to work with. At the moment the default is still Windows XP but you are free to wipe the drive and install whatever you feel—as long as you can do your job properly. And there is work underway to roll our own distribution for internal use. You're even free to bring in your Mac (but we won't supply you with one). The only thing that's banned (unofficially) so far is Windows Vista. Server-side we run a mixture of Linux and Windows, and the thend is to replace broken Windows machines by Linux machines if possible. In such a heterogeneous environment it makes sense to share our files through Samba. It's one of the few protocols that any OS can speak.

If you're running Windows Server 2003 then you can't use the smbfs driver that most Linux distributions ship by default. Sorry, no "Places » Connect to server" for you GNOME folk. You'll need to use the CIFS filesystem driver and you'll need to edit /etc/fstab. Adding the required fstab entries is actually quite easy as I will show below, but on Debian and it's derivative distributions you get a nasty error when you subsequently try to reboot or shutdown your machine, which hangs for about 30 seconds waiting for a timeout:

CIFS VFS: No Response for Cmd <number> mid <number>

It took me quite a bit of time to properly solve that one, but in the end it turned out to be quite simple. I will show you later in the article, but let's start mounting first.

Using Lightning 0.5 with Debian's IceDove

This is just a quick heads-up for those who want to use Mozilla's Lighting calendar plugin in combination with Debian's IceDove Thunderbird spin-off. You need to install libstdc++5 for it to work. If you don't, you get the Lightning user interface showing in IceDove but you cannot create new calendars.

Configuring Debian/etch on a Dell Latitude D520

by Sander Marechal

A new job brings new toys :-) My new employer has supplied me with a Dell Latitude D520 laptop for programming. It came loaded with Windows XP professional which—ofcourse—had to go. Nothing inhibits productivity quite like Windows—except perhaps for the pool table and game consoles in the lunch room. Basic installation of Debian/etch went without a hitch as expected. I used the official 4.0 netinstall ISO using a cable instead of relying on wireless. After the reboot I did find a few small problems though. I'll describe them here, and what I did to fix it, so I can hopefully save other people the headaches.

Debian/etch Xen: Nice, but not quite ready for me

by Sander Marechal

In my previous post I explained how I set up my new server as a Xen server in order to maximize my flexibility. It's been little over a week now and I am saddened to say that Xen has gone out the Window. While I love the flexibility, it's just not ready for me yet.

A test drive of Debian/etch Xen

by Sander Marechal

Daddy's got a brand new toy to play with :-) A few months ago swbrown posted a fantastic tutorial on the LXer forums that gave a short overview of setting up RAID with LVM, Xen and LUKS. Around that same time I noticed a decommissioned HP server at my job. I decided to buy it off my boss and see if I could get to swbrown's nice setup. Here is an overview of the machine:

HP ProLiant ML370 G3
Dual Xeon 3.2 Ghz CPU
1024 Mb RAM
4 x 36.4 Gb + 2 x 18.2 Gb hardware RAID array

Here's how I fared in making this new toy into a flexible Xen server.

Gnome Hearts 0.1.3 Release Announcement

by Sander Marechal

We are happy to announce the immediate release of gnome-hearts version 0.1.3. This release fixes some crashing behavior related to card styles on Debian and Debian-based systems [1][2][3][4] and fixes a similar potential crash regarding background images on any system. It also adds Polish documentation and updates all other in-game translations. You can download the latest version from our downloads page [5] or our APT repository [6].


About Gnome Hearts

Gnome Hearts is an implementation of the classic hearts card game for the GNOME desktop, featuring configurable rule sets and editable computer opponents to satisfy widely diverging playing styles. Gnome Hearts is Free Software, released under the GNU General Public License and should be able to run on any computer that can run the GNOME desktop.


Setting up and managing an APT repository with reprepro

by Sander Marechal

If you are writing software for Debian GNU/Linux or deratives like Ubuntu then setting up an APT repository is a very useful thing to do. Setting up an APT repository for your users makes it very easy for them to keep up-to-date with the latest version of your software, far easier than providing .deb's as downloads on your website.

This tutorial will show you how to do just that with reprepro. Reprepro makes it very easy to set up APT repositories that use a common /pool directory to store all the package files. In this regard, reprepro is superior to APT tools such as apt-ftparchive. I am going to assume that you are already familliar with the basic workings of an APT repository.

Gnome-hearts 0.1.2. binaries available

by Sander Marechal

I have created binaries for gnome-hearts-0.1.2 for Ubuntu Dapper Drake i386 and amd64 architectures. You can download the from our download page and from our APT repositories.

Binaries for Debian unstable/testing and Ubuntu Edgy Eft should be available as soon as they have been accepted in their main repositories.