Drupal Cron getting stuck

I've just run into the drupal cron problem again  

Cron fails and the error log says

"Attempting
to re-run cron while it is already running."

 

  • delete from variable where name='cron_semaphore';
  • clear caches
  • run cron from the web page

That seems to do the trick.

Now cron runs OK fom drush or web.

Read more

Programatic Block Creation in Drupal

To remove static blocks and replace with as custom block.

Implement hook_block specifying the default visibility and so on

<?php
$blocks
['random'] = array(
     
'info' => t('Random'),
     
'weight' => 0,
     
'status' => 1,
     
'region' => 'sidebar',
     
'pages'  => 'offers',
     
'visibility' => 0, // all pages except
     
'cache' => BLOCK_CACHE_PER_PAGE,
    );
?>

Create an update hook that deletes the old blocks and boxes (I've specified the ID as I know they won't change on my site).

Read more

Bug in Trac on Ubuntu Jaunty

There is a bug in Ubunty Jaunty which cause Trac to have errors.

 Attachments do not work, the admin interface for milestones doesn't work properly - and there may be other issues.

The bug report is at https://bugs.launchpad.net/ubuntu/+source/trac/+bug/369792

And the solution is 

"go to http://packages.ubuntu.com/karmic/trac
and scroll all the way down. There you'll find a download link for the
karmic package which you can download and install via

Read more

Moving an svn repository to integrate with trac

I just started on a project that was using trac and subversion but they weren't integrated. I love the cross referncing trac provides. It can really help explain changesets and show how an issue was resolved.

The steps to add subversion to trac are

Read more

Upgrading Debian Etch to Lenny

Debian Etch has been serving me well for a few years with wonderfully easy and infrequent maintenance.

However it's at the end of its life

http://www.debian.org/News/2010/20100121

So I've upgraded to Lenny following these instructions

http://www.debian.org/releases/lenny/i386/release-notes/ch-upgrading.en....

It was remarkably painless

One small problem with the mail system.

Errors were encountered while processing:
exim4-config
imapproxy
exim4-base
exim4-daemon-light
courier-imap
at
bsd-mailx
courier-imap-ssl
mailx

Read more

London Datastore

"The Mayor of London Boris Johnson today (7 January) fired the starting
gun on an information revolution in the capital as he announced that
City Hall is to release online, for the first time, huge realms of
previously unavailable data for everyone to see and use free of charge. " see full press release

 

London Datastore

http://data.london.gov.uk/

Read more

CVS for subversion users

I've been using version control for a long time, but I haven't used CVS much since the first day I tried Subversion.

(Git seems great but isn't the same kind of drop-in upgrade that CVS to Subversion was)

Things I forgot

Read more

Make Drush support PHP-5.1

Drupal has a fairly easy to meet set of requirements http://drupal.org/node/502452

But Drupal projects are free to set their own rules in this area and Drush has used functions only available in PHP 5.2 - as far as I can see this is just the json functions.

Frustratingly the latest version of RedHat provides PHP 5.1 and this is the second time I've run into the problem with a client who uses RedHat and understandably wants to stick to the standard packages.

Read more

Amazon MP3 Downloads for Linux

It's great that Amazon actually offer a version of thier MP3 downloader for Linux - just a shame that it doesn't work for many distributions.

Fortunately clamz is available 

It's a great little command line utility with a very forgetable name.

Read more

Hard Drive Testing using smartmontools

Test the hard drive with

smartctl -t long /dev/hd?

This may take hours to run and will do so as a background process.

Once complete run the following to see results

smartctl -l selftest /dev/hd?

Read more