Archive for the ‘Life’ Category

Lunching at Fazenda

Tuesday, January 29th, 2013 | Life

Last Friday, we headed to Fazenda for lunch.

I’ve never had the lunch time menu before, though I knew to expect a very much cut down version of what they served in the evening. Overall, I thought it was quite disappointing though. Most of the options were not available on the lunch time – indeed, the only steak cut available seemed to be rump, although there might have been sirloin – but nothing beyond that. I was expecting the fancy stuff to be reserved for the evening session, but I was hoping there would at least be some good choice of standard steak cuts. Apparently not.

Restarting Apache on Gentoo

Tuesday, January 29th, 2013 | Life, Tech

Normally, you can restart Apache using the restart command for the init.d script.

/etc/init.d/apache2 restart

However, you may encounter the following error.

chris@server /root $ sudo /etc/init.d/apache2 restart
 * Stopping apache2 ...[ ok ]
 * Starting apache2 ...
 * start-stop-daemon: /usr/sbin/apache2 is already running 

This is due to a bug in the init.d script. You can resolve this with a one line change.

vim /etc/init.d/apache2

Change line 105 for the one below (they should look very similar).

while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \

Save it and run the restart command again to check it has worked.

chris@server /root $ sudo /etc/init.d/apache2 restart
 * Caching service dependencies ...                                                                              [ ok ]
 * Stopping apache2 ...                                                                                          [ ok ]
 * Starting apache2 ...

If you get an output like the above, you’ll know it’s worked.

It’s gone!

Wednesday, January 23rd, 2013 | Life

Last Friday, we went for dinner at Chaophraya.

However, to my horror, I found they had removed their Thai curry, in a Yorkshire Pudding, on a steak dish from the menu! This, of course, was the greatest food ever known to man, and as such I will be writing a strongly worded letter to the management, insisting the dish is reinstated. Anyone who wishes to sign the petition, get in touch.

MaxClients (150) is not an integer multiple

Wednesday, January 23rd, 2013 | Life, Tech

Starting Apache on Gentoo, you may get warnings similar to the following.

chris@server ~/lime $ sudo /etc/init.d/apache2 stop
Password: 
 * Stopping apache2 ...
WARNING: MaxClients (150) is not an integer multiple
 of ThreadsPerChild (35), lowering MaxClients to 140
 for a maximum of 4 child processes,
WARNING: MaxClients (25) must be at least as large
 as ThreadsPerChild (35). Automatically
 increasing MaxClients to 35.                                                                                    [ ok ]
chris@server ~/lime $ sudo /etc/init.d/apache2 start
 * Starting apache2 ...
WARNING: MaxClients (150) is not an integer multiple
 of ThreadsPerChild (35), lowering MaxClients to 140
 for a maximum of 4 child processes,
WARNING: MaxClients (25) must be at least as large
 as ThreadsPerChild (35). Automatically
 increasing MaxClients to 35.

You can resolve these warnings by editing your mpm file and changing ThreadsPerChild so that MaxClients becomes a multiple of it. In this case, setting it to 25 should do the trick.

sudo vim /etc/apache2/modules.d/00_mpm.conf

Change the values and save the file. Now restart Apache and it should stop the warnings.

You could also change MaxClients, but this would only resolve the first warning, and not the second.

Christmas party

Saturday, January 19th, 2013 | Life

Last week, we went out for the Worfolk Limited Christmas party. It was a very small affair – even with all the directors and employees attending, and partners, that still only left myself and Elina. Given the small number, I had decided to hold off until January to avoid large roaming gangs of noisy office employees.

We went to Anthony’s Restaurant, not just because it was located just round the corner, or because it is one of the restaurants in Leeds city centre that I’ve never eaten at but also because of the intriguing possibility of their taster menu.

This was an eight course meal where you don’t know what you’re getting – apparently because the chef just makes it up as they go along – which is brilliant. We ate our way through four starters, two mains and two desserts, along with a home made loaf of bread – each!

