Category Archives: TermiHouse

Tips and Stuff

I have recently moved to a new virtual server hosting provider, Linode have hosting centres in 4 locations in the US and allow you to pick which centre you would like your server in. They have a great web user interface and are cheaper than my previous provider, Slicehost. So now I am paying about half what I was for hosting. I have also got away with using a lot less memory for my virtual server, by implementing some different ways of getting around spam.

Realtime DNS Block Lists (DBL)

DBL’s store a list of known IP addresses which should not be trusted when receving mail, either they are IP’s assigned to home machines (DSL/Cable clients) or known spammers caught out by traps. There are a few DBL’s, but until now I have only been using one – Spamhaus, but sadly this doesn’t catch most spammers. I have now been through my configuration and included a few more DBL’s which are listed below. The advantage of this is that looking up an IP in a DBL is not processor or RAM intensive and does not require an external program – like Spamassasin. I have also implemented a few features in postfix which allow the looking up of hosts who try to exchange mail with my server, if the hostname they are giving doesn’t match their actual hostname or they have no A record or MX record for the domain they are using, postfix will end the connection.

smtpd_recipient_restrictions =

It is very important that “permit_mx_backup” goes at the end, because I am finding that spammers will take advantage of backup MX servers to get their spam accepted in some way, which then causes a lot of dead return to sender messages in your queue later.

With the “reject_rbl_client” lines I have in this config, I don’t have to use Spamassasin or other spam anaylsis programs at presnt, the few spams I am getting are minimal and may have been things I accidentially signed up to in the past! was blocking Google Mail last night, which is why I have blocked it. requires that you sign up to use their service first.

Moving MySQL

I have to admit that I am no programmer; Systems Administration, Network Administration and troubleshooting come fairly easily to me, but programming has always passed me by. I have often just blindly copied something someone else has done to get by and I remember when I was young spending hours typing in source code from magazines to see try out programs and stuff!

So when it comes to SQL people say “well its not that hard, its mostly english!” but you have to remember the order things go in and weather a line needs a ; at the end, etc… I have tried to get into PHP and stuff, but I just get really bored and give up. I have a load of programming books on C and PHP if anyone is interested!

I use some SQL on my server – WordPress, which makes this blog work uses MySQL… but to keep it going I had to move it from my old server to my new one.

I followed the usual instructions, to backup your databases use:

mysqldump -u root -p --all-databases > database_backup.sql

And then to restore:

mysql -u root -p < database_backup.sql

Then presto and everything is back, but is it working? Well it might be a good idea to try:

/etc/init.d/mysql restart

Because when you import your old databases, you overwrite the passwords for the users that are stored in them. In the file /etc/mysql/debian.cnf there are settings for a user called debian-sys-maint which is setup when you install MySQL. A password is generated for this user and then stored in the file, when you import all databases you overwrite the users database which then overwites this password, causing debian-sys-maint to be unable to access the database and a failure when you try to start MySQL, although the daemon is running.

phpMyAdmin is your friend here, because you need no knowledge of SQL commands to go in and change the password for a user, therefore fixing this nasty problem! Once you’ve done that you can then use this command to stop MySQL (as /etc/init.d/mysql stop won’t work):

kill | cat `/var/run/mysqld/`

Then go ahead and start MySQL as normal:

/etc/init.d/mysql start

Uninterruptible Power Supplies and their lack of Uninterruptible-ness

An Uninterruptible Power Supply or UPS is a big battery that will keep your computer running if the power goes off, it will also protect it from surges and incidents when the power dips to what it should be. They are very useful for when you need to move things around or if you have electricity that you have to pay for in advanced (and will therefore be switched off automatically if you have no credit).

I have had small UPS’s for a few years which are about enough to keep an average desktop PC going for about 10 mins if the power fails. However, I have recently had to start dealing with them at work, since we have moved away from Co-located hosting to hosting our servers at our office. When you are running UPS’s commerically, the need for power cannot be overstated – you need things to be as overkill as possible! Most UPS’s (anything designed for keeping more than just one PC going) will have overload detection and if the UPS detects an overload, it will start to shut itself down – because if the power were to be lost, the batteries could not take the load and the servers connected would not be able to shutdown gracefully.

However this means that mains power is lost to these connected servers and hence zap – no power… Well, in our case it means a 50% reduction in power as the servers have 2 PSU’s each which are redunant. However, it is not so easy to build redundancy into a network, and taking out the UPS that the network switches are connected to will take down the servers as they can’t talk to the outside world… resulting in my mobile phone ringing and someone giving me grief that they can’t do any work!

Teamed Network Cards are network cards that can run in pairs (or more) providing greater throughput or redundancy if they are connected to different switches (in different UPS’s!) however my employer apparently has little interest int he redundancy aspect of this and uses teaming only for throughput… why have 1Gb/s when you can have 2Gb/s?!

After this happening twice today, I had to bypass the UPS’s entirely as they were getting less reliable than the service from the electricity provider!

Whilst I like my job, I hate the fact that my employer prefers to buy his parts on eBay and expects great performance from a limited budget!

Well, I think that is all for tonight… until next time (in the imortal words of Sara Cox) – “rave safe kids, rave safe!”

An interesting day…

So this morning I go to see the optician, he tells me that my glasses from 2 years ago are still at the prescription I need, which is really good considering last year I saw another optician who told me they were too strong! I order new glasses because under the UK NHS system I am entitled to money towards new glasses every 2 years.

This evening was more about taking things apart, a friend of mine and Ed’s brings in a laptop to the TermiSoc tutorial that his housemate sat on… One of the guide rails for the DVD drive was bent, Ed and I took it apart to discover this, but there was very little we could do, albeit assure our friend that it would still work.

Then tonight after we got home, the whole house electricity kept tripping out every few minutes. After doing a test by turning on all the most power consuming appliances we have, we found we could not trip out the power. Then we turned on the tumble dryer, and it died! What I discovered after I had ruled out the socket and the extension cord was that the element that gets the dryer hot had somehow gotten wet and since electricity and water don’t mix, well better that we lost power than our whole house burnt down!

After I dried out the heater compartment and put it all back together it started working fine. So I guess there can’t be much wrong with it.

But I think to myself, why am I doing all this calculus and maths stuff when what I am good at is fixing stuff, with my hands… Give me a broken computer and I am happy for a few hours!

So now, at 1:20am I am finally going to bed! Tomorrow the Calculus starts!

Rave Safe Kids!

Seth out.

Cool Stuff

Simpons AvatarSo today, after weeks of waiting for Broadband in our new house, we (Ben, Ed and myself) finally got it!

We were intending to wait for Orange (a BT ADSL Service) to move my existing connection to my new line, but so far it has taken them 14 days to remove it from my old line! It could take up to 13 more days before we get it here!

After hearing this news on Tuesday I decided I had had enough and since the cable company (Virgin Media) are doing a deal where you can get a 2Mb service for £10 per month for 1 year (instead of £18/month) I went for it. So although we are locked in for a year (unless we manage to get out within the cooling off period), its not going to cost very much.

Setting up the Cable Modem was easy, since the house already has wiring for cable all I had to do was hook it up and call them. Its a shame it wasn’t that easy to set up the routing for our network, but that’s another story…

The other 8Mb ADSL service from Orange should be free, because the account is in Ben’s name now and as he pointed out, he should be getting it for free since he pays Orange enough money as it is for mobile phone service!

So I am happy now and maybe when the ADSL gets connected we can play around with load balancing!

Also, I got to play around with the Avatar creator on the Simpsons Movie website, and I made the likeness of me that you see here!