Archive for the ‘Life’ Category
Loserville
Friday, July 20th, 2012 | Distractions, Life
Install APD on CentOS 5
Here is how to install APD (Advanced PHP Debugger) on CentOS 5. Lets start by creating a directory for it to log files to.
cd /tmp
mkdir apd
chown apache:apache apd
We need to remove ioncube, or it will cause errors.
rpm -e php-ioncube-loader
Now we can install APD, via PECL.
pecl install apd
Add the following to php.ini.
[apd]
zend_extension=/usr/lib64/php/modules/apd.so
apd.dumpdir=/tmp/apd
apd.statement_tracing=0
My PHP binary was in a different location, so I had to alter the script too.
cd /usr/bin/
vim pprofp
Change /usr/local/bin to /usr/bin and save the file.
You also need to ensure PEAR is in your include path (/usr/share/pear) for the script to work.
Here is how to install APD (Advanced PHP Debugger) on CentOS 5. Lets start by creating a directory for it to log files to.
cd /tmp mkdir apd chown apache:apache apd
We need to remove ioncube, or it will cause errors.
rpm -e php-ioncube-loader
Now we can install APD, via PECL.
pecl install apd
Add the following to php.ini.
[apd] zend_extension=/usr/lib64/php/modules/apd.so apd.dumpdir=/tmp/apd apd.statement_tracing=0
My PHP binary was in a different location, so I had to alter the script too.
cd /usr/bin/ vim pprofp
Change /usr/local/bin to /usr/bin and save the file.
You also need to ensure PEAR is in your include path (/usr/share/pear) for the script to work.
My kingdom for an internet connection
Monday, July 16th, 2012 | Life
It’s been over four months since we moved into our new apartment and we still don’t have our own internet connection.
Having originally placed our order with o2, they failed to turn up to install the phone line and then insisted that they had turned up, even though Norm was there, with his phone turned up and got neither a knock on the door nor a phone call, we cancelled with them and re-ordered with BT.
This meant waiting another four weeks for an appointment, but when the time came George managed to book a day of work to sort everything out. But BT never turned up.
I phoned them to ask what was happening. They said they would go away and investigate and phone me back. Five minutes later they did. They said that they didn’t have our address in their engineer’s database, so couldn’t turn up and had to wait 24 hours for the database to update before they could say when they could come.
That is one of the craziest things I have ever heard. But even if you find that credible, I then enquired why they hadn’t even notified us when they realised they couldn’t turn up. They said they had my number down incorrectly – this would be slightly more believable if it wasn’t for the case that they were telling me this after phoning me back! How exactly did they have my number down incorrectly if they’ve just called me on it?
They promised they would phone me back after 3pm the next day to arrange a new appointment.
At 2pm the next day, I got an email from our landlady asking if one of us could call her ASAP. I did, and she said a BT engineer was trying to get into our apartment. Obviously, having not been told he was coming, we weren’t home. I said it was OK to let him in, but by the time I had done that, he had already left.
I phoned BT to see what was going on, but having left me on hold for a few minutes to investigate they told me that the engineers’ reports don’t come in until 6pm so they didn’t know what was happening and promised they would ring me back the next day.
They didn’t phone me, so that afternoon I phoned them and had a long conversation about what was going on. By this point the issue was deemed so serious that I was transfered to someone based in the UK, who actually spoke fluent English.
He said that they simply couldn’t install a line if our address wasn’t in the Royal Mail database. So even though they had been to our property the day before to install the line, they couldn’t install the line because they didn’t believe that our property existed.
At this point, I decided on a new strategy. I told them that they had our address wrong. We actually lived in apartment 14 (actually, I tried 13 first but because of superstitious nonsense, there is no apartment 13), so they should install it to that property. I also explained that for unknown reasons apartment 14 would be labelled “303” on the door, even though it definitely was apartment 14. They updated their records and scheduled a new appointment in two weeks time.
The appointment arrived and the engineer turned up to install our line. After a frantic twenty minutes trying to find the housekeeper to let us into the comms room (we don’t have any contact details for her, so we have to phone the landlady, who phones the housekeeper), the engineer finally got access and began surveying the situation. It turned out the only way we could get it working was to use the existing network because the building had never given any consideration to people actually wanting a phone line (the alternative was to run a new line in, up the side of the building – that was my preference to avoid all this nonsense but it would inevitably incur other nonsense instead).
Ok, so we just need to work out how we’re plugged in at the moment. Easy enough? Not quite. The comms room has a series of 10 48-port switches, none of which had any labelling on. I’m sure you can do the maths but to be clear, that makes 480 ports, one of which was our apartment – but we had no idea which.
The engineer began investigating. With some further surprise restrictions now being enforced by the building management, we were now running into an extended appointment which the engineer said it would have to bill us extra for. We told him that if such a bill would be under £100 then we would pay it, otherwise he could get on his bike.
Luckily, the bill suddenly did come in at “under £100”, so by lunch time we had a phone line we were assured would soon be working. We had no phone to plug into it, so no way to verify said claim, but I’m sure BT wouldn’t let us down. Now just to order the actual internet…
It’s been over four months since we moved into our new apartment and we still don’t have our own internet connection.
Having originally placed our order with o2, they failed to turn up to install the phone line and then insisted that they had turned up, even though Norm was there, with his phone turned up and got neither a knock on the door nor a phone call, we cancelled with them and re-ordered with BT.
This meant waiting another four weeks for an appointment, but when the time came George managed to book a day of work to sort everything out. But BT never turned up.
I phoned them to ask what was happening. They said they would go away and investigate and phone me back. Five minutes later they did. They said that they didn’t have our address in their engineer’s database, so couldn’t turn up and had to wait 24 hours for the database to update before they could say when they could come.
That is one of the craziest things I have ever heard. But even if you find that credible, I then enquired why they hadn’t even notified us when they realised they couldn’t turn up. They said they had my number down incorrectly – this would be slightly more believable if it wasn’t for the case that they were telling me this after phoning me back! How exactly did they have my number down incorrectly if they’ve just called me on it?
They promised they would phone me back after 3pm the next day to arrange a new appointment.
At 2pm the next day, I got an email from our landlady asking if one of us could call her ASAP. I did, and she said a BT engineer was trying to get into our apartment. Obviously, having not been told he was coming, we weren’t home. I said it was OK to let him in, but by the time I had done that, he had already left.
I phoned BT to see what was going on, but having left me on hold for a few minutes to investigate they told me that the engineers’ reports don’t come in until 6pm so they didn’t know what was happening and promised they would ring me back the next day.
They didn’t phone me, so that afternoon I phoned them and had a long conversation about what was going on. By this point the issue was deemed so serious that I was transfered to someone based in the UK, who actually spoke fluent English.
He said that they simply couldn’t install a line if our address wasn’t in the Royal Mail database. So even though they had been to our property the day before to install the line, they couldn’t install the line because they didn’t believe that our property existed.
At this point, I decided on a new strategy. I told them that they had our address wrong. We actually lived in apartment 14 (actually, I tried 13 first but because of superstitious nonsense, there is no apartment 13), so they should install it to that property. I also explained that for unknown reasons apartment 14 would be labelled “303” on the door, even though it definitely was apartment 14. They updated their records and scheduled a new appointment in two weeks time.
The appointment arrived and the engineer turned up to install our line. After a frantic twenty minutes trying to find the housekeeper to let us into the comms room (we don’t have any contact details for her, so we have to phone the landlady, who phones the housekeeper), the engineer finally got access and began surveying the situation. It turned out the only way we could get it working was to use the existing network because the building had never given any consideration to people actually wanting a phone line (the alternative was to run a new line in, up the side of the building – that was my preference to avoid all this nonsense but it would inevitably incur other nonsense instead).
Ok, so we just need to work out how we’re plugged in at the moment. Easy enough? Not quite. The comms room has a series of 10 48-port switches, none of which had any labelling on. I’m sure you can do the maths but to be clear, that makes 480 ports, one of which was our apartment – but we had no idea which.
The engineer began investigating. With some further surprise restrictions now being enforced by the building management, we were now running into an extended appointment which the engineer said it would have to bill us extra for. We told him that if such a bill would be under £100 then we would pay it, otherwise he could get on his bike.
Luckily, the bill suddenly did come in at “under £100”, so by lunch time we had a phone line we were assured would soon be working. We had no phone to plug into it, so no way to verify said claim, but I’m sure BT wouldn’t let us down. Now just to order the actual internet…
Install memcached on CentOS 5
First step, you’ll need to add the EPEL repository to Yum.
Once you’ve done that, you can install all the YUM packages.
yum -y install memcached.x86_64 libmemcache.x86_64 libmemcache-devel.x86_64 zlib-devel.x86_64
Then add the memcache extension to PHP.
pecl install memcache
Add the extension to your PHP configuration.
extension=memcache.so
Configure memcached appropriately.
vi /etc/sysconfig/memcached
add OPTIONS="-l 127.0.0.1"
Configure it as a service, and start.
chkconfig memcached on
service memcached start
First step, you’ll need to add the EPEL repository to Yum.
Once you’ve done that, you can install all the YUM packages.
yum -y install memcached.x86_64 libmemcache.x86_64 libmemcache-devel.x86_64 zlib-devel.x86_64
Then add the memcache extension to PHP.
pecl install memcache
Add the extension to your PHP configuration.
extension=memcache.so
Configure memcached appropriately.
vi /etc/sysconfig/memcached add OPTIONS="-l 127.0.0.1"
Configure it as a service, and start.
chkconfig memcached on service memcached start
Change the world, in five minutes…
Monday, July 9th, 2012 | Life
Reading this on Facebook? Why not click the like and share buttons, and share it onto your own wall to get even more people involved.
Anyway, I’ve previously written quite a bit on Facebook and Twitter about Kiva.
It’s a microloans charity – people in the third world ask for loans, usually around $1,000 to help them work their way out of poverty. We then come along, donate $25 each and between us raise the money for the loan, and it’s given to the person in the 3rd world. They then improve their business, take another step to working their way out of poverty and then pay us back. We can then lend the same money to somebody else!
It’s a superb idea and one that I am proud to say I have been donating to for several years.
But here is why you should get involved now. They’re currently offering free money to people who sign up – thanks to an anonymous donor, the first $25 loan you make to someone in the third world doesn’t even come out of your pocket!
Not just that but you can sign in with your Facebook details (though you don’t have to, if you would rather register separately) – so it only takes a couple of minutes to make a $25 donation to help someone in the third world without it costing you a penny.
Given that then, I don’t see any excuse for anyone not to get involved. Seriously, just follow this link. Do it! Do it now! I literally don’t see any reason why anyone reading this shouldn’t get involved.
P.S. You can also access the site directly at kiva.org. However, if you follow one of the links above, it will record a referral for me. I don’t get anything out of that beyond the warm feeling inside that I’ve helped spread Kiva a little further, but that is still nice to have.
P.P.S. You can also allocate your donation towards a community team – these are just groups you can join, like a Facebook Group. The biggest and best is the atheists, agnostics and non-religious, but you might also want to consider the Church of the Flying Spaghetti Monster. Even CWF has a team.
Reading this on Facebook? Why not click the like and share buttons, and share it onto your own wall to get even more people involved.
Anyway, I’ve previously written quite a bit on Facebook and Twitter about Kiva.
It’s a microloans charity – people in the third world ask for loans, usually around $1,000 to help them work their way out of poverty. We then come along, donate $25 each and between us raise the money for the loan, and it’s given to the person in the 3rd world. They then improve their business, take another step to working their way out of poverty and then pay us back. We can then lend the same money to somebody else!
It’s a superb idea and one that I am proud to say I have been donating to for several years.
But here is why you should get involved now. They’re currently offering free money to people who sign up – thanks to an anonymous donor, the first $25 loan you make to someone in the third world doesn’t even come out of your pocket!
Not just that but you can sign in with your Facebook details (though you don’t have to, if you would rather register separately) – so it only takes a couple of minutes to make a $25 donation to help someone in the third world without it costing you a penny.
Given that then, I don’t see any excuse for anyone not to get involved. Seriously, just follow this link. Do it! Do it now! I literally don’t see any reason why anyone reading this shouldn’t get involved.
P.S. You can also access the site directly at kiva.org. However, if you follow one of the links above, it will record a referral for me. I don’t get anything out of that beyond the warm feeling inside that I’ve helped spread Kiva a little further, but that is still nice to have.
P.P.S. You can also allocate your donation towards a community team – these are just groups you can join, like a Facebook Group. The biggest and best is the atheists, agnostics and non-religious, but you might also want to consider the Church of the Flying Spaghetti Monster. Even CWF has a team.
Condensed partying
For the June Wendy House we had planned a mascarade ball for Michelle’s return. However, it turned out she didn’t get in to Leeds until way after it would have ended so it turned out to be some far more relaxed drinks before Wendy House. Not that that isn’t the start of a very enjoyable evening.
We finally made it into Wendy House just before midnight at which Fonze began partying the night away.

