Blog Posts

I use amazon S3 to host my simpler static websites, it’s simple, cheap and removes all the hassle from administering a web server.

I had to add some redirect rules to redirect some of my posts from my old url format to my new one. This is how I did it.

 Read more

Using FOSUserBundle you may want to redirect the user to the homepage when they visit the login page and already logged in, this isn’t provided by default in the bundle, but it’s very easy to implement.

It involves overriding the FOSUserBundle with your own child bundle and then adding your own custom implementation of the loginAction which redirects the user as required. Let’s have a look at how to do this.

 Read more

Pyenv helps us to install, manage and switch between multiple python versions, most commonly done for testing your code across multiple python environments.

In this post, we’ll have a look at getting up and running with pyenv.

 Read more
in

I’ve recently moved to Github for my private repositories and was in the process of migrating my repositories over. I wanted to be a good citizen and reduce my repository size as much as possible by excluding binaries I had previously committed on an iOS project.

Here’s how I did it.

 Read more

I’ve recently switched to using a static blog generator for my blog. I have the domain name anil.io, I wanted all the emails received to any addresses under this domain to be forwarded to another email address.

blockdiag Email SES S3 Lambda User

I wanted to host this blog on AWS S3 as a static web site with HTTPS and turbo charge it through amazon’s CloudFront CDN. I needed to use AWS Certificate Manager to verify my domain by sending a verification email, and then proceed to link to certificate to CloudFront.

This is a tutorial on how to setup amazon web services SES service to receive emails using S3 and to forward them on to another target using an AWS Lambda script with Node.js.

 Read more
in

There are a number of ways to create and use singletons with Swift, I’ve listed a few here as well as my preferred approach.

 Read more

Selenium is an awesome tool to automate the testing of your application, although, there are a number of better performing headless solutions available today for testing (Phantom.js, Zombie.js). Selenium can still be extremely useful to load a web page, perform some actions like a search and extract data from it.

Here are 2 answers I posted on StackOverflow.com demonstrating the basic concept, let’s have a look and get up and running with Selenium.

How to use Selenium with PHP? Disable images in Selenium Python
 Read more
in

I learned an awesome YAML feature today, the ability to use variables in YAML files.

I’m not talking about application variables, but blocks of re-usable YAML which you can reference later on in your file.

Searching online, you won’t find much information on this, but it is in the official YAML specification.

Let’s have a look at this amazing YAML (relatively unknown) feature!

 Read more
_images/dyndns-aws-route-53.png

A guide on installing AWS tools on Tomato Shibby to roll your own dynamic DNS service.

Tomato Shibby is a custom firmware which can be flashed on to routers to provide many after market features and also access to root. For example, you have hook up an external HDD to the router and use it as a media server.

This is a short guide to get up and running with Entware, Python and awscli tools. We’ll install a script which will update the DNS on AWS Route 53 when the IP of the router changes.

 Read more
in

I had some free time today and somehow ended up reading about HTTP, I found something that made me chuckle.

 Read more

A guide on how to install Apache Nutch v2.3 with Hbase as data storage and search indexing via Solr 5.2.1.

Apache Nutch is an open source extensible web crawler. It allows us to crawl a page, extract all the out-links on that page, then on further crawls crawl them pages. It also handles the frequency of the calls and many other aspects which could be cumbersome to setup.

Let’s have a look at setting up Apache Nutch with Hbase.

 Read more

A guide on how to install Apache Nutch v2.3 using MySQL as database storage and search indexing via Solr 5.2.1.

Apache Nutch is an open source extensible web crawler. It allows us to crawl a page, extract all the out-links on that page, then on further crawls crawl them pages. It also handles the frequency of the calls and many other aspects which could be cumbersome to setup.

Let’s have a look at setting up Apache Nutch with MySQL.

 Read more

Apache Storm is similar to Hadoop and it’s MapReduce jobs concept. Apache Storm allows you to run topologies which execute indefinitely (until killed), this makes it an awesome tool for real time processing, analytic’s processing and more.

You can write topologies in any language and run them on a storm cluster. Topologies are small groups of code which mainly consist of Spouts and Bolts. Spouts will continuously emit data (reading from any data source), once it has a new data subset, it will pass it onto a Bolt for processing, which may also pass it onto other bolts or ack (acknowledge) it, to signify we have successfully processed this tuple.

