Drupal 7 Node Access Control With Access Grants

20th July 2015

There are a few ways in which you can create complex node access systems. Modules like Taxonomy Access Control and Node Access will allow you to restrict node access in different ways, and work very well for setting up taxonomy or role based access control. There are a few edge cases where you need to restrict access to a node based on some arbitrary conditions like the age of the user or the contents of a field. This is where the build in Drupal access control mechanisms come into play.

Scanning Linux For Intrusion With RKHunter

16th July 2015
RKHunter (or Root Kit Hunter) is a program that can be used to scan a Linux machine to see if there is anything there that might be a sign of a security breach. It will scan all of the files on the system and look out for any suspicious files or unexpected changes to system files that might indicate a security breach. Just like anti-virus systems it has a database of root kit definitions that it will use to compare files against to see if they are infected but will also just check for changes to core system files.

Some Useful Curl Snippets

14th July 2015
Curl is an incredibly useful tool and has all sorts of flags and options available for every situation. I tend to use curl quite a lot for all kinds of stuff, and not just downloading large files. So I thought I would post a few of the most common things that I use the tool for. Note that most of the following URLs don't really exist, they are just for demo purposes. I have also left out the output of these commands as they vary from a few lines to many pages of output.

Setting Up Basic Authentication On A Drupal Site Without .htaccess

14th July 2015

Basic HTTP authentication is a simple authentication mechanism that is used to prevent access to an site or directory on a server. It is by no means the most secure authentication mechanism but it is commonly used on staging sites in order to prevent unwanted access. This is a good way of preventing search engine bots from spidering the staging site, which is undesirable as it can cause staging site pages appearing in search engines results.

Compiling And Installing PHP7 On Ubuntu

11th April 2015

At the LAMP and Beyond III event (run by PHPNW) this weekend we set ourselves the task of giving PHP7 a go. Below is some nodes from that session.

This assumes that you’ve already installed PHP5.6 along with Apache and MySQL. Installing PHP5.6 via apt-get is fine as we just need some of the dependencies to be present.

To get the the code for PHP7 you need to clone from the PHP repo on Github.

Getting Started With Cache Functions In Drupal 7

30th March 2015

When generating markup in Drupal you'll often want to store the output in a cache instead of regenerating it every time. This is especially important for potentially expensive rendering tasks that don't change between page requests. Drupal 7 comes with a cache system that can be taken advantage of with the cache_get() and cache_set() functions. There is also a third function called drupal_static() that also fills in gaps between these two functions.

DrupalCamp London 2015
Nearly a month has passed since my visit to London for this year's DrupalCamp and I thought I would put my thoughts down on the blog. I went down with a group of colleagues from my company Access on the Friday night before the event, having arranged a flat through Airbnb for all of us to stay in. After some beers and a burger we were ready for the main event on Saturday morning.
philipnorton42 Tue, 03/24/2015 - 20:11

Allowing Cached HTTPS Traffic From Drupal With Varnish And Pound

29th January 2015

Varnish is a web application accelerator that helps to speed up websites. It works by sitting in front of the web server and caching web pages that are served by it.

When a request for a web page is made Varnish passes this request on to the web server, which then responds to the request as it normally would. Varnish then caches the result of this request before sending it to the user.

Pretty Print JSON With Python

23rd December 2014

JSON is a very common data format, but reading it can be a little difficult, especially if the JSON contains very little white space. If you have Python 2.6 or above you have use the json.tool to format the JSON so that you can read it correctly. This is also a good way to validate JSON strings that you have had to hand edit before they cause errors upstream.

If you have a file called file.json, which contains a bunch of JSON output, you can use Python to format this into a readable structure in the following way.

PHPNW14: A Review

7th November 2014

The annual PHPNW conference, now in it’s 7th year, was held on the 4th and 5th of October in Manchester, again in the Mancester Conference Centre. The conference was attended by over 400 people with over 30 speakers from all over the world who talked about everything from project management to the internals of PHP. I have been volunteering at PHPNW for a few years now, but this year I was able to attend as a delegate with a number of colleagues from Access. It’s been a few weeks since the event, but I haven’t had a chance to publish this review, so here it is.