If you own a shared hosting server, you probably want to keep the /var/log/messages file as clean as possible, to make searching for errors as easy as possible.

One of our web servers had a messages file filled with Drupal errors and warnings. It al seemed to come from one site.
After a bit of searching, it seemed the syslog module in Drupal was enabled. There are two solutions to this annoyance. You can disable the syslog module in the database used by this site, or make syslog log all Drupal errors to a separate file.

Database solution

The most easy method to check and disable the syslog module is disabling this module in the database as follows:

Checking if the module is enabled:
SELECT * FROM system WHERE name='syslog';
If the status column is 0, the module is disabled, in case of a 1 the module is enabled.

To disable the module:
UPDATE system SET status='0' WHERE name='syslog';

And to check if the module is really disabled:
SELECT * FROM system WHERE name='syslog';
The status column should now say 0.

Separate log solution

Create the file /etc/rsyslog.d/90-drupal.conf with the following content, depending on your version of rsyslog.

For rsyslog < v7: # drupal logging
if $programname == ‘drupal’ and $syslogseverity <= '6' then /var/log/drupal.log if $programname == 'drupal' and $syslogseverity <= '6' then ~

For rsyslog >= v7:
# drupal logging
if $programname == 'drupal' and $syslogseverity <= '6' then /var/log/drupal.log if $programname == 'drupal' and $syslogseverity <= '6' then end

That's it. There should be no more Drupal messages in the /var/log/messages file.

I wanted to flash a custom firmware on an HTC Desire S because I didn’t like the Sense interface HTC installed on the device. It felt sluggish and I think it was ugly.

CyanogenMod logoI have unlocked the bootloader on htcdev.com, rooted the device, and installed ClockworkMod (cwm). I chose a rom that seemed usefull (in this case CyanogenMod), and copied the cwm image (.zip file) to my sd-card, and booted into recovery. Here I made a backup of the current rom, did a full wipe, and flashed the image. After this I rebooted the device, expecting to see my new rom boot.
Instead of booting, all I saw was a white screen with the letters HTC in green on an white background. This state is named bootloop.
After flashing back the original rom, the device booted without problems.

I have tried several roms, all with exacly the same problem. After a lot of online research i have finally a booting custom rom. The solution was to flash the correct boot.img file for your rom to the device with the fastboot utility. The file boot.img is in the .zip file of the rom you chose. Flashing the boot.img can be done this way:

  1. Boot the HTC in fastboot mode by powering on the device while holding the Volume – button, and choosing fastboot
  2. Connect the phone to your computer with an micro-USB cable
  3. Flash the boot.img you extracted from the custom firmware:

    fastboot flash boot <path to boot.img>

  4. Reboot the phone

After these steps your HTC Desire S should boot the custom rom as expected!

I noticed a while ago that my Echofon toolbar button had dispapeared in Firefox. I couln’t find any information how to fix this, except that i should enable the add-on toolbar. But Echofon had Firefox toolbar support, so I souldn’t need the add-on bar.

I’ve found out how te re-enable the toolbar button, and decided to share it here.

  1. Navigate in Firefox to about:config
  2. Accept the warning notification:
  3. Type or paste the following string in the filterfield: extensions.twitternotifier.toolbarButtonAdded
  4. Doubleclick on the item which shows up, and make sure it is set to “false”.
  5. Restart Firefox

Now the toolbar button should have reappeared.

Please leave a comment if this solution has worked for you!

Ever been in the situation that you had to copy a bunch of files, and later on wanted to copy only the added files by skipping the existing files?
You can do that with xcopy. Only not with the default paramaters.
For example:

echo n|xcopy f:\source_folder y:\destination_folder /E

The /E makes sure subfolders are also copied. The echo n| prevents overwriting of existing files.

For my (simple) file server I’ve done a minimal installation of CentOS 5.4, and added some repositories. I’ve decided to use ZFS as filesystem for my storage.

The installation of zfs-fuse went smooth, and I’ve created a pool in no-time. There were many tutorials available online on how to do this stuff.

The only problem I ran into, was running out out of memory. The server has only 512Mb Ram, and zfs-fuse was using over 400Mb RAM.

After some research, it seamed the problem was the caching mechanism of ZFS. After a while I figured out how to disable this caching mechanism. You can use the following commands:

zfs set secondarycache=none data

zfs set primarycache=none data

Where data is the name of the pool. This affects the performance of this filesystem, but at least my server doesn’t run out of memory anymore.

Another tip for ZFS: after an update, upgrade your pool to a new version with the following command:

zpool upgrade data