Breadcrumbs in Drupal
Tuesday, April 28th, 2009 | Author:

To display the current page at the end of the breadcrumb trail, but not as a link:

  • Install the Menu Breadcrumb add-on.
  • In Administer / Site Configuration / Menu breadcrumb, check the option ‘Append page title to breadcrumb’

To NOT display ‘Home’ at the start of the breadcrumb trail:

  • edit themes//config.php
  • change the phptemplate_breadcrumb function to:

  • function phptemplate_breadcrumb($breadcrumb) {
    unset($breadcrumb[0]);
    array_unshift($breadcrumb, array_shift($breadcrumb) );

    return '<div class="breadcrumb">'. implode(' &raquo; ', $breadcrumb) .'</div>';
    }

Category: CMS  | Tags: , ,  | Leave a Comment
BBC iPlayer: live streaming audio on Firefox on Ubuntu
Wednesday, April 22nd, 2009 | Author:

Archive radio programmes were working but live radio wasn’t on Firefox 3.08 on Ubuntu 8.10. I fixed it as follows:

Close Firefox.
Remove the following packages:

  • totem-gstreamer
  • totem-mozilla

Install the following packages

  • mozilla-mplayer
  • totem-xine

Restart Firefox.

Category: Ubuntu  | Tags: , , , , ,  | Leave a Comment

If the Ruby on Rails mongrel server starts up in development mode but not in production mode, it could be because classes are only loaded when required in development mode, but they are all loaded up front in production mode. So if a class is missing, this will show up straight away in production mode.

As an example, I have an older version of rails running on the server (production mode) than on my laptop (development mode).
The older version of rails requires the application controller to be called
    app/controllers/application.rb
whereas the newer version requires it to be called
    app/controllers/application_controller.rb

In production mode on the server, mongrel was looking for application.rb and couldn’t find it, so fell over immediately. In development mode it started, but would have fallen over later.

How to export a mysql database as a sql file
Wednesday, April 22nd, 2009 | Author:

Run the command:
> mysqldump -u username -p databasename > filename.sql

Category: MySQL  | Tags:  | Leave a Comment
How to vertically align checkboxes in CSS
Tuesday, April 14th, 2009 | Author:

Putting this in the CSS makes checkboxes vertically aligned in Firefox.

input[type=checkbox] {
  vertical-align: middle;
  position: relative;
  /* bottom: 1px; */
}

I haven't tested other browsers yet, but presumably only IE6 might be a problem. And even then, it would only be a minor layout issue, so I'll leave it at that.

I got the answer here, where there is more detailed info about cross-browser solutions:
http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers

Category: CSS  | Tags:  | Leave a Comment
Realplayer on Ubuntu 8.10
Monday, April 13th, 2009 | Author:

To use realplayer for, for example, the BBC iPlayer for radio:

  • Download the deb package
  • Install the deb package
    > sudo dpkg -i realplayer_11.0.0.4028-20080226_i386.deb
    (Use ‘sudo dpkg -i realplayer’ to remove it)
  • Create a link:
    > sudo ln -s /opt/real/Realplayer/realplayer /usr/bin/realplay
Category: Ubuntu  | Tags: ,  | Leave a Comment
Ubuntu update system path
Monday, April 13th, 2009 | Author:

> sudo vi /etc/bash.bashrc

In the file, add or update:
PATH=$PATH:/opt/real/RealPlayer

To start using the new path:
> bash -login

Category: Ubuntu  | Tags: ,  | Leave a Comment

I am now able, in a limited way, to use my external Samsung SyncMaster 215TW with Ubuntu 8.10 running on laptop, using ATI Radeon Mobility UI.

To activate the external monitor:

  • Turn on the external monitor.
  • System / Preferences / Screen Resolution.
  • First time only: Check ‘Show Displays in Panel’.  This means you can just click on the panel icon in future instead of using System / Preferences / Screen Resolution.
  • First time only: Uncheck ‘Mirror Screens’ if it is checked
  • Click on Samsung 21″, and set Resolution to the maximum 1680 x 1050.  Setting a lower resolution causes the external monitor to display only a warning message.
  • IMPORTANT: Click on Laptop 15″, and set Resolution to Off.
  • Click on Apply.

To switch back to the laptop screen, do the reverse.  This may be important if your next use of the laptop is going to be without the monitor.

If at any point, you end up with no display on either laptop or monitor, restart in recovery mode and execute:
> rm ~/.config/monitors.xml

Connecting Zen Sleek to Amarok on Ubuntu
Sunday, April 12th, 2009 | Author:

After installing all the required libraries (libnjb, etc), amarok would not recognise my Creative Zen Sleek MP3 player.

Gnomad2 would connect to it, but only if started with “sudo gnomad2″.

But, I found the issue – user privileges. Here’s how I got it working:

  • System / Administration / Users and Groups
  • Unlock if necessary
  • Select user
  • Properties / User Privileges
  • Check the “Use audio devices” box.  For some reason, this is unchecked by default

Amarok now connects, and gnomad does not need sudo, though I don’t need to use gnomad any more.

Category: Ubuntu  | Tags: , , , , , ,  | Leave a Comment
Ubuntu Intrepid Ibex installation
Friday, April 10th, 2009 | Author:

I have just installed Ubuntu 8.10 on my old Compaq nx9005 laptop.

I started by attempting to upgrade from Hardy Heron.  The result of this was that X no longer worked, so I did a complete re-install. About time, as I’d been doing upgrades since Dapper.  I thought the pain of loads of reconfiguration would be worth it.

Things that work in Intrepid that did not work in Hardy:

  • Compiz desktop effects.  These have never worked on this laptop before, so this was very unexpected and exciting!
  • Connecting to my external monitor, a Samsung SyncMaster 215TW.  Switching between laptop screen and external monitor is still a bit fiddly, but it’s better than no external monitor at all.

Things that do not work in Intrepid that did work in Hardy:

  • Connecting to a Creative Zen Sleek MP3 player using Amarok.
  • BBC iPlayer is very choppy in Ibex.

I’ll be returning to the outstanding problems, and hopefully fixing them, in future posts.

Category: Ubuntu  | Tags: , , , ,  | Leave a Comment