Using Laravel 4

I've updated the blog to use Laravel 4. Laravel 4 is currently in beta development, a complete rewrite of the PHP framework to use Composer to be more modular and interoperable.

Currently I'm not doing things the best way as my Git knowledge isn't up to scratch. I followed the instructions on the Laravel docs page. I also installed Composer system-wide by putting the phar file in /usr/local/bin. Thus all I need to do is go into my Laravel directory and run composer update and all the components are updated to the latest version; including any extra packages I've added to the composer.json file myself.

I find this incredibly exciting. It's simply a case of going to https://packagist.org/ and going I like the sound of that, all I have to do is add one line to one file and I can use it. For example, I'm using Markdown in my posts, so I use this package by dflydev. Admittedly it's not as simple as just adding a line to the composer.json file. Due to how packages are loaded, anywhere I want to use the file I need to add the line

use dflydev\\markdown\\MarkdownExtraParser

Though I am sure there are better ways of doing this. I believe this can be done by editing the providers and aliases arrays in app/config/app.php, but I'm yet to look into this properly.

I'm also doing a basic redesign of the site, focusing slightly on the layout, but mainly the colour-scheme, incorporating the Solarized colour palette. Maybe even a little SASS/LESS magic to switch between dark/light schemes.

Getting SPDY support

I now have SPDY support on my website. Though I don't know if I've done it the right way. My site is on a VPS running Debian 6. This means the version of OpenSSL in the repositories is version 0.9.8, SPDY requires at least version 1.0.1.

So, time to get the latest OpenSSL. I have left the repo version installed and then compiled the latest from source letting it install in the default /usr/local/ssl:

$ cd ssl-source
$ curl -O http://www.openssl.org/source/openssl-1.0.1e.tar.gz
$ tar -xzf openssl-1.0.1e.tar.gz
$ cd openssl-1.0.1e
$ ./config
$ make
$ make test
$ sudo make install

We now have the default OpenSSL 0.9.8 installed by Debian and our own version installed to /usr/local/ssl/bin. If we type openssl to the prompt Debian looks for a binary of the same name in the $PATH variable. We have to add /usr/local/ssl/bin to this variable so we can actually use our new version. To do this system wide on Debian we can add an openssl.sh file to directory /etc/profile.d/ containing the lines

PATH='/usr/local/ssl/bin:$PATH'
export PATH

This is the only way I could get to work. If you are running a different distro of Linux then you'll need to refer to the appropriate documentation of editing the $PATH variable. Thus, now when we type openssl, it'll look in /usr/local/ssl/bin first. Now it's time to compile nginx against the newer OpenSSL. We also need to apply the SPDY patch. Further we need to edit the source files to work with a custom OpenSSL location:

$ cd nginx-source
$ curl -O http://nginx.org/download/nginx-1.3.14.tar.gz
$ tar -xzf nginx-1.3.14.tar.gz
$ cd nginx-1.3.14
$ curl -O http://nginx.org/patches/spdy/patch.spdy.txt
$ patch -p1 < patch.spdy.txt
$ sed -i -e 's|\\.openssl/||' auto/lib/openssl/conf
$ ./configure --sbin-path=/usr/local/sbin --with-openssl=/usr/local/ssl --with-http_ssl_module --with-http_spdy_module
$ make
$ sudo make install

Obviously you may want to install the nginx binary to a different sbin path. I don't know why the openssl conf has .openssl directories that work with the default openssl installation but not our self-compiled installation. But that's it, now you should be able to add the spdy directive to the relevant config files and your sites should be SPDY enabled.

Edit: nginx have now released a new development version, 1.3.15, which includes the relevant SPDY patches. So we do not need to apply these patches, but we still need to run the sed command on the nginx source to compile against our self-installed version of OpenSSL.

What's really in our meat?

As the article puts:

The fact that it’s horsemeat that’s turning up in burgers and lasagnes is not the problem. The problem is that until specific testing was performed, we didn’t have the faintest idea what it was.

If you accept the validity of eating meat like that of a cow or a pig or a chicken, then horse really is no different. What's wrong is the way we source our meat and the economics of how that meat ends up on our plate are frankly ridiculous.

What if it wasn't relatively harmless meat but some outbreak of a disease harmful to humans. We'd be screwed.

Christmas soon

It's Christmas soon. I'm spending it with both my girlfriend's family and mine, which will mean a nice long drive for me.

In the mean time I'm really enjoying the content on 24ways and webadvent.org. Anyone know anymore such directories?

Israelis talk about fear, we Palestinians talk about death

From the article:

\“\We Palestinians don't talk about fear, we talk about death. Our rockets scare them; their rockets kill us. We have no bomb shelters, we have no sirens, we have nowhere we can take our children and keep them safe. They are scared. We are dying.\”\

Powerful stuff.