Like Hadoop, Apache Storm automatically handles the management of running all Spouts and Bolts across multiple servers for best performance.

It’s no wonder companies such as Yahoo, Twitter, Spotify, Yell, Groupon, Flipboard and many others are utilizing this incredible tool.

Let’s have a look at how to setup and run Apache Storm topologies locally.

 Read more
in

I was approached by a rich uncle recently to install Imagick on a CentOS 6 server. Rich Uncle currently uses GD and was hoping to see a performance gain over it.

Here are the step’s I took to download, compile and install ImageMagick on a Cent OS 6 box.

 Read more

This is a guide for setting up and maintaining a dreambox satellite set top box.

A dreambox runs a small subset of Linux called busybox. Unlike a full blown linux installation, busybox is built for embedded devices and so has a much slimmer set of pre-installed tools.

When managing software on a busybox embedded system you have to be careful not to use up all the internal flash storage memory. In this post, we manage to install all our required packages, and still keep several megabytes free.

 Read more
in

I’ve been learning to code in Objective C recently for native Mac & iOS development. This is a quick cheatsheet of some of the basic concepts I’ve come across in Objective C.

 Read more
in

PHP Quality Assurance tools are a must for any project, they can help in the analysis and optimization of your code by testing your code autonomously, finding duplicate code across your code base and giving you useful metrics towards your project goals.

In this post, we’ll discuss a few of the commonly used tools in PHP, and the very basics of how they are used. You’d usually use them in a continuous integration environment like Jenkins, but can also be run locally through your IDE whilst developing for a more real time update.

 Read more

Think of phing as bash scripting with xml. It allows us to do things like:

  1. Make a directory
  2. Give it x permissions
  3. Copy some files into it

Instead of us using bash to script all these, we can use phing. Phing allows us to script all of these tasks using xml. Phing is based off a more popular tool (which if i’m honest I prefer) called Apache Ant.

 Read more

In this post we will cover the installation, setup and basic usage of Jenkins.

If you’ve never heard of Jenkins before, Jenkins is a continuous integration tool which automates the building of your application, it can be setup to unit test your code, check for mess detection & coding standards as well as many other things after each commit or before a release build.

I’m a huge fan of unit testing, I love being able to automate the testing of your code as well as using tools like mess detection, phplint & phpcs to write cleaner, consistent testable code.

 Read more

Let’s have a look at the different ways of installing packages in PHP. We’ll cover Composer, Phar archives and PEAR packages.

 Read more

Symfony’s Console component and the commands provided by Symfony framework are one of my favourite things about Symfony, it can help to quickly bootstrap a new project or perform tasks whilst maintaining an existing one.

This was a script I came across on Github to enable Symfony console auto complete for all projects without adding any additional code to your projects.

Say I started typing app/console cacTAB, this script would allow me to auto complete the cache command or view the available commands. This also works for your own console commands on a per project basis.

 Read more

At some point when using Javascript you’ll need to pop open a window.

This is straight-forward for people with only 1 display but I also needed to account for people with 2 displays. Here’s the snippet of code I used.

 Read more

Cookies are a great way to store small amounts of information. Use the following 2 functions to help manipulate cookies in the browser.

 Read more
in

Here’s an awesome tip to Quick Look more files on Mac.

Visit http://www.quicklookplugins.com/ to download a whole range of plugin’s to view even more file formats.

 Read more

We can use the Doctrine\ORM\Tools\Pagination\Paginator class in doctrine to paginate results without the use of any additional libraries or bundles, here’s a quick walk through on how to paginate a result set with Symfony, Doctrine & Twig.

 Read more

If you’re a nosey bugger like me, and you’re researching who owns a domain name and when it expires, who.is is the place to go.

You can grab the same information for any domain programmatically using the following steps, it’s completely free to do and shouldn’t take more than a few minutes.

 Read more
in

Here’s a fun little PHP fact, Did you know, text enclosed within back ticks ( ` ) is executed within the shell command line?

The back tick in PHP is known as an language::operators.execution(), it’s function is identical to shell_exec.

 Read more