Simon Bennett

Web Developer

Web Development Simon Bennett

Blog

Online Labs, Dedicated cloud servers


Labs.online.net cloud dedicated servers. I don’t normally review hosting companies as I am a Linode and Digital ocean man and have an array of servers for clients and personal projects. But the idea on Online sounds great to me. I first heard of the company a year ago when I needed a dedicated server as there prices are great and if you can get over telephone support in in french (a language I do not know at all) its great. The hardware is fast and the connection speed is also great.
OnlineLabs-C1-Node
Back to the cloud.

The servers are truly dedicated “The C1 server is a 4-cores ARMv7 CPU with 2GB of RAM and a 1 Gbit/s network card.” Its like having a kick arse Pi. Pi geekbench score 243 (Model B 512). Where the C1 server scored 1722. That that seems pretty slow when I last tested a 1gb Linode it scored 7538 but remember the hardware is not decided for a single fast servers, its designed for a truly horizontal design. As a LAMP developer this interests me a lot. Lots of HTTP workers behind a load balancer, with small easily to deploy servers.

So I decided to test this (roughly), I installed nginx and configured it for the server specs and managed to score a very good 10000 requests per second with a 1kb HTML file. I next decided to install HHVM and test out FullRent development branch on it. (I always deploy my laravel apps in HHVM). At this point I failed hard, the processor is only 32bit and HHVM needs to be compiled with 64bit. At this point I gave up.

When I next get the chance I would like to install php5-fpm and try a bytecode cache to compare the speed.

Overall verdict is hard to say, they are still in beta and no prices have been announced. However I really like the idea of truly dedicated hardware it always has the performance edge over virtual machines. When I deploy FullRent fully I will experiment with a couple of nodes with them and update this review.

Part 2 Compling PHP with PThread (threads) Screencast


(Sorry I have updated the video to youtube now. Don’t forget you can turn it up to 1080p)

So my second screencast where I compline PHP with threads. The steps are really simple and easy to follow. The guild I roughly followed was from my github page.

Any compiling issues please let me know as next time we will just be programming.

Intro to PHP Threading Screencasts


Intro to PHP Threading Screencasts from Simon Bennett on Vimeo.

My first screencast, just a simple intro nothing really to see, really just to try out recording . Next will be compiling PHP with Pthreads.

Symfony2 on Vagrant


My housemate Jordan has joined forces on a new blog with me and he wrote the first article on how to how to create disposable Symfony2 Development boxes using Vagrant and VirtualBox. Please go and have a read 🙂

Get Laravel Tinker to work with Mac


So I just heard about using laravel’s tinker command to run a nice interactive shell with the framework to test things out. Perfect always nice to have features that allow you to test straight away with no setup.

However the command when typed into my Mac just returned nothing and quit the program. So I dug about in the command to see what was happening. Once I had turned on error reporting again I found the error

Call to undefined function Boris\pcntl_signal()

Turns out macs don’t ship the PHP with pcntl extension installed no problems here is now to fix them. First we need to find out what version of php we are using

php -v

Now remember the numbers ( mine is 5.4.17 )

cd /tmp
curl http://museum.php.net/php5/php-5.4.17.tar.gz > php.tar.gz
tar xvfz php.tar.gz
cd /tmp/php-5.4.17/ext/pcntl

(remember to change the numbers to your version)

Now we can compile and install

phpize
./configure
make
sudo make install

Now we need to tell php to use the extention by adding it to the php.ini

extension=pcntl.so

(An easy way to find your php.ini )

php -i | grep ‘Configuration File’

Once this is done you should see its running

php -m | grep pcntl

Which logo is better


I just updated the look of my website very simply. Made it wider, made the background white and added some red.

I have my current logo with the small circles within a circle or a new one with a reg flame. I can’t decide which one I like more.

or

Going to trail them and decide. Love to hear what you have to say as well.

Laravel HHVM and Debian


Before you read my post please have a look at:
HHVM, Nginx and Laravel
Laravel on HHVM

They are the two guides I used, except I am running Debian. There guides run you though the process alot better. My post is just the commands you need

sudo apt-get update
wget -O – http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add –
echo deb http://dl.hhvm.com/debian wheezy main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm

As hhvm is what is going to run php on the server we can alias it to PHP.

sudo ln -s `which hhvm` /usr/local/bin/php

As laravel’s pastebin is still down we will use Dan Miller’s nice gist version which you can easily download.

wget https://gist.github.com/jazzdan/8262454/raw/5d190c4de5252399cb421f344a789aeb56bb4ebd/config.hdf

Open up the config file and edit the SourceRoot to be correct. You can start the server up.

sudo hhvm -m server -c ./config.hdf

We need to run as root for the use of port 80. The -m changes hhvm’s mode to server and the -c is used to point to the configuration file you just edited.

Hope you enjoy. If you want to compare speeds have a look at apache benchmark and run something along the lines of ‘ab -c 5 http://hhvmserver.com/index.php’

List of domains I own or once owned


I have been a bit of a domain buyer mad man in the past so thought I would make up a list of all the domains I own/owned I will attempt to put them in order.

beta-news.co.uk
noloafing.co.uk
overnightcoding.com
battlefield1943forum.com
wearebattlefieldheroes.com
eastercomputers.co.uk
easterncomputing.com
refreshnorwich.co.uk
forumworks.co.uk
coderapp.com
xboxworkshop.co.uk
xboxworkshop.com
allwebchat.com
wtwl.co.uk
isadick.co.uk
tidesticks.co.uk
tidesticks.com
wikiinstant.com
anglainsharping.co.uk
angliansharping.co.uk
dayornot.com
treadningwall.com
norwichmowing.co.uk
bigmanhero.com
vpdrive.com
yourwebsiteis.com
spintear.com
ifdeveloper.com
parkercottageportland.com
vwgroupforum.com
wjbreachandsons.co.uk
bcyrpt.pw
dev.pw
pixelatedcrow.com
phnorwichmotorcycles.com
phnorwichmotorcycles.co.uk
lushpanel.com
bennett.im

Well I don’t own all of them any more and some of them are clients but man thats alot of domains!

SSH Key Copy Mac


As we all know using SSH keys are a good idea you don’t need to type your password in every time to login to a machine over SSH making it more secure and you can even lock your key on your mac to make sure that only you can access if (if the HDD was removed etc).

ssh-copy-id does not work in mac so you have to do it manually

This one liner will do the work .ssh/authorized_keys

cat ~/.ssh/id_rsa.pub | ssh user@hostname “mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys”

Compile PHP with threads and proccesses


For my university dissertation next year I am going to need to create a high performance application in PHP and the only way to perform this is by multi threading and multi processing the workload.

As the documentation on the area is not amazing for telling you how to install it I thought I would post how I managed it. (You may need to update the links)

wget http://uk1.php.net/distributions/php-5.4.15.tar.bz2
apt-get update
apt-get upgrade -yq
apt-get -yq install bzip2 openssl libxml2 libxml2-dev gcc make autoconf htop sudo git dstat
tar xvjf php-5*.tar.bz2
cd php-5*
cd ext/
git clone git://github.com/krakjoe/pthreads.git
cd ../
./buildconf –force
./configure –enable-maintainer-zts –enable-sockets –enable-pcntl –enable-pthreads –with-tsrm-pthreads
make
make test
make install

Or If you want a one liner

wget https://gist.github.com/wgas/5670447/raw/5ee73da80e677e968d00be555b1e2a84793dff34/InstallPHP; sudo sh InstallPHP

You can all more options to the configuring of php depending what you need.

1 2 3 4