If you’re running a site with SSL you really need to turn SSLv2 off. The file you’ll want to edit is /etc/httpd/conf.d/ssl.conf – it might be in a different location, but, shouldn’t be hard to find. The two lines you want to make sure you have are:
Having done some upgrades to my server (PHP, apache) I noticed I was getting some odd errors in the apache log and one of my PHP based sites wasn’t loading. The error in the log was:
[Sun Sep 05 20:23:40 2010] [error] [client X.X.X.X] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Now having done some digging everything suggested the rewrite rule was wrong, or, behaving differently after the upgrade but it turned out that the problem was in fact PHP short_open_tag related.
My php.ini had short_open_tag = Off (which it should, but the site in question was a quick one). Changing that to On and giving apache a restart made the problem go away. When I get a chance I will make the <? tags <?php but it’s not a biggy right now.
I was introduced to Amy’s Ghost by a friend (@timblair) as he knows Amy (lead singer). Since seeing them once live at Global in Reading I’ve really enjoyed their music. They played at Reading and Leeds this weekend and the highlights are online at BBC Introducing. If you like it go buy the album from Amazon.
Not a particularly exciting first post back after so long with nothing but hopefully it’s useful none the less. On a CentOS box you can’t get MySQL 5.1 or PHP 5.3 easily from yum. Luckily a chap known as remi as a handy repo that contains both said packages.
To get the repo running you’ll need to install a couple of RPM’s:
After that jump into /etc/yum.repos.d where you should now have a remi.repo file. Edit that and change enabled=0 to enabled=1 and you’re good to go. Do a yum check-updates and install away.
There’s quite a few guides out there to install memcached and libevent but here are the steps I took to get it installed. This is largely based around checking out my history entries, but, it doesn’t the job!
Note that if you don’t add the prefix to configure libevent you can end up with bits everywhere and it getting a little bit fiddly.
[root@host ~] wget http://www.monkey.org/~provos/libevent-1.4.10-stable.tar.gz
[root@host ~] tar xvfz libevent-1.4.10-stable.tar.gz
[root@host ~] cd libevent-1.4.10-stable
[root@host libevent-1.4.10-stable] ./configure --prefix=/usr/local
[root@host libevent-1.4.10-stable] make && make install
[root@host libevent-1.4.10-stable] cd ~
[root@host ~] vi /etc/ld.so.conf.d/libevent-i386.conf
insert:
/usr/local/lib/
[root@host ~] ln -s /usr/local/lib/libevent-1.4.so.2 /lib/libevent-1.4.so.2
[root@host ~] wget http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz
[root@host ~] tar xvfz memcached-1.4.4.tar.gz
[root@host ~] cd memcached-1.4.4
[root@host memcached-1.4.4] ./configure --with-libevent=/usr/local
[root@host memcached-1.4.4] make && make install
Now you should be able to run memcached.
memcached -vv -u nobody
Alternatively of course you can use yum but that’s no fun and not always the latest version.
If you’ve got yourself an iPhone, particular a 3G, odds are you’re out of, or, coming up to being out of contract. You’re probably paying £35/m right now as well. If like me you’re holding on for June/July to see if a new iPhone is launched, which, it probably will be you’re not going to want to jump into a 18/24 month contract to upgrade to a 3GS (albeit tempting). O2 actually seem to have an answer in their reasonable new Simplicity SIM only tariffs. For £20/m you can get unlimited texts and 300 minutes inclusive.
It’s also really easy to switch online once you’ve found the right links. If you click on the “Shop” dropdown at the top you’ll see an Upgrade Your Phone link. Follow that, enter your mobile number and then the code you’ll get by SMS. Once in you can pick from the don’t want a phone section and just pick the new tariff. You can also just go on a month to month rolling contract which is great, saves you money and hopefully makes you ready for the iPhone 4G. You can also “downgrade” to these tariffs and save £5/m if you go for a 12 month contract.
I’ve gone through the process just now and as yet not received a confirmation email but hopefully that’ll turn up soon!
Edit: Still no email but now the O2 iPhone app shows I’m on to simplicity 20 tariff.
You may or may not know about the wonderful vertical tab character 0x0B. It’s a character that’s not easy to see and can cause issues across a number of different programming languages. In my case a Rails developer was having trouble passing some data from an API. A JSON parser was throwing errors about a specific character. Originally we suspected line breaks were causing the issue but after more digging and examination using Textmate and the Text bundle we spotted the invisible characters and having converted it to hex found out it was 0x0B. A quick Google brings back quite a few results of people having the same problem.
In order to find them in the database I knocked up the following SQL:
SELECT * FROM table WHERE data LIKE CONCAT('%',CHAR(0x0B),'%');
Then to replace them quickly (assuming the 3 records have ID’s 1,2 and 3):
UPDATE table SET data = REPLACE(data,CHAR(0x0B),'') WHERE id IN (1,2,3);
I read an article over at OS X Daily about posting a tweet from the command line using the twitter API. Taking this one step further here’s a handy little script that’ll even stop you posting nothing and stuff that’s too long.
#!/bin/bash
TWEET=$1
TWEETLEN=${#TWEET}
if [ $TWEETLEN -eq 0 ] || [ $TWEETLEN -gt 140 ]; then
if [ $TWEETLEN -gt 140 ]; then
let EXTRA=$TWEETLEN-140
echo "Usage: tweet \"message\" (140 chars or less, you're $EXTRA over)"
else
echo "Usage: tweet \"message\" (140 chars or less)"
fi
exit 1
else
curl -u username:password -d status="$1" http://twitter.com/statuses/update.xml
fi
exit 0
Save the file as “tweet” and make sure it’s in the path with executable permissions of 755.
Thanks to a simple link over to audioporncentral from a mate I’ve discovered all sorts of crazy cool music in the last fe days. Now it’s not everyone’s taste, but, it’s damn cool. Mainly mashups of assorted but general high quality. The particular standout winner are The Kleptones. Their website has all their music available, for free, mp3 download… just the way it should be! My favourite so far is Uptime from the uptime/downtime record. It’s awesome, so many tunes so little time! The Bestival live also is worth a play.