Plusnet Server Side Includes

Websites hosted at Plusnet can use server-side includes (SSI), but there are some things to be aware of. The static webspace does not enable SSI by default but it can be enabled with a .htaccess file using these directives: AddType text/html .shtml A…

Updated syncFTP

SyncFTP is a Ruby gem that allows synchronising of a local directory tree with a remote one over FTP. It pushes from local to remote and removes anything on remote that isn't on local. Usage Usage is explained in the README but here are some things I…

Database admin with Adminer

Adminer is a lightweight database admin tool written all contained in one PHP file. Replace phpMyAdmin with Adminer and you will get a tidier user interface, better support for MySQL features, higher performance and more security. See detailed compar…

Hostopia: PlusNet's new CGI Platform

These are my notes covering what was necessary to complete the migration to the new PlusNet CCGI webspace hosted by Hostopia. In summary, the new hosting is working with one application, a very old Joomla containing a DokuWiki. The content for this h…

The Google+ URL Experiment

Apparently I have a Google Plus URL. Here it is: https://plus.google.com/112693144602768266862 You can use your Google URL as an OpenID identity, but it would be more useful if it was easier to remember. ! You can also use http://google.com/profiles/…

Accept PayPal Donations

You can use Paypal to add a button to your web site that can be used to accept donations. NOTE: before implementing a donate button, bear in mind that, unless you are a designated non-profit or charity, their use is questionable. Here are some articl…

Fontastic Fontex

For me, it's been the week of the font. I've been seeking out typefaces for the sites that I am working on, packaging some for Arch Linux to make installing them easy and learning about the various formats and how best to use them. All in all, a font…

Cold-start a Git branch

I have a repo on GitHub and I wanted to completely replace the master branch with a new one. That is, I wanted to cold start the master branch so it has no content or commit history and push a completely new master branch with new and unrelated conte…

Domain Transfers between 123-reg and Domainmonster

One of my domains, johnlane.org.uk is registered with 123-reg is up for renewal in seven days. As an experiment, I will transfer it to a new registrar, Domainmonster. Being a .co.uk domain, 123-reg charges £3.49+VAT per year whereas Domainmonster is …

Testing Rails Routes

Checking configured routes in a Rails application is usally done using rake routes. If routes aren't being recognised as you expect, you can use a rails console to help see what's happening: $ rails console > r = Rails.application.routes > r.re…

Rails app: Categories - a closure tree

My application contains items that need to be categorised. An item should be able to have zero or more assigned categories. The available categories are orgainsed in a tree-like structure of categories and sub-categories. Such a tree-like hierarchy c…

Rails: Use Cells to decorate model objects

In my application, I have items that can have multiple associated images. I wanted a nice encapsulated way of displaying those images as a carousel styled using Twitter Bootstrap. In summary, I wanted to write nothing more than this in the view: <…

Apotomo pagination

Imagine a widget called Items that displays a load of items. The Items widget has an Item child widget that it used to display each item. Here we create a test application to demonstrate. rails new apotomo-paginate cd apotomo-paginate echo "gem 'apot…

Generating MAC Addresses

When virtualising, it's useful to have MAC addresses for the network interfaces of virtual machines and containers that are locally generated and reproducible. Left to its own devices, Linux Containers will assign a MAC address to a container when it…

HP All-in-one on Linux

Setting up printing is easy. Using configuration like the below in /etc/cups/printers.conf is sufficient: <DefaultPrinter printer_hp7210> UUID urn:uuid:ce232525-665c-31e4-568e-9bfe0bac614d Info MyPrinter Location Print Room MakeModel HP Officej…

It's all in the name

When starting up in business, on the web especially, choosing a name can be difficult. Getting the right name can have an effect on how your venture progresses, how it's perceived and how you feel about it. it's all in the name With the dwindling sup…

Method Madness

Playing around with Ruby today, it dawned on me that if everything is an object, then a method is an object. def foo puts "foo" end m = method(:foo) puts m.class # -> Method puts m.class.superclass # -> Object So, a method is an object: it's an…

Exorcising Ghost

In case you ever need to cold-start your Ghost server, here is how you do it. Delete the Database If you delete your database file, you will be back to the beginning, except that any themes and uploaded images will remain intact. To delete the databa…

Display IM/VoIP Presence on HTML Page

I wanted to show status information for instant messaging and VoIP services on my web site. Here are some notes about this for the various services Yahoo Y! Messenger To display Y! Messenger status, the HTML is as follows: <img src=http://opi.yaho…

Mount a QCOW2 disk image

If you need to get files off a QCOW2 disk image file, it is quite straightforward. QCOW2 files are disk images used by the QEMU emulator. If you just need access to the files, you can mount them directly - there is no need to run up an emulator. QCOW…

Stop bugging me: this copy of Windows is genuine

There are many legit reasons for installing and re-installing Windows. Often this can lead to a legit copy of Windows reporting that it isn't genuine and doing other annoying things like removing your wallpaper and setting the screen to black. It's v…

About DropBox

I'm a light Dropbox user. I occasionally need to sync some files between machines or share the odd file publicly. Through using the service, the odd issue crops up or I discover the occasional hint or tip. It is here that I record those for reference…

Using GIMP

This is a collection of tips and tricks relating to using The Gimp. Rounding Corners Rounding the corners of a rectangular or square image often leads to a more visually appealing result. This can be achieved effectively in CSS but, if the effect is …

A Samba Active Directory Server

This post shows one way to set up an Active Directory server using Samba . This example creates a virtual server in a Linux Container on a server farm. Container Setup First, create a new container: lxc-create -n samba -t ubuntu -B lvm --vgname farm …

An Ubuntu Virtual Server Farm

This post shows one way to set up a farm of virtualised servers using Linux Containers(LXC). This example uses Ubuntu Server for the host. Host Setup The host system is a basic x86 64-bit server with two hard drives of equal size and a single network…

Viewing HTTP headers

If you ever need to view the HTTP headers sent to be browser from a server, here's one way to do it: curl -I http://localhost:3000 For example: $ curl -I http://localhost:3000 HTTP/1.1 200 OK X-Frame-Options: SAMEORIGIN X-Xss-Protection: 1; mode=bloc…

Raspberry Pi Camera

I got a Raspberry Pi camera module for Christmas that I plan to attach to my experimental Pi, the one that I keep lying around just for trying things out on. My experimental Pi lives in a Pibow case to give it a little extra protection. I was also su…

An Improved Arch Linux Template for LXC

Having experimented with the lxc-archlinux to create a Linux container, I found it lacking in a few areas. I normally roll my own containers from scratch so I thought the template could be improved upon. The first thing I changed was to remove the fu…

A distcc Server for Raspberry Pi

Here's a quick way to get a distcc server up and running to take the heat of those times when you need to build packages on the Raspberry Pi. This method implements an Arch Linux i686 server with the view to supporting builds from Arch Linux ARM runn…

The ABC's of UNIX

When I logged in this morning, my fortune displayed The ABC's of UNIX. Worth a post, I thought... A is for awk, which runs like a snail, and B is for biff, which reads all your mail. C is for cc, as hackers recall, while D is for dd, the command that…

LXC on Arch Linux: Ubuntu Container

I wanted to try some things out in a Ubuntu environment and, so embarked on trying to quickly set up an LXC container. Here's how I did that. First, Arch lacks an arch command which the Ubuntu template tries to use, so just create one. Put the follow…

Starting a new rails app

Today I start a new Rails project and I plan to blog about progress here. So, to get started, we first need to do some set-up. I use myproject as the project name here but the actual project name is something else. First steps As a RVM user, the firs…

Bash start-up files

When you log in to your Linux box or open a new terminal window on your Linux desktop, there are several start-up files that can be executed before your command prompt is displayed. Which files are executed depends on a number of factors, not least y…

Boot a Raspberry Pi with an LVM root partition

This post explains how you can boot the Raspberry Pi into a system with the root partition on an LVM volume. LVM is Linux Volume Management. I originally posted this on Stack Exchange. Configuration In order for early-boot to be able to access an LVM…

Install Ghost on Raspberry Pi

After initially playing around with Ghost in a Linux Container sandbox on my development machine, I wanted to move it on to a more appropriate always-on server. I run a small server using a Raspberry Pi running ArchLinux ARM so that seemed like a goo…

No comment?

Having written a few posts to try out Ghost, I suddenly realised that something was missing: comments. Noting that the lack of comments is by design, I set out to find a solution. And there are several but I'm going with Google+ comments because it a…

A theme of my own

After a couple of posts to try things out, I wanted to make a few tweaks to how the site looked. I wanted to play with the colours of the blog title text because it wasn't easily visible over the blog cover image that appears on the main page. This e…

Install on Raspberry Pi

This article describes how I install a new filesystem onto my Raspberry Pi. It is written as a note-to-self and, therefore, might not make complete sense. My Raspberry Pi has two storage devices: the mandatory SD card that it boots from and a hard di…

Installing Ghost

Installing ghost on Arch Linux # pacman -S nodejs # node -v v0.10.21 # npm -v 1.3.11 # wget https://ghost.org/zip/ghost-0.3.3.zip # pacman -S unzip # mkdir /srv/ghost # cd /srv/ghost # unzip ~/ghost-0.3.3.zip # npm install --production Change the lis…

Partition Alignment

As storage devices get bigger and new technologies come to the fore, being forearmed with a little depper knowledge of how partitions and file systems are laid out can bring benefits that maximise the storage devices' performance. Background I'll beg…