Linux

CentOS http and php

setting up Apache, mysql and php on a Centos box. Centos default to

short_open_tag = Off
[/bash]
In php.ini. This means if you’re like me and throwing up a phpinfo.php script to test php after installation, remember to either set this setting to On, or remember to specify php in top of you php scripts (I’ve goten lazy, haven’t specified that for a while) .
While I’m at it, got to rant a bit about:
Debian just makes it all so much easier configuring Apache !!

Totem Movie Player and buffer

I’m a keen listener to somafm.com . Totem seem to default to a 2 seconds buffer which for me sometimes is too small. I like to increase the buffer to prevent annoying glitches now and then. This post show how to do this with gconftool via cli . Personally I like to do this via Gnome configuration editor (Applications -> System tools -> configuration editor), go to apps -> totem and set the ‘network-buffer-threshold’ (it’s set in seconds) ,

Pin a package to prevent apt from upgrading it

I got a rdesktop package from a specific ubuntu ppa repo that fixed a bug, the fix hasn’t made it into the official ubuntu repo for some unknown (to me) reason. I install my local package with dpkg but apt-get upgrade always upgrades that package and I have to do it all over. I remember pinning a package in Debian some years back, so I tried the same solution on my Ubuntu Natty setup.

joar@jupiter:~$ cat /etc/apt/preferences.d/rdesktop
Package: rdesktop
Pin: version 1.6.0-2ubuntu3ppa1*
Pin-Priority: 1001

joar@jupiter:~$ 

As you can see I created a /etc/apt/preferences.d/rdesktop preferences file, and now my apt-get upgrade leaves redesktop to the version I’ve installed with dpkg. ๐Ÿ™‚
More info regarding pinning in :

$ man 5 apt_preferences

That anoying warning from ssh-client when you’ve moved a server

I don’t know how long it’s been around, but I just noticed

<strong>joar@jupiter:~$ ssh vir04</strong>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
55:[...]:e2:ac:b0.
Please contact your system administrator.
Add correct host key in /home/joar/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/joar/.ssh/known_hosts:306
  remove with: ssh-keygen -f "/home/joar/.ssh/known_hosts" -R vir04
RSA host key for vir04 has changed and you have requested strict checking.
Host key verification failed.
<strong>joar@jupiter:~$ ssh-keygen -f "/home/joar/.ssh/known_hosts" -R vir04</strong>
/home/joar/.ssh/known_hosts updated.
Original contents retained as /home/joar/.ssh/known_hosts.old
<strong>joar@jupiter:~$ ssh vir04</strong>
The authenticity of host 'vir04 (91.207.158.93)' can't be established.
RSA key fingerprint is 55[...]ac:b0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'vir04' (RSA) to the list of known hosts.

NICE feature

/proc/scsi support in Debian Squeeze

I bought a cheap HighPoint raid controller recently, it was supposed to support Linux. The driver compiled easily but the raid CLI utility which I need to check raid health status just wouldn’t work. After hacking at this for a while it was when I used strace to run the hptraidconf binary that I discovered the program wanted to read info about the disks from /proc/scsi . /proc/scsi has been superseded by sysfs in recent Linux kernels. But Linus and his crew have left an option “legacy /proc/scsi support” in the kernel config. The Debian developers don’t seem to think it necessary to enable this option in the kernel config for 2.6.32 in Squeeze (though it seems Ubuntu think it necessary in their config for Ubuntu 10.10 which I have at my laptop). Anyway, my solution turn out to be:

# apt-get install linux-source-2.6.32
# cd /usr/src && tar jxvf linux-source-2.6.32.tbz 
# ln -s linux-source-2.6.32 linux
# cd linux

And the rest is described at howtoforge .
The key here is to enable ‘legacy /proc/scsi support’ from the ‘scsi device support’ submenu .

Exim and invalid ‘EHLO’ chars

We had some mac users complaining that they couldn’t send mail via our exim smtp server. Exim logged stuff like ‘

rejected EHLO from []: syntactically invalid argument(s): test\.no

To work around telling the end user to use an other email client, or tell Apple to fix their mail client I ended up using the directive

helo_allow_chars = '\'

in exim.conf instead.