However, within 15 minutes of getting in the door, we were heading back out again to meet Michelle. Also Michelle is back! Hurray! Although by the time this actually gets published she will have actually gone again, but it was fun while it lasted.
For the June Wendy House we had planned a mascarade ball for Michelle’s return. However, it turned out she didn’t get in to Leeds until way after it would have ended so it turned out to be some far more relaxed drinks before Wendy House. Not that that isn’t the start of a very enjoyable evening.
We finally made it into Wendy House just before midnight at which Fonze began partying the night away.
However, within 15 minutes of getting in the door, we were heading back out again to meet Michelle. Also Michelle is back! Hurray! Although by the time this actually gets published she will have actually gone again, but it was fun while it lasted.
Create permenant aliases with .bashrc
Sometimes, it’s easier to create an alias when working with the Unix command line. Having to create these every time seems to defeat the point of having a short alias though. Luckily, you can make them persistent.
Lets assume that we are using a user called mike. We need to be in our home directory.
cd /home/mike
The .bashrc file should be in there, but hidden.
ls -a
You should be able to see it listed. Now lets edit it.
vim .bashrc
And add a command in, for example, to save our usual CVS update command.
alias upd='cvs -q update -P -d'
Now save and exit. After that, every time you log onto the box you can use the upd command to run the CVS update.
Sometimes, it’s easier to create an alias when working with the Unix command line. Having to create these every time seems to defeat the point of having a short alias though. Luckily, you can make them persistent.
Lets assume that we are using a user called mike. We need to be in our home directory.
cd /home/mike
The .bashrc file should be in there, but hidden.
ls -a
You should be able to see it listed. Now lets edit it.
vim .bashrc
And add a command in, for example, to save our usual CVS update command.
alias upd='cvs -q update -P -d'
Now save and exit. After that, every time you log onto the box you can use the upd command to run the CVS update.
Installing GCC 4.4 on CentOS 5
If you’re running CentOS, you may find yourself frustrated that you have GCC 4.2 or older, when you need to be running at least 4.3 for some features – for example, if you want to compile HipHop for PHP.
Never fear, you don’t need to compile a compiler from source!
As well as the gcc RPMs in the repository, there are also a set for GCC 4.4, appropriately enough named gcc44 and you can install them in the usual way.
yum install gcc44 g++44
If you’re running CentOS, you may find yourself frustrated that you have GCC 4.2 or older, when you need to be running at least 4.3 for some features – for example, if you want to compile HipHop for PHP.
Never fear, you don’t need to compile a compiler from source!
As well as the gcc RPMs in the repository, there are also a set for GCC 4.4, appropriately enough named gcc44 and you can install them in the usual way.
yum install gcc44 g++44
Using Apache Bench to load test your website
Apache comes with a cool load testing script called Apache Bench, which lets you throw loads of requests at a URL. It comes bundled with Apache, so if you’re running the LAMP stack, you probably already have it.
The syntax is simple.
ab -n 1000 http://www.google.com/
This will throw a thousand requests at Google and then produce a report on how long it look. You can also use the -c option to set the number of concurrent requests. There are lots more options too – see the Apache docs for full details.
Apache comes with a cool load testing script called Apache Bench, which lets you throw loads of requests at a URL. It comes bundled with Apache, so if you’re running the LAMP stack, you probably already have it.
The syntax is simple.
ab -n 1000 http://www.google.com/
This will throw a thousand requests at Google and then produce a report on how long it look. You can also use the -c option to set the number of concurrent requests. There are lots more options too – see the Apache docs for full details.