Category: Linux

  • Gutsy Issue with SATA drives

    Here is how I permanently fixed it:

    1) make a file named “99-hdd-spin-fix.sh”. The important thing is starting with “99”.

    2) make sure the file contains the following 2 lines (fix it if you have PATA HDD):

    #!/bin/sh
    hdparm -B 255 /dev/sda

    3) copy this file to 3 locations:
    /etc/acpi/suspend.d/
    /etc/acpi/resume.d/
    /etc/acpi/start.d/

    Voila! After that the HDD never spins down on power (looks like it actually spins down on battery at modest rate). Sorry if the instruction is too detailed, no offense.

  • Setting default editor on Linux

    # update-alternatives --set editor /usr/bin/vi
  • Using Apache WebDAV on XP

    Using WebDAV from XP is a problem due to bugs in XP implementation of WebDAV support (it calls web folders).

    Here are some solutions I’ve found:

    http://ulihansen.kicks-ass.net/aero/webdav/

    http://www.chasen.name/apachewebdavforwebfolders(webfolders)

  • Mounting an old LVM disk

    DHCP server died at work today. We mounted the old hard disk on KNOPPIX and thought it would be easy to get the files off the bad hard disk. Well wouldn’t you know, the old dying hard disk is running LVM. Here are the commands needed to mount an old LVM disk.

    vgscan
    vgchange -a y
    mount -t ext3 /dev/my_volume_group/foo /mnt/backup
  • Updating to Debian Etch broke Amavis-Stats

    Updating to Debian Etch broke Amavis-Stats:

    Amavis Detection Statistics
    Daily Graphs
    amavis-stats::error: rrd_graph(): 1
    amavis-stats::error: rrd_graph(): 1
    Weekly Graphs
    amavis-stats::error: rrd_graph(): 1
    amavis-stats::error: rrd_graph(): 1
    Monthly Graphs
    amavis-stats::error: rrd_graph(): 1
    amavis-stats::error: rrd_graph(): 1
    Yearly Graphs
    amavis-stats::error: rrd_graph(): 1
    amavis-stats::error: rrd_graph(): 1

    I searched Google for a solution but every other post on the subject suggested downgrading rrdtool. This is not an appropriate fix. I debugged the actual amavis-stats script and here is my fix. It involves commenting out some lines in /usr/share/amavis-stats/amavis-stats.php:

    Line 650:

    // $opts[] = "COMMENT:amavis-stats v$asVersion ";
    // $opts[] = "COMMENT:$enddate \\r";

    Line 771:

    // $opts[] = "COMMENT:amavis-stats v$asVersion ";
    // $opts[] = "COMMENT:$enddate" . str_replace(":", "\:", $enddate) . " \\r";