Nick's blog

Generate Entropy for GnuPG

Jan
22
2010
Tagged in , &
GnuPG Logo

Has anyone every tried to generate a GPG (or GnuPG) key? I have… and I received this error…

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 284 more bytes)

Drupal, ImageCache & Performance

Nov
14
2009

A while ago we started having issues running a website. Bandwidth. Upon investigation, we saw that the majority of bandwidth was being use by image files and of those, lot was from the ImageCache folder. It was also causing a lot of excess server load by consuming Apache processes. Something needed to be done.

Drupal Autocomplete in Vim

Aug
18
2009
Tagged in , &
Vim Logo

I recently stumbled across a handy tutorial on configuring a Drupal dictionary in Vim for autocomplete. I also remembered helping a friend out with a similar problem, Drupal syntax highlighting for Nano. I then combined the two and have a simple to follow tutorial for generating your own drupal 6 dictionary for vim autocomplete!

Patching can cause permission denied errors

Aug
11
2009
Tagged in , , &

I just updated this server to PHP 5.3. As all my sites are Drupal 6 it seems I have a few issues ahead which mean I need to patch Drupal to stop PHP complaining about deprecated stuff…

So I headed over to the post on drupal.org which is discussing 5.3 compatibility in Drupal 6 (which I personally think SHOULD go in) to grab a patch. I applied the patch with no problems. I refreshed a page and got a white screen so I checked the logs only to see…

Vim Tips: Replace 0px with 0

Jun
23
2009
Tagged in , , &

I like little wins. I was just looking through the CSS file for this site and noticed that - for some reason - I'd used 0px instead of   a LOT of times. Most values need numbers (10em, 10px, 10% and 10pt are all very difference sizes) however 0 is one of the few valeus which is the same in all cases (0px, 0pt, 0% and 0 are all zero!). This adds up to wasted data and bandwidth; admitedly not a lot, but still Every Little Helps!

So I fired up Vim. Initially, I just did:

Indenting in Vim

May
27
2009
Tagged in , &

Ever had that situation where you've enabled :set paste and pasted in hundred of lines of code into vim only to see it all fully left aligned? I just did… And bugger going over each line and manually indenting it! Want know how to indent a visual block of text?

How to use "sed" to find and replace

May
26
2009
Tagged in , , &

After Worldpay recently changed to use the RBS system, I was tasked with finding every instance of select.worldpay.com/wcc/purchase in our forms and replacing it with select.wp3.rbsworldpay.com/wcc/purchase. There appeared to be thousands of files and I wasn't going to do it manually…

PHP's display_error, not always a good thing!

May
19
2009
Tagged in , &

I just hit an interesting issue while trying to upgrade a Drupal 5.18 site to Drupal 6.12. I went to the update.php page and noticed an error at the top implying the url_alias table was having issues due to Drupal 6 expecting a language column which wasn't present in Drupal 5. "No problem" I thought, "That'll get fixed during the update!". This was the beginning of a long learning curve through the new <a href="http://api.drupal.org/api/group/batch/6">Batch API</a> system!

Backing up a Drupal Database: Redux

Apr
27
2009
Tagged in , , , , , &

Back in November last year, I wrote a script which handled backing up a drupal database. There were quite a few comments and I've taken some on board and developed the script on a little further to be more "generic".

One of the main complaints/suggestions about my previous snippet was the hard coded nature of it. The follow script offers far more configuration through the command line itself.

I'm a lazy linux piper

Mar
11
2009
Tagged in , , , , &

This morning I updated a site to the latest release of Drupal 5.16. Nothing special there at all. I've done that many times as has (hopefully) mabye other drupal devs… However, I'm a bit of a newbie when it comes to SVN. Didn't I mention this drupal site was in an SVN repository? ;-)

So, I've svn copy'd the trunk to an "<em>update_to_5.16</em>" branch, checked out this branch and done a cvs up -dP -r DRUPAL-5-16. Everything is going according to plan so far. Next I run svn status to get a list of files which I need to mark as added or deleted (or to list anything else which has gone wrong). What happens next is I get a list of hundreds of CVS Template files which have been added to the CVS folders. For example…

Follow Me