It was rather quiet in there – indeed, we had the place to ourselves for the first hour, before two other couples turned up, and that was their entire business for the night. That is simply a cost issue though – it certainly wasn’t because of the food, which did not disappoint.

I have little idea of what I ate in most of the courses, despite an explanation from our waitress. But it was all delicious, if a little rich – by the sixth course, I was starting to think I was on sauce overload. At 10pm, we waddled out of the restaurant, stuffed. My kind of Christmas party.

Imagick not loading on MAMP for Mac

Thursday, January 17th, 2013 | Life, Tech

If you’re running MAMP and you’ve finally managed to get the Imagick extension to add ImageMagick support compiled, the battle may not be over yet. There are more things you need to do. You might get an error similar to the following.

Firstly, imagick.so was probably installed into the sytem’s PHP extension directory. So you might need to copy this into MAMP’s directory. Don’t just copy and paste the code below as you need to check the paths are correct for your system.

php -i | grep extension_dir
cp /usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so
/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/

Secondly, some of the libraries are out of date. You might get an error like the following.

[01-Jun-2012 08:46:22] PHP Warning:  PHP Startup: Unable to load dynamic library 
'/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/imagick.so'
 - dlopen(/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/imagick.so, 9): Library not loaded: /opt/local/lib/libjpeg.8.dylib
  Referenced from: /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/imagick.so
  Reason: Incompatible library version: imagick.so requires version 13.0.0 or later,
but libjpeg.8.dylib provides version 12.0.0 in Unknown on line 0
[01-Jun-2012 08:51:54] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/yaml.so' - dlopen(/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/yaml.so, 9):
image not found in Unknown on line 0

We can solve this by editing a configuration file.

sudo vim /Applications/MAMP/Library/bin/envvars

Comment out the first two lines below and add the last one.

#DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
#export DYLD_LIBRARY_PATH
export PATH="$PATH:/opt/local/bin"

This should override out of date libraries such as libjpeg. If you’re still having problems, you can manually copy in the freetype library too.

cp /opt/local/lib/libfreetype.6.dylib /Applications/MAMP/Library/lib/

Though in theory this step should not be required. Restart Apache and you should see Imagick appear on the phpinfo() output.

Installing ImageMagick and Imagick on Mac OS X

Friday, January 11th, 2013 | Life, Tech

Trying to get ImageMagick and it’s PHP extension working on OS X Lion is a frustrating process. It will often fail and even if you try to configure it manually you may get an error like the following.

checking ImageMagick MagickWand API configuration program...
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.

First of all, install ImageMagick via MacPorts.

sudo port install ImageMagick

Now install the imagick PECL module.

sudo pecl install imagick

Very importantly however, make sure you specify the path when prompted, to be /opt/local, do not let it auto detect! Once this is done it should compile successfully and you will be prompted to add imagick.so to your php.ini file.

Twister

Thursday, January 10th, 2013 | Life

Turns out they’ve added two new things to Twister – a hands on the air result, and a “twister’s choice” result. It’s not like when we were young…

IMG_2399 IMG_2402 IMG_2404 IMG_2408 IMG_2410 IMG_2412 IMG_2414 IMG_2418

New Year’s Eve 2012

Wednesday, January 9th, 2013 | Life

For the fifth year in a row, there was only one place to be to properly ring in the new year. We had cocktails, sausage roles and Twister!

IMG_2348 IMG_2354 IMG_2361 IMG_2365 IMG_2366 IMG_2371 IMG_2378 IMG_2394 IMG_2435

Using whereis on Mac OS X Lion

Saturday, January 5th, 2013 | Life, Tech

Linux has a great tool called whereis that allows you to find the location of an executable. For example, if you want to know what PHP binary you are using, you could use the following command.

$ whereis php
/usr/local/php

However, if you run this on Mac it will often return you a black result, even though you know the command works!

$ whereis convert

The solution is to use which instead, which does the the same thing, but actually returns results.

$ which convert
/opt/local/bin/convert

Great for finding those extra mysterious programmes.