Development

How to perform high availability deployments of stateful applications in AWS - Zookeeper edition

Deploying stateless applications in AWS is pretty straight forward using AMIs and ASGs, however stateful applications are much trickier to deploy in an automated fashion with most people resorting to hard coded instances that are updated in place. In this article we will take a look at a way to use ASGs and AMIs to achieve high availability rolling deployments with stateful applications, using Zookeeper as an example.

Read more

How to ship JSON logs via Rsyslog

It's pretty straight forward to ship text logs via Rsyslog; but what if but what if you're log files and are in JSON and you want to ship them?

Read more

How to create an OpenVPN bastion machine in AWS

It is common practice to use SSH jumpboxes and security group to restrict SSH access to instances in AWS. This method works fine, but sometimes being able to access instances directly in a secure way can be very useful indeed, to achieve this you can use OpenVPN combined with a few AWS tricks to create a resilient VPN bastion server.

Read more

Useful commands for checking server status

When things go wrong it's very tempted in today's cloud based world to simply kill the machine and start again, sometimes however you will really need to figure out exactly where an issue lies, especially for recurring issues. Here is a selection of tools and commands for your tool belt so you can quickly figure out what the issue is when servers start misbehaving.

Read more

How to ship logs with Rsyslog and Logstash

Rsyslog is lightweight and powerful, it's an excellent tool for log processing and remote shipping. Using it you can ship not only syslog messages, but also messages from any application log file with precise control over the format. This guide takes a look at using Rsyslog as a shipper for Logstash.

Read more

How to build a Puppet repo using r10k with roles and profiles

Puppet has evolved a lot over the years, battle worn and weary operations people have come up with methods and patterns for organising Puppet repos and new tools have emerged that take care of some of the annoying bits of managing Puppet. Avoiding the age old problem of monolithic, scary piles of code that everyone's afraid to touch is now possible as long as you take care to apply well worn patterns and ideas. In this article we'll take a look at r10k and some common design patterns for Puppet.

Read more

A method for using fact based nodes with Puppet

Puppets method of assigning configuration to nodes based on their hostname works well enough in static server environments where you can guarantee that your IPs and hostnames will always be the same, however in dynamic, cloud based environments such as AWS this method can become a hinderence. Specifically assigning a role to a node and using this to draw config from the master works well in such environments.

Read more

Custom annotations in Symfony2 using Doctrine2's annotation classes

I'm sure you've already used annotations either in Symfony2 or another language (such as Python) that provides native support. PHP has lacked support for annotations for too long, thanks to Doctrine2 you can now write custom annotations without too much trouble.

Read more

How to debug DFP ad server calls

DFP comes with a handy debug console that gives you some information about the ad calls on your page, however there are other ways to inspect exactly what data is being sent to the DFP ad server and exactly what content is coming back.

Read more

How to setup a test platform using Symfony2 and PHPUnit

Symfony2 and PHPUnit go together like mint and icecream, but out of the box Symfony2 does not provide a nice way to rebuild an applications database between tests, this is pretty crucial to building a effective test platform. Luckily some other chaps have already sat down, had a good ponder and come up with a nice solution to this issue.

Read more

Using multiple databases with Symfony2 and Doctrine2

I used to believe in vampires, vampires were kick ass when I was young! Similarly in my recent years I used to believe that it wasn't possible to use multiple databases with relationships with Symfony2 and Doctrine2, however the modern, wiser me no longer believes in the existence of blood sucking pale corpses, and similarly now knows that one can have multiple databases within a Symfony2/Doctrine2 app. Here's how to do it.

Read more

How to setup DFP Targeting parameters

Pushing custom page/section/whatever targeting parameters into adverts is a common requirement. DFP has some very straight forward functions that allow you to push in custom parameters across all ad slots on a page or individual ad slots on a page.

Read more

How to create a custom Doctrine2 hydrator with Symfony2

Doctrine2 allows you to create your own custom hydrators in case the stock ones do not provide the functionality that you require, Symfony2 provides an easy way to register your hydrators so you can use custom hydrators throughout your application.

Read more

How to refresh Google DFP ads

Refreshing ads as part of an ajax interface can be a pain, many ad providers do not support this feature out of the box. DFP does however which is yet another awesome feature of the DFP platform.

Read more

How to setup Google DFP ads on your site

Google’s DFP ad platform is all kinds of awesome. It allows for easy targeting of each part of a site and even more awesomely the ads can be loaded asynchronously in iframes right out of the box, so no more horrible document.write page blocking ads, sweet!

Read more

Get the current post in Wordpress

A quick and easy way to get the current post in WordPress, works pretty much anywhere and doesn’t need to be used in the loop.

Read more

CSS and SASS tips for better webapps

You can do a lot of awesome stuff with CSS and SASS, but you can also do some silly stuff. Here are a few tips to avoid some common pitfalls within your webapps.

Read more

How to restructure your webapps CSS with SASS

SASS is awesome, seriously awesome, massive chocolate bar covered in honey slapped into a wedge of ice cream awesome. Taking full advantage of this awesomeness does require a bit of a CSS rethink however since SASS allows you to write your css programmatically with functions and variables. Thanks to the ability to import SASS files into other SASS files you can also write partials which allow the breakdown of styles in modules and components into a similar fashion to how any decent programmer will break a web application.

Read more

Should your site be using etags or not?

The subject of eTags and there usage has caused a lot of debate over whether they should be employed or not, the question of using them or not really depends on your server setup.A lot of the etag debate is down to Yahoo’s YSlow tool that always reports that they should be turned off in order to improve performance, but is this always the right thing to do? I used to think so but a bit of research has revealed that this may not be the best course of action.

Read more

How to use the YUI3 lazy loader to speed up a site

One of the best features of YUI3 is it’s lazy loader functionality. Using the loader means that you no longer have to specifically include your YUI javascript files, the loader will include any files that your page needs for you, neat!

Read more

Dynamically creating and refreshing social components

Social controls such as Facebook like, Facebook comments, Google +1 and Tweet can be created dynamically using javascript. Personally I’ve found this useful for refreshing these controls when loading content dynamically.

Read more

An introduction to YUI3 Plugins

YUI3 provides several basic object classes that you can use to build up your own objects. These objects provide a nice config system for building adaptable objects, along with some other built in features that I’ve found very useful for building javascript objects. In this article I’m going to talk about Plugins which are generally small bits of functionality that can be applied to a DOM element.

Read more