Screen LoginName too long - sorry.

March 17th, 2009

On my development server I use suexec so each project has its own user which is the domain name for the project. Also I use gnu screen for each project I am working on. This has been an ideal combination except for a few test sites that have usernames longer than 20 characters. When the username is longer and you try to use screen you get the “LoginName too long - sorry.” error message.

This has been a minor annoyance for a while and finally with the addition of another project with this problem I snapped and have patched screen to accept upto 40 character usernames. If you are interested my patch is below along with my rpm built under fedora 10 x86_64.
screen-4.0.3-rjn.patch

screen-4.0.3-13.rjn.x86_64.rpm

Network connection monitoring daemon.

September 4th, 2008

I have been having a few network connection problems lately which could be solved by simply rebooting my router. As a temporary measure to keep my connection available while I am away from my router I created this monitoring daemon that can automatically restart the router. It uses LWP to access the web interface on the router if it can not establish an external network connection within 10 minutes.

http://homecluster.co.uk/perl/constatd.plx

Fixing case sensitive problems when moving a site from Microsoft to Linux

May 16th, 2008

As a lot of people will have found when building a site on a Microsoft machine and transferring it to a Linux server case sensitivity problems occur. For example an index.html file called Index.html or images in a folder called Images but links reference the folder name as images. This causes 403 errors and missing images and css. I have come across this a couple of times on small sites and have always fixed it manually. However a site came to my attention yesterday that had this problem and I could not be bothered to rename all files and correct all links manually. Instead I wrote a script that recursively renames all files to be lowercase and look for anything that looks like a link to a file within the files and lowercase the links as well. It worked perfectly for the site in question and I thought perhaps other people may find it useful so here it is.

http://homecluster.co.uk/perl/lowercase-site.txt

Just save it to your sites main directory and from there execute it. It may need a few file extensions adding to the regex I only added the ones that I needed.

Change

January 27th, 2008

Well the data centre loft project is on hold for various reasons so I thought I would update this blog with information of other things I am working on.

My latest project is writing a perl module for sending email via smtp using authentication. A copy of the first draft attempt is avaliable at
http://homecluster.co.uk/perl/SMTP.pm

It can be used to send an email from a perl script as shown below

use SMTP;
my $e = new SMTP;
$e->connection(”mail.foo.com”,”noreply\@foo.com”,”password”);
$e->email(”fromaddress”,”toaddress”,”subject”,”message body”);
The default authentication type is CRAM-MD5 however it will support PLAIN and LOGIN. The authentication type can be selected in the connection settings.
e.g.

$e->connection(”mail.foo.com”,”noreply\@foo.com”,”password”,”PLAIN”);

Warning: If you choose to use this code please note that the module does not currently do any checks on the data that it is being passed so the script calling it should vaildate any user input.

Why?

June 25th, 2007

The purpose of this blog is to document the creation of a small web hosting cluster in my loft. There are a series of technical challenges to overcome before this becomes a reality including, cost, equipment, software(both installing and creating), and my fiancée. The cluster will be made up of web servers, an email server, database servers, nameservers, NAS units, an ftp server all with two network interfaces one for external traffic and another for heartbeat error detection and automatic redundancy.

I bet you are asking “Why would I want to do this?”. Thats a good question the reason for this project is to learn the ins and outs of all the technology involved in a web hosting network and build experience in system administration.