Friday, Jul 1, 2016
Version control. A saviour of modern development and with everyone using git to manage their code nowadays (at least for the last 5 years) having an understanding of git is an essential part of being a developer. Recently I have become more and more involved in code review, using GitLab, Bitbucket and GitHub to manage code from different developers for different projects. This is made easier by using a workable workflow (something like GitFlow), however, as I am involved in more and more projects of endless dread when I start with project and it has unnecessary, large or sensitive files that have been committed into its history. ...
Wednesday, May 6, 2015
Our latest Ansible adventure has been the creation of a task structure which we can use to easily manage multiple Drupal websites on multiple servers.
It’s easy enough to use the Ansible command module to run drush commands on a bunch of Drupal sites, using the following code (where sites is just a list of Drupal root locations):
name: Run drush cc all on each site listed command: "drush cc all chdir=/var/www/{{ item }}" with_items: - sites This is fine if you are only trying to manage sites on a single server, and you could just run this role repeatedly for different servers and change the variable in the playbook to point to a different list of sites. ...
Friday, May 1, 2015
This Monday I had the privilege of giving my first talk at the Drupal Cambrdige meetup (@drupalcambs). It was on the subject of using Ansible to provision servers and manage Drupal installations and the slides are embedded below. I had a lot of fun giving the presentation and hopefully it will be the first of many. I just hope the audience had as much of a good time!
Just a few accompanying notes for the slides (I didn’t want to overdo it with onscreen text for the presentation, so a lot of it is mainly headlines): ...
Friday, Apr 10, 2015
More Ansible goodness this week. We’ve been working on a basic playbook to set up the innovatively-named Monit monitoring tool to keep an eye on our webservers and give them a kick up the backside if they’re misbehaving.
It’s based on a very useful Ansible Galaxy role, pgolm’s Monit, which installs and configures the tool. However, the role’s documentation doesn’t necessarily make it obvious how to get the best from Monit, so here’s an example playbook for monitoring PHP, MySQL and Nginx to get things started: ...
Tuesday, Mar 24, 2015
Three months ago, we were introduced to the wonders of Ansible at Drupal Camp Brighton. Since then, whenever we’ve had the chance we’ve been working on various Ansible playbooks to automate many of our development and maintenance processes.
For a small team like us, Ansible is invaluable. It is reducing the time we need to spend administering our servers and sites exponentially, freeing up extra time for development.
Development and testing happen more quickly as well, and we can be more confident about deployment to live running smoothly because of better consistency between our environments. ...
Tuesday, Feb 3, 2015
Alongside developing lots of different websites in Drupal, we also maintain and administer a number of different servers. In this role we occasionally end up managing a number of different domain names. It struck us as interesting that many people don’t really understand the difference between using the domain with or without www, for example www.willhallonline.co.uk and willhallonline.co.uk. They are technically two different subdomains of willhallonline.co.uk, however, it has to be stressed that they are different. ...
Monday, Jan 19, 2015
We ran into this error PHP Warning: Error while sending QUERY packet. PID=25016 the other day when trying to run an update query on a database with approximately 3.8 million records in it. New data had become available for 2.1 million of these records.
These were submitted using a PHP program which fetched and parsed enormous CSV files before using a PDO statement to insert or update the records into MySQL. ...
Thursday, Nov 8, 2012
Recently I have been doing quite a few more system administrator tasks around different office. I wrote this bash script (I realise it is probably not perfect to bash officianados, however, it does solve that problem). I have attached the completed file below if you want to download it.
Bash Code #!/bin/bash # get all users whose uid is greater than 1000 and less than 60000 for user in `awk -F':' '{if ($3 > 1000 && $3 < 60000) print $1}' /etc/passwd` do # create array as output from quota command array=( $(quota -v $user)) # retrieve amount of space user is using block=${array[17]} #retrieve quota that user is allowed quota=${array[18]} # result = quota - amount used result=$(($quota-$block)) # if result is less than 20000 then do something. ...
Friday, Dec 31, 2010
After the recent period of DDoS (Distributed Denial of Service) attacks on sites which appear to have been linked to Wikileaks; PayPal, Mastercard, Amazon etc. A question arose to me. Is there any way that a business can prevent themselves from being vunerable to DDoS attacks.
Now to define a DDoS attack. Wikipedia defines it as “an attempt to make a computer resource unavailable to its intended users” (DoS Wiki). To use an analogy, if we think of a server as a plughole in a sink. ...
Connect on LinkedIn. Follow me on Twitter. Grab the RSS Feed