Tutorials

How to use Authorized Keys to Create a Passwordless SSH Connection

Added on 1st February 2012

Rather than have to search through Google whenever I need to find the original article, I thought that I'd post it here for my own reference.

local$ ssh-keygen -t dsa
local$ scp ~/.ssh/id_dsa.pub remote:~/
local$ ssh username@remote 
remote$ cat ~/id_dsa.pub >> ~/.ssh/authorized_keys remote$ chmod 644 ~/.ssh/authorized_keys

How to Install and Configure Subversion (SVN) Server on Ubuntu

Added on 19th October 2011

Recently, I needed to set up a Subversion (SVN) server on a Ubuntu Linux server. This post is going to outline the steps taken, and the commands used, to install and configure the service.

Note: As I was using Ubuntu, I was using the 'apt-get' command to download and install the software packages. If you're using a different distribution of Linux, then this command may be different. I'm also assuming that Apache is already installed. 

Firstly, I'm going to ensure that all of my installed packages are up to date, and install any available updates. 

Create Multigroups in Drupal 7 using Field Collections

Added on 28th August 2011

One of my favourite things lately in Drupal 6 has been CCK 3, and more specifically, the Content Multigroups sub-module. Basically this allows you to create a fieldset of various CCK fields, and then repeat that multiple times. For example, I use it on this site whist creating invoices for clients. I have a fieldset called 'Line Item', containing 'Description', 'Quantity' and 'Price' fields. With a standard fieldset, I could only have one instance of each field - however, using a multigroup, I can create multiple groups of line items which I then use within the invoice.

Optimise your Drupal Theme for an iPhone or iPod

Added on 30th November 2010

To begin with, enter the following code at the top of your page.tpl.php file:

 

{syntaxhighlighter brush: php;fontsize: 100; first-line: 1; }<?php
if (ereg('iPhone',$_SERVER['HTTP_USER_AGENT'])) {
$iphone = 1;
} elseif (ereg('iPod',$_SERVER['HTTP_USER_AGENT'])) {
$iphone = 1;
} else {
$iphone = 0;
}
?>{/syntaxhighlighter}

This creates an 'iPhone' variable, and sets its value to 1 if the an iPhone is being used. The value of the variable can then be used in an 'if' statement to create content that's only shown if an iPhone is being used.

Use Regular Expressions to Search and Replace in Coda or TextMate

Added on 4th November 2010

As in the original post, I'd generated a list of node ID values, and needed to add structure the SQL update statment formatted in a certain way. However, I changed my inital query slightly to out put the same nid value twice.

 

{syntaxhighlighter brush: sql;fontsize: 100; first-line: 1; }SELECT nid, nid FROM node WHERE TYPE = 'blog' ORDER BY nid ASC;{/syntaxhighlighter}

Create an 'Unread Messages' View in Gmail

Added on 28th September 2010

As a user of Gmail for my personal email account, and Google Apps for my work email accounts, I spend a lot of time using the Gmail interface. One thing that I use in Mail/Outlook that I missed in Gmail is a view of my unread messages. Here is a quick tutorial of how I created one.

The first thing that I needed to do was go to 'Labs' within my Gmail account, and enable the 'Quick Links' lab. This adds a block on the left-hand side of my Gmail window, which allows me to quickly bookmark any URL within Gmail.

Create a Better Photo Gallery in Drupal - Part 2

Added on 17th August 2010

At the end of my last post, I'd finished creating the first part of the new photo gallery, but I wanted to change the dates of the published photos to reflect the ones on the client's original website.  

Firstly, I'll refer to the previous list of published galleries that I created before, and create something different that also displays the created and modified dates. Picking the node ID of the required gallery, I used the following SQL query to display a list of photos.

 

Pages

Subscribe to RSS - Tutorials