Site Map - skip to main content - dyslexic font - mobile - text - print

Hobby Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


Dave Morriss

Host Image
Host ID: 225

Old Geek, lives in Scotland, writes scripts and stuff for amusement

episodes: 94

hpr2669 :: Additional ancillary Bash tips - 12

Released on 2018-10-25 under a CC-BY-SA license.

Additional ancillary Bash tips - 12

Making decisions in Bash

This is the twelfth episode in the Bash Tips sub-series. It is the fourth of a group of shows about making decisions in Bash.

In the last three episodes we saw the types of test Bash provides, and we looked briefly at some of the commands that use these tests. We looked at conditional expressions and all of the operators Bash provides to do this. We concentrated particularly on string comparisons which use glob and extended glob patterns.

Now we want to look at the other form of string comparison, using regular expressions.

Long notes

I have provided detailed notes as usual for this episode, and these can be viewed here.

hpr2659 :: Further ancillary Bash tips - 11

Released on 2018-10-11 under a CC-BY-SA license.

Further ancillary Bash tips - 11

This is the eleventh episode in the Bash Tips sub-series. It is the third of a group of shows about making decisions in Bash.

In the last two episodes we saw the types of test Bash provides, and we looked briefly at some of the commands that use these tests. Now we want to start examining the expressions that can be used in these tests, and how to combine them. We will also start looking at string comparisons in extended tests.

Long notes

I have provided detailed notes as usual for this episode, and these can be viewed here.

hpr2649 :: More ancillary Bash tips - 10

Released on 2018-09-27 under a CC-BY-SA license.

More ancillary Bash tips - 10

Making decisions in Bash

This is my tenth contribution to the Bash Scripting series under the heading of Bash Tips. The previous episodes are listed below in the Links section.

We are currently looking at decision making in Bash, and in the last episode we examined the tests themselves. In this episode we’ll look at the constructs that use these tests: looping constructs, conditional constructs and lists of commands.

Note: this episode and the preceding one were originally recorded as a single episode, but because it was so long it was split into two. As a consequence the audio contains references to examples such as where the true name is The notes have been updated as necessary but not the audio.

Long notes

I have provided detailed notes as usual for this episode, and these can be viewed here.

hpr2639 :: Some ancillary Bash tips - 9

Released on 2018-09-13 under a CC-BY-SA license.

Some ancillary Bash tips - 9

Making decisions in Bash

This is my ninth contribution to the Bash Scripting series under the heading of Bash Tips. The previous episodes are listed below in the Links section.

It seems to me that it would be worthwhile looking at how Bash can be used to make decisions, such as how many times a loop should cycle (looping constructs) or to choose between multiple choices (conditional constructs). Of course we need to look at some of the expressions used in conjunction with the commands that do these tasks – the tests themselves – and we’ll do this in this episode.

This is a complex area which I had some trouble with when I first started using Bash, and there is a lot to say about it all. I have prepared a group of HPR shows about this subject, in order to do it justice, and this is the first of the group.

Long notes

I have provided detailed notes as usual for this episode, and these can be viewed here.

hpr2610 :: Gnu Awk - Part 12

Released on 2018-08-03 under a CC-BY-SA license.

Gnu Awk - Part 12


This is the twelfth episode of the “Learning Awk” series which is being produced by b-yeezi and myself.

In this episode I want to continue with the subject I started in episode 10, an advanced-level look at arrays in Awk. This episode covers patsplit which can split a string into an array, the built-in array PROCINFO which can be used to control how awk sorts arrays, as well as asort and asorti, built-in functions for sorting arrays.

In case it might be of interest I have also included a section describing a recent use I made of awk to solve a problem.

Long notes

I have provided detailed notes as usual for this episode, and these can be viewed here.

hpr2596 :: Battling with English - part 2

Released on 2018-07-16 under a CC-BY-SA license.

Battling with English - part 2

Further notes about 'then' and 'than'

In the last episode I mentioned the confusion between then and than. I referred to the etymology of the two words, but I didn't go into detail.

Reading the Online Etymology Dictionary, one interesting point in the page about than is that it was:

Developed from the adverb then, and not distinguished from it by spelling until c. 1700.

So, it would seem that the two words are related and historically were the same! However, I'd guess that it is unlikely that people using them interchangeably now are making reference to usage in the 1700's.

Problems with apostrophes

Let us now examine the apostrophe, which is a punctuation mark. It is used for:

  • Indicating that letters have been omitted, such as in a contracted form of words. For example when the phrase they are is contracted to they're.

  • Turning a word into a possessive form such as in the cat's paw

  • When the plural of a single letter (or digit) is required such as in dot your i's and cross your t's.

There are other uses but you can look at the Wikipedia article for them if you want to dig deeper. I may well revisit this topic in a later show in this series.

Long notes

I have provided detailed notes as usual, and these can be viewed here.

hpr2581 :: My new 3D printer - impressions of the Creality Ender 3

Released on 2018-06-25 under a CC-BY-SA license.

My new 3D printer - impressions of the Creality Ender 3


I have been thinking of buying a 3D printer for a year or so. I had thought of getting a Prusa i3 MK3 in kit form, but although it's cheaper than the built form this printer is not cheap, and I doubted my ability to build it. I was also unsure whether there was a real need for the capabilities of a 3D printer in my life, and whether such a purchase was justified.

I had noticed the Chinese Creality CR10 printer in the recent past, and wondered about buying one of these at about half the price of the Prusa. This is a good-sized printer which comes fully-assembled as I understand, and it has had many good reviews.

When the Creality Ender 3 was released in April 2018 for around half the price of the CR10 it looked worth the risk to see if I really needed a 3D printer. So I bought one (from Amazon) in June.

As I write this (2018-06-10) it's been less than a week since it was delivered, so this is a very preliminary look at the printer.

Long notes

For the rest of the notes for this episode look here.

hpr2558 :: Battling with English - part 1

Released on 2018-05-23 under a CC-BY-SA license.

Battling with English - part 1


This is the first episode of a series about the English language. In it I want to look at some of the problems people (including myself) have with it. I plan to do several episodes and I want to keep them short.

The English language is old and has changed – evolved – in many ways over the years. It has come from a multitude of sources, and it's difficult to say what is correct in an absolute way.

For example, when I was at school we were taught that "nice" should not be used in written material. At that time it was becoming common to see phrases like "I had a nice time" meaning pleasant (in a bland sort of way). In my "Concise Oxford Dictionary" from 1976 the 6th definition, "agreeable" is marked "colloquialism", whereas today this is a common usage.

However, it's easy to use the wrong word in the wrong context. You might choose one that sounds similar for example. You might also have problems with the spelling of a chosen word. Spelling in English is not always logical. You might also find yourself confused about the use of punctuation – the correct use of apostrophes can be challenging for example.

In this series I want to examine some of the problem areas and try to give you the means of remembering the right way.

Note: I'm not an authority on this stuff, but I have tried to teach myself not to make these mistakes over the years. I just wanted to share what I have learnt1 with some links to higher authorities.

Long notes

I have provided detailed notes as usual, and these can be viewed here.

  1. One thing I have learnt is that "learned" and "learnt" are both correct and mean the same. However, "learnt" is more common in the UK, whereas "learned" is used both in the UK and the USA.

hpr2544 :: How I prepared episode 2493: YouTube Subscriptions - update

Released on 2018-05-03 under a CC-BY-SA license.

How I prepared episode 2493: YouTube Subscriptions - update


In show 2493 I listed a number of the YouTube channels I watch. Some of what I did to prepare the notes was to cut and paste information from YouTube pages, but the basic list itself was generated programmatically. I thought the process I used might be of interest to somebody so I am describing it here.


I needed four components to achieve what I wanted:

I will talk a little about the first three components in this episode in order to provide an overview.

Full-length notes

The full-length notes (available here) contain details of the processes involved in building the list of channels.

hpr2526 :: Gnu Awk - Part 10

Released on 2018-04-09 under a CC-BY-SA license.

Gnu Awk - Part 10


This is the tenth episode of the "Learning Awk" series which is being produced by b-yeezi and myself.

In this episode I want to talk more about the use of arrays in GNU Awk and then I want to examine some real-world examples of the use of awk.

Long notes

The notes for rest of this episode are available here.

hpr2505 :: The power of GNU Readline - part 3

Released on 2018-03-09 under a CC-BY-SA license.

The power of GNU Readline - part 3

In part 2 we looked at deleting text in various ways and pasting it back, using GNU Readline key sequences.

The full-length notes (available here) contain some new terms and features of GNU Readline, and introduce some further ways of manipulating text, with some examples.

hpr2496 :: Making a Raspberry Pi inventory

Released on 2018-02-26 under a CC-BY-SA license.

Making a Raspberry Pi inventory


I have a number of Raspberry Pis -- possibly too many -- and I sometimes lose track of which is which, what model, size, name, address each one is. I wanted to be able to keep an inventory of them all, and to this end I wrote myself a little script that can be run on any Pi which will report useful information about it.

Every Pi has a unique serial number. Actually it's randomly generated so there may be a few collisions but it's close to unique! It also contains a revision number which encodes various items of information about it such as release date, model, PCB revision and memory. My script decodes this revision number for you based on a published table.

I run a Wikimedia instance on a Pi and have used this script to record details of my Pis there as well as what they are being used for and any planned projects. I now feel more organised!

Long notes

The full-length notes (available here) contain a listing of the script, a brief description of it, and some example output.

hpr2493 :: YouTube Subscriptions - update

Released on 2018-02-21 under a CC-BY-SA license.

YouTube Subscriptions - update


I reported on some of my YouTube subscriptions in show 2202, where I concentrated on the various Maker channels I subscribe to.

Since then I have added a few more such channels, but this time I also want to talk about some of the others I subscribe to.

YouTube Channels

  1. Anne of All Trades
  2. bigclivedotcom
  3. Computerphile
  4. David Waelder
  5. EvanAndKatelyn
  6. ExplainingComputers
  7. HomeMadeModern
  8. izzy swan
  9. Jackman Works
  10. mugumogu
  11. Pask Makes
  12. Phil Pinsky Productions
  13. RetroWeld
  14. Thomas Sanladerer
  15. tim sway
  16. Unemployed Redneck Hillbilly Creations
  17. William Lutes
  18. Wintergatan

Long notes

I have another version of the above channel list in the long notes with more details and with some of my observations.

hpr2483 :: Useful Bash functions - part 4

Released on 2018-02-07 under a CC-BY-SA license.

Useful Bash functions - part 4


This is the fourth show about the Bash functions I use, and it may be the last unless I come up with something else that I think might be of general interest.

There is only one function to look at this time, but it's fairly complex so needs an entire episode devoted to it.

As before it would be interesting to receive feedback on this function and would be great if other Bash users contributed ideas of their own.

Full Notes

Since the notes explaining this subject are long, they have been placed here.

hpr2469 :: A flight itinerary in Bash

Released on 2018-01-18 under a CC-BY-SA license.

A flight itinerary in Bash

My daughter flew out to New Zealand before Christmas 2017 to spend some time with her brother, who had been there with his girlfriend since November. I saw her flight itinerary from the airline, but had no idea of how the times related to time back home, so I wrote a little Bash script to calculate times in UTC (my local timezone).

Both of my children have travelled a fair bit in the past few years. I like to keep track of where they are and how they are progressing through their journeys because otherwise I tend to worry. This one was a reasonably simple journey, two flights via Doha in Qatar, with not too long a wait between them. The overall journey was long of course.

When my daughter flew out to Indonesia in 2015 (4 flights and a boat trip, over 38 hours travel time) I built a spreadsheet. Just whatever provides a good distraction!

The rest of the notes, including details of the date command and the script I wrote can be found here.

  • GNU documentation for date (You can also use man date or info date for the full details. I prefer the HTML version because I don't like the info tool very much).
  • The GNU Bash Reference Manual
  • Dann Wasko's "Linux in the Shell" episode hpr1182 :: LiTS 023: Date, which is full of useful information.
  • Resources:
    • The script I wrote, called edi_akl (named to denote the starting and ending airports).

hpr2453 :: The power of GNU Readline - part 2

Released on 2017-12-27 under a CC-BY-SA license.

The power of GNU Readline - part 2

In part 1 we looked at some Control key and Meta key sequences as well as the Backspace and DEL keys in the context of GNU Readline.

The full-length notes (available here) contain a brief summary of what we covered and introduce cutting and pasting the GNU Readline way, with some examples.

hpr2448 :: Useful Bash functions - part 3

Released on 2017-12-20 under a CC-BY-SA license.

Useful Bash functions - part 3


This is the third show about Bash functions. These are a little more advanced than in the earlier shows, and I thought I'd share them in case they are useful to anyone.

As before it would be interesting to receive feedback on these functions and would be great if other Bash users contributed ideas of their own.

Full Notes

Since the notes explaining this subject are long, they have been placed here.

hpr2443 :: pdmenu

Released on 2017-12-13 under a CC-BY-SA license.



Pdmenu is a tool written by Joey Hess which allows the creation of a simple menu in a terminal (console) window. It is in his list of less active projects, and the latest version is dated 2014, but it seems to be quite complete and useful as it is.

I like simple menus. As a Sysadmin in my last job I used one on OpenVMS which helped me run the various periodic tasks I needed to run - especially the less frequent ones - without having to remember all of the details.

I do the same on my various Linux systems, and find that pdmenu is ideal for the task.


I found pdmenu in the Debian repositories (I run Debian Testing), and it was very easily installed. The C source is available as a tarfile, though I haven't tried building it myself.

Running pdmenu

Simply typing pdmenu at a command prompt will invoke the utility. It uses the file /etc/pdmenurc as its default configuration file, and this generates a menu with a demonstration of some of its features.

This is not particularly useful but it can be overridden by creating your own configuration, which by default is in ~/.pdmenurc. The pdmenu command itself takes a configuration file as an argument, so there is plenty of flexibility.

Full notes and examples

The full notes which describe the use of pdmenu with examples can be found here.

hpr2438 :: Gnu Awk - Part 8

Released on 2017-12-06 under a CC-BY-SA license.

Gnu Awk - Part 8


This is the eighth episode of the "Learning Awk" series that b-yeezi and I are doing.

Recap of the last episode

  • The while loop: tests a condition and performs commands while the test returns true

  • The do while loop: performs commands after the do, then tests afterwards, repeating the commands while the test is true.

  • The for loop (type 1): initialises a variable, performs a test, and increments the variable all together, performing commands while the test is true.

  • The for loop (type 2): sets a variable to successive indices of an array, preforming a collection of commands for each index.

These types of loops were demonstrated by examples in the last episode.

Note that the example for 'do while' was an infinite loop (perhaps as a test of the alertness of the audience!):

#!/usr/bin/awk -f

    do {
        print "The square of ", i, " is ", i*i;
        i = i + 1
    while (i != 2)


The condition in the while is always true:

The square of  2  is  4
The square of  3  is  9
The square of  4  is  16
The square of  5  is  25
The square of  6  is  36
The square of  7  is  49
The square of  8  is  64
The square of  9  is  81
The square of  10  is  100
The square of  1269630  is  1611960336900
The square of  1269631  is  1611962876161
The square of  1269632  is  1611965415424
The square of  1269633  is  1611967954689
The square of  1269634  is  1611970493956

The variable i is set to 2, the print is executed, then i is set to 3. The test "i != 2" is true and will be ad infinitum.

Some more statements

We will come back to loops later in this episode, but first this seems like a good point to describe another statement: the switch statement.

Long notes

The notes for rest of this episode are available here.

hpr2397 :: The Urban Astronomer

Released on 2017-10-10 under a CC-BY-SA license.

The Urban Astronomer

I'm interested in Astronomy and listen to a number of Astronomy podcasts. I have listed a few of these in the past when doing HPR shows about the podcast feeds I subscribe to (shows 1516, 1518 and 2339).

One of the recent additions to my podcast list that I have been listening to this year is called "The Urban Astronomer", which has a website here and a podcast feed here. The site and podcast are run by Allen Versfeld, who is based in South Africa.

To quote from the website:

Allen is an amateur astronomer, an IT professional, a podcaster, a father of five beautiful kids and a barely competent chess player. He is also the director of the Astrophotography Section of the Astronomical Society of South Africa, where he coordinates and promotes the activities of people who are far better photographers than him.

I have been enjoying Allen's episodes a lot. There are some great interviews with some very interesting people in the world of Astronomy. Allen has a relaxed interviewing style which I find appealing.

I wrote to him, commenting on one of his episodes, and I mentioned Hacker Public Radio in my email. He has subscribed to HPR and has been kind enough to mention it on a recent podcast. I'm offering you a chance to listen to one of his episodes here.

The episode is number 12 of "The Urban Astronomer", from June 16, 2017. It is an interview with Jen Millard, a first year Astronomy PhD student at Cardiff University in the UK. Jen is also a host on the "Awesome Astronomy" podcast, as mentioned in the episode.

I hope you enjoy listening to this example episode.

hpr2363 :: Cancelling my TV licence

Released on 2017-08-23 under a CC-BY-SA license.

Cancelling my TV licence

I get a letter

In July 2017 I received a letter from the TV Licensing organisation telling me they'd be taking £147 from my account on the 1st of August. I had set up a "Direct Debit" arrangement with my bank many years before which allowed them to do this, and had forgotten all about it.

When my kids were small, and later in their teens, a lot of TV was watched in my house. We used to watch all the over the air channels, and when things started to move towards digital in the UK I bought a PVR (aka DVR) which converted the Freeview channels into a signal for my analogue TV, and also recorded stuff on demand.

I watched some TV after I retired in 2009, but by 2013 with my kids having left home (to all intents and purposes), and the quality of what was available having fallen to a record low, I stopped.

When this letter arrived I realised I'd been paying for this licence to watch TV for several years without using it.

I throw out my TV

The old analogue, CRT TV sitting in the corner of my room (and the associated Freeview PVR) had not been turned on for 4 years, so it was time for them to go. So I took my TV to the recycling centre with the help of my son. The PVR will be hacked for useful components.

I cancel my licence

Next step was to stop paying this annual licence. The letter told me what to do. I discovered I fulfilled all the requirements listed there:

  • I never watch or record programmes as they are being shown on TV
  • I never download or watch BBC programmes on demand
  • I don't do this on a TV, desktop computer, laptop, mobile phone, tablet, games console, digital box or DVD/VHS recorder.

I called the number on the back of the letter and cancelled.

The guy I spoke to said I'd get a letter of confirmation soon. I asked if they'd cancel the Direct Debit or whether I should. He advised me to cancel myself, so I did it immediately.

I get my confirmation letter

A number of days later I received a letter entitled (rather oddly) "Your No Licence Needed confirmation". It told me my no licence was valid from July 2017 and expired July 2019.

The letter did point out that I might receive a visit to "confirm that a licence isn't needed".

A friendly leaflet accompanying the letter contained the question and answer:

Can I be prosecuted for watching BBC programmes on BBC iPlayer without a licence?

Yes. From 1 September 2016, you risk prosecution and a fine of up to £1,000 plus any legal costs and/or compensation you may be ordered to pay.

I get an urgent letter from TV Licensing

On the 12th August I received a letter from TV Licensing which asked me to call them urgently because my bank had declined a Direct Debit payment request.

I called on the 14th August and was told that this was a mistake and the letter could be ignored.

However, to get this answer I had to navigate 4 menus and give my details to a robot. Of course the person I eventually contacted asked for the details all over again! This made me wonder if the robot is there for any purpose other than to be a deterrent to callers. The same goes for the 4 menus.

I get a phone call from TV Licensing

On 17th August I found a message on my answering machine asking me to call TV Licensing. I did so, and navigated the 4 menus again. This time the robot asked for my licence number, but since I reasoned I didn't have one I gave it the reference number of my no licence. That didn't work.

It then asked for my postcode, street name, house number and payment details. It confirmed the address stuff but when I said I didn't pay for a licence it passed me to a human.

The lady I was speaking to then asked for my name, address, postcode, etc. I asked why I was being asked for this again having just given it to a robot. Apparently these weren't passed through because I "failed" to answer all the questions properly. That's odd because the same happened last time when I got the questions "right"!

This time it turned out that the problem was that my no licence had been cancelled. No reason was given.

I asked why, if a thing I had carefully set up with the expectation of it remaining in place for 2 years had been cancelled, I hadn't been notified. I didn't get an answer.


It seems that TV Licensing has one of the worst systems for managing its "customers" on the planet. I told the representative that this was my opinion while I was on the phone.

I'm wondering what's next in the saga. Will it be the "heavies" at the door (I'm not obliged to let them in without a warrant, I discovered), a legendary TV Detector van outside my house (I'd like to see one and take a picture of it), another spurious money demand or unexplained loss of my details?

However, although it has been bad, this story did give me something to write and talk about for HPR so it's not all bad!

hpr2348 :: Vim Hints 005

Released on 2017-08-02 under a CC-BY-SA license.

Vim Hints 005

Vim Hints is back!

Oops! Where did half of 2015, all of 2016 and the first half of 2017 go?

Well, life got in the way, plus motivation dwindled somewhat. This series is very demanding - the sed series was a walk in the park compared to tackling the continental-scale landscape of Vim!

Still, the original goal was to try and introduce the really useful features of Vim and to make it manageable for everyday use. The hope was, and still is, that the series could get people started on their own journeys through its marvels.

Also, with the currently circulating StackOverflow article on "How to exit the Vim editor?", it's worth pointing out that we dealt with that subject in episode 1, and this issue is revealed as the ridiculous meme that it really is!

Quick recap

To recap, the last episode of this planned series was in March 2015. Here's a list of links to all of the episodes so far:

Let's briefly describe what was covered in these episodes to set the context.

So far we have looked at very basic editing in episode 1, where we mentioned modes Normal, Insert and Command modes.

In episode 2 we looked at Vim's backup mechanism, undoing and redoing changes, and file recovery in the event of a problem. We started using the .vimrc configuration file.

We began looking at movement commands in Normal mode in episode 3, and beefed up the configuration file somewhat.

More movement commands were covered in episode 4 as well as searching. We began looking at commands that make changes, adding, inserting, deleting and changing text in various ways. The concept of doing these things with various movements was covered. Again, a number of useful options for the configuration file were introduced.

Full Notes

Since the notes explaining this subject are particularly long, they have been placed here: and an ePub version is also available here:

  1. Stack Overflow: Helping One Million Developers Exit Vim
  2. Vim Help:
  3. Previous episode: "Vim Hints Episode 4"
  4. Resources:

hpr2339 :: Podcast list additions

Released on 2017-07-20 under a CC-BY-SA license.

Podcast list additions

I did two HPR shows 1516 and 1518 in 2014 about the podcast feeds I'm subscribed to. I have made a few additions since then (and a few subtractions) and I thought I'd share a few of the additions.

The list below shows the feed titles. Clicking on them will take you to the full notes where you can examine the details of the feed.

  1. The World of Business
  2. Criminal
  3. Seriously...
  4. Start the Week
  5. Dan Carlin's Hardcore History
  6. The Verb
  7. Making It With Jimmy Diresta, Bob Clagett and David Picciuto
  8. Reclaimed Audio Podcast
  9. The Bugcast - Ogg Feed
  10. Open Country
  11. Common Sense with Dan Carlin
  12. Philosophy Bites
  13. All in the Mind
  14. BacterioFiles
  15. podcast (en) – omega tau science & engineering podcast
  16. This Week in Evolution
  17. This Week in Microbiology
  18. Urban Agriculture
  19. Weekly Space Hangout Audio
  20. Edinburgh Skeptics Presents...
  21. Exposing PseudoAstronomy
  22. The Pen Addict
  23. Late Night Linux (Ogg)
  24. systemau - OGG
  25. The Changelog
  26. The Duffercast Ogg
  27. The Full Circle Weekly News
  28. The JaK Attack! podcast


hpr2329 :: Building a Digital Clock Kit

Released on 2017-07-06 under a CC-BY-SA license.

Building a Digital Clock Kit


In April 2017 my son and I decided to each build a digital clock. I had been interested in the idea since seeing Big Clive build one on YouTube, and I think my son had been similarly motivated.

He found one, which I have linked to below. It's smaller than the one shown by Big Clive, comes from ShenZhen China, and costs $5.35 (about £4.18) postage free. It takes a long time to arrive, so patience is needed!

There are many digital clock kits on eBay, and lots of YouTube videos showing how to build them. I think it's a great project for someone wanting some soldering practice which is a little more demanding than a beginner project.

One type to avoid, I think, is the surface mount type. The one I have uses a through-hole PCB, but I have seen some that provide SMD (surface-mounted device) components. That type of soldering is beyond me at the moment (though my son has been teaching himself to do it).

Long notes

I have provided detailed notes detailing the unpacking and building of this device, with photographs. These are available here.

hpr2317 :: Bash snippet - extglob and scp

Released on 2017-06-20 under a CC-BY-SA license.

Bash snippet - extglob and scp

The Problem

Following on from my last show on filename expansion, concentrating on extended patterns and the extglob option, I was asked a question by Jon Kulp in the comment section.

Jon was using ls *(*.mp3|*.ogg) to find all OGG and MP3 files in a directory which also held other files. However, when he wanted to copy this subset of files elsewhere he had problems using this expression in an scp command.

Having done some investigations to help solve this I thought I'd put what I found into an HPR episode and share it, and this is the show.

Along the way clacke commented too and this led me to more investigations!

Long notes

As often happens, my idea of a brief episode turned into something much longer, so I converted the notes into long notes which you can find here. In them I have marked some sections which you might want to skip over -- unless you are as much of a geek as I am! I have not covered these sections in detail in the audio.

hpr2302 :: Bash snippet - nullglob

Released on 2017-05-30 under a CC-BY-SA license.

Bash snippet - nullglob

I recently did an HPR show about Bash filename expansion and described the 'shopt' command and its options. One of the options I talked about was 'nullglob' which controls what is returned from an expansion when no files match.

When 'nullglob' is enabled, and a pattern does not match, nothing is returned. When it is disabled (the default) then the pattern itself is returned.

Although I didn't think I'd ever need to, I recently wrote a script where I used 'nullglob', and thought I would share a snippet of the code to demonstrate what I did.

The script is for managing mail messages containing tag and summary updates. I use Thunderbird for my mail and have configured it to drop these messages into a directory so I can process them. I use Thunderbird's message filters to do this. A certain amount of Spam is also received, and sometimes valid messages need a bit of work before they can be processed.

The directory where the messages are saved (the spool area) is stored in the variable 'MAILDROP' earlier in the script.

  1 #
  2 # Find the files and store their names in an array. Use 'nullglob' so we get
  3 # nothing when there is nothing, then revert to the original setting
  4 #
  5 NG="$(shopt -p nullglob)"
  6 shopt -s nullglob
  7 MESSAGES=( $MAILDROP/*.eml )
  8 eval "$NG"
 10 #
 11 # Exit if there's nothing to do or report what's there
 12 #
 13 if [[ ${#MESSAGES[@]} -gt 0 ]]; then
 14     echo "Files in the spool area:"
 15     printf "%s\n" "${MESSAGES[@]}"
 16 else
 17     echo "The spool area is empty"
 18     exit
 19 fi

The variable 'NG' holds the state of 'nullglob' before the script modifies it. Remember that 'shopt -p' returns a list of commands that will revert the named options to their current state.

Next (line 6) the 'nullglob' option is enabled.

The array 'MESSAGES' is created on line 7 to hold the list of mail files found in the spool area. This is done with a pattern which matches files that end with the string '.eml'. If we didn't have 'nullglob' enabled then when there were no files the array would contain the pattern - which would be misleading.

Having collected the file details 'nullglob' is turned off by executing the command in the variable 'NG' on line 8.

You might think that the script could just turn 'nullglob' on then turn it off again when it's no longer needed. However, I prefer to use the technique I have shown here because it needs to have no knowledge of the state of the option before it's set, and restores that state afterwards.

By line 13 the array 'MESSAGES' either contains a list of files or is empty. The script checks for these two cases by determining how many elements are in the array. Greater than zero means we have files to process and they are listed in lines 14 and 15. The script then goes on to do various things with the files.

If there were no files then the script reports this and exits.

That's it! This is not the only way to do this, but I like to write scripts that call as few sub-processes as I can, and this way appeals for that reason.

hpr2297 :: More Magnatune Favourites

Released on 2017-05-23 under a CC-BY-SA license.

More Magnatune Favourites

After nearly two years Andrew (@mcnalu) and Dave have prepared another show of some of their favourite music from Magnatune for your pleasure.

hpr2293 :: More supplementary Bash tips

Released on 2017-05-17 under a CC-BY-SA license.

More supplementary Bash tips

Pathname expansion; part 2 of 2


As we saw in the last episode 2278 (and others in this sub-series) there are eight types of expansion applied to the command line in the following order:

  • Brace expansion (we looked at this subject in episode 1884)
  • Tilde expansion (seen in episode 1903)
  • Parameter and variable expansion (this was covered in episode 1648)
  • Command substitution (seen in episode 1903)
  • Arithmetic expansion (seen in episode 1951)
  • Process substitution (seen in episode 2045)
  • Word splitting (seen in episode 2045)
  • Pathname expansion (the previous episode 2278 and this one)

This is the last topic in the (sub-) series about expansion in Bash.

In this episode we will look at extended pattern matching as also defined in the “Manual Page Extracts” section at the end of the long notes.

Long Show Notes

I have written out a moderately long set of notes about this subject and these are available here.

hpr2278 :: Some supplementary Bash tips

Released on 2017-04-26 under a CC-BY-SA license.

Some supplementary Bash tips

Pathname expansion; part 1 of 2


As we saw in the last episode 2045 (and others in this sub-series) there are eight types of expansion applied to the command line in the following order:

  • Brace expansion (we looked at this subject in episode 1884)
  • Tilde expansion (seen in episode 1903)
  • Parameter and variable expansion (this was covered in episode 1648)
  • Command substitution (seen in episode 1903)
  • Arithmetic expansion (seen in episode 1951)
  • Process substitution (seen in episode 2045)
  • Word splitting (seen in episode 2045)
  • Pathname expansion (this episode and the next)

This is the last topic in the (sub-) series about expansion in Bash. However, when writing the notes for this episode it became apparent that there was too much to fit into a single HPR episode. Consequently I have made it into two.

In this episode we will look at simple pathname expansion and some of the ways in which its behaviour can be controlled. In the next episode we’ll finish by looking at extended pattern matching. Both are included in the “Manual Page Extracts” section at the end of the long notes.

Long Show Notes

I have written out a moderately long set of notes about this subject and these are available here.

hpr2270 :: Managing tags on HPR episodes - 3

Released on 2017-04-14 under a CC-BY-SA license.

Managing tags on HPR episodes - 3


This is the third (and last) show looking at the subject of Managing Tags relating to HPR shows.

In the first show we looked at why we need tags, and examined the advantages and disadvantages of the present system of storage. We considered the drawbacks of this design when searching the tags.

Then in the second show we looked at a simple way of making a tags table and how to query it in order to fulfil the requirements defined in the first show.

In this show we’ll look at a more rigorous, efficient, “normalised” solution.

Long notes

I have written out a set of longer notes for this episode and these are available here.

hpr2260 :: Managing tags on HPR episodes - 2

Released on 2017-03-31 under a CC-BY-SA license.

Managing tags on HPR episodes - 2


This is the second show looking at the subject of Managing Tags.

In the first show we looked at why we need tags, examined the present system and considered its advantages and disadvantages.

In this episode we will look at a solution using a separate table of tags.

Long notes

This is a detailed subject so I have written out a set of longer notes for this episode and these are available here.

hpr2255 :: The Good Ship HPR

Released on 2017-03-24 under a CC-BY-SA license.

The Good Ship HPR

Hacker Public Radio

What is it?

The podcast called Hacker Public Radio (HPR) is an amazing phenomenon. It has been providing an episode a day every weekday for years, and these episodes originate from the community.

I heard someone refer to HPR as “Crowd Sourced” which seemed like a good way of describing things. It is an open access resource which is managed under various Creative Commons licences, usually CC-BY-SA.

The content is very broad in scope. Anything “of interest to Hackers” is acceptable, which is interpreted in a wide variety of ways.

Access to shows is open to all through the HPR site, where shows back to episode 1 can be browsed, notes read, etc. There are feeds which propagate various updates: to shows, series, comments and email. Current shows are archived to the Internet Archive ( within a few days of appearing in the main feed, and older shows are gradually being archived this way with the intention of eventually storing everything there.

For example, to find show 1999 on look for The entire HPR collection can be browsed at

Some history

As you can see, if you examine the details on the website statistics page the predecessor of HPR started more than 11 years ago as “Today With A Techie”, transforming into “Hacker Public Radio” over 9 years ago.

Started:            11 years, 4 months, 12 days ago (2005-10-10)
Renamed HPR:        9 years, 1 months, 20 days ago (2007-12-31)

In the earlier days the frequency of show release was not the predictable 5 per week, every weekday, that it is now. There were gaps, sometimes of several days, and occasionally shows came out on the weekend. Stability was achieved in October 2012 and there have been no gaps since then!

There are currently 280 hosts who have contributed shows at some point in the history of HPR, and at the time of writing in February 2017 show number 2230 has been released. The number of episodes and hosts will be greater when the episodes from “Today With A Techie” are incorporated into the archive.

The Hacker Public Radio experiment has been very successful over the years, but there is a certain fragility in the way it works.

Long notes

The longer notes for this episode which are available here, talk about the details of the problem facing HPR and go on to suggest some solutions.

hpr2245 :: Managing tags on HPR episodes - 1

Released on 2017-03-10 under a CC-BY-SA license.

Managing tags on HPR episodes - 1


We have been collecting and storing tags for new HPR shows for a while now with the intention of eventually offering a search interface. In addition, a number of contributors, including myself have been adding tags (and summaries), to shows that do not have them, since August 2015. There is still a way to go, but we’re making progress. At the time of writing (2017-01-31) 56.29% (1248) of all HPR shows (2217) have tags.

In recent times the way in which we should use these tags has been discussed. In show 2035 on 2016-05-20 droops suggested:

The website, which is a lot of work, needs to have related shows listed on each individual show’s page. This will take a tag system and someone to tag all of the almost uncountable previous episodes.

This episode begins a discussion about some of the ways that tags can be stored, managed and accessed efficiently in the HPR database.

I started planning a show about this subject in the summer of 2016, and the amount of information I have accumulated has grown since then. There is now quite a lot, so I am going to split what was originally going to be one show into three.

The subject becomes quite technical in the later shows, discussing database design techniques, and all three of the shows contain examples of database queries and scripts. If you are not interested in this subject than feel free to skip past. However, you might find this first episode more palatable, and any thoughts you might have on the subject would be appreciated.

Long notes

I have written out a set of longer notes for this episode and these are available here.

hpr2238 :: Gnu Awk - Part 6

Released on 2017-03-01 under a CC-BY-SA license.

Gnu Awk - Part 6


This is the sixth episode of the “Learning Awk” series that b-yeezi and I are doing.

Recap of the last episode

Regular expressions

In the last episode we saw regular expressions in the ‘pattern’ part of a ‘pattern {action}’ sequence. Such a sequence is called a ‘RULE’, (as we have seen in earlier episodes).

$1 ~ /p[elu]/ {print $0}

Meaning: If field 1 contains a ‘p’ followed by one of ‘e’, ‘l’ or ‘u’ print the whole line.

$2 ~ /e{2}/ {print $0}

Meaning: If field 2 contains two instances of letter ‘e’ in sequence, print the whole line.

It is usual to enclose the regular expression in slashes, which make it a regexp constant.

We had a look at many of the operators used in regular expressions in episode 5. Unfortunately, some small errors crept into the list of operators mentioned in that episode. These are incorrect:

  • \A (beginning of a string)
  • \z (end of a string)
  • \b (on a word boundary)

The first two operators exist, in languages like Perl and Ruby, but not in GNU Awk.

For the ‘\b’ sequence the GNU manual says:

In other GNU software, the word-boundary operator is ‘\b’. However, that conflicts with the awk language’s definition of ‘\b’ as backspace, so gawk uses a different letter. An alternative method would have been to require two backslashes in the GNU operators, but this was deemed too confusing. The current method of using ‘\y’ for the GNU ‘\b’ appears to be the lesser of two evils.

The corrected list of operators is discussed later in this episode.


Last episode we saw the built-in functions that use regular expressions for manipulating strings. These are sub, gsub and gensub. Regular expressions are used in other functions but we will look at them later.

We will be looking at sub, gsub and gensub in more detail in this episode.

Long notes

I have written out a set of longer notes for this episode and these are available here.

hpr2211 :: My podcast workflow

Released on 2017-01-23 under a CC-BY-SA license.

My podcast workflow

I have been listening to podcasts for many years. I started in 2005, when I bought my first MP3 player.

Various podcast downloaders (or podcatchers) have existed over this time, some of which I have tried. Now I use a script based on Bashpodder, which I have built to meet my needs. I also use a database to hold details of the feeds I subscribe to, what episodes have been downloaded, what is on a player to be listened to and what can be deleted. I have written many scripts (in Bash, Perl and Python) to manage all of this, and I will be describing the overall workflow in this episode without going into too much detail.

I was prompted to put together this show by folky’s HPR episode 1992 “How I’m handling my podcast-subscriptions and -listening. Thanks to him for a very interesting episode.

Refer to the full notes for the details:

hpr2202 :: Makers on YouTube

Released on 2017-01-10 under a CC-BY-SA license.

Makers on YouTube


I have always enjoyed making stuff. I was born and brought up in the 1940’s and 1950’s when the UK was recovering from WW2, and in my experience everyone I knew repaired and made stuff. Most of them grew their own food as well.

I have never been particularly good at making stuff, but I have built some basic furniture, built storage solutions for the house, built a rabbit hutch and run for my children’s pets, and so on and so forth.

In high school, even though I went to a Grammar School, all boys attended mandatory lessons on metalwork and woodwork. We learnt how to use hand tools and some power tools, make joints in wood, we also learnt to do basic metal work like soldering and brazing, and so forth.

Learning this stuff at school was great but I have used the woodworking techniques more than the metalwork - other than soldering.

I stopped watching TV in 2013, preferring reading and listening to podcasts. In recent times I have subscribed to a number of YouTube channels which share woodworking and metalworking techniques and projects. In general these people are Makers and Artists who can turn their hands to many skills. I thought I would share some of my favourites via HPR.

Long notes

I have written out a moderately long set of notes for this episode and these are available here

hpr2173 :: Driving a Blinkt! as an IoT device

Released on 2016-11-30 under a CC-BY-SA license.

Driving a Blinkt! as an IoT device


I managed to buy a Raspberry Pi Zero when they first came out in December 2015. This was not easy since they were very scarce. I also bought a first-generation case from Pimoroni and some 40-pin headers. With the Zero this header is not pre-installed and it’s necessary to solder it onto the Pi yourself.

I have had various project ideas for this Pi Zero, but had not decided on one until recently. Within the last month or two Pimoroni produced a device called the Blinkt! which has eight APA102 RGB LEDs and attaches to the GPIO header. This costs £5, just a little more than the Zero itself.

My plan was to combine the two and turn them into a status indicator for various things going on that needed my attention.

Long notes

I have written out a moderately long set of notes for this episode and these are available here

hpr2166 :: How to use a Slide Rule

Released on 2016-11-21 under a CC-BY-SA license.

How to use a Slide Rule

In my show 1664, “Life and Times of a Geek part 1”, I spoke about using a slide rule as a schoolboy. As a consequence, I was asked if I would do a show on slide rules, and this is it (after a rather long delay).

Long notes

I have written out a moderately long set of notes for this episode and these are available here

hpr2163 :: Gnu Awk - Part 4

Released on 2016-11-16 under a CC-BY-SA license.

Gnu Awk - Part 4


This is the fourth episode of the series that b-yeezi and I are doing. These shows are now collected under the series title “Learning Awk”.

Recap of the last episode

Logical Operators

We have seen the operators ‘&&’ (and) and ‘||’ (or). These are also called Boolean Operators. There is also one more operator ‘!’ (not) which we haven’t yet encountered. These operators allow the construction of Boolean expressions which may be quite complex.

If you are used to programming you will expect these operators to have a precedence, just like operators in arithmetic do. We will deal with this subject in more detail later since it is relevant not only in patterns but also in other parts of an Awk program.

The next statement

We saw this statement in the last episode and learned that it causes the processing of the current input record to stop. No more patterns are tested against this record and no more actions in the current rule are executed. Note that “next” is a statement like “print”, and can only occur in the action part of a rule. It is also not permitted in BEGIN or END rules (more of which anon).

The BEGIN and END rules

The BEGIN and END elements are special patterns, which in conjunction with actions enclosed in curly brackets make up rules in the same sense that the ‘pattern {action}’ sequences we have seen so far are rules. As we saw in the last episode, BEGIN rules are run before the main ‘pattern {action}’ rules are processed and the input file is (or files are) read, whereas END rules run after the input files have been processed.

It is permitted to write more than one BEGIN rule and more than one END rule. These are just concatenated together in the order they are encountered by Awk.

Awk will complain if either BEGIN or END is not followed by an action since this is meaningless.

Variables, arrays, loops, etc

Learning a programming language is never a linear process, and sometimes reference is made to new features that have not yet been explained. A number of new features were mentioned in passing in the last episode, and we will look at these in more detail in this episode.

Long notes

I have written out a moderately long set of notes for this episode and these are available here

With a view to making portable notes for this series I have included ePub and PDF versions with this episode. Feedback is welcome to help decide which version is preferable, as are any suggestions on the improvement of the layout.

hpr2135 :: Audio speedup script

Released on 2016-10-07 under a CC-BY-SA license.

Audio speedup script

Back in 2015 Ken Fallon did a show (episode 1766) on how to use sox to truncate silence and speed up audio.

Inspired by this I wrote a Bash script to aid my use of the technique, which I thought I’d share with you.

I have written out detailed notes for this episode describing the script and examining how it works and these are available here

hpr2129 :: Gnu Awk - Part 2

Released on 2016-09-29 under a CC-BY-SA license.

Gnu Awk - Part 2

This is the second episode in a series where b-yeezi and I will be looking at the AWK language (more particularly its GNU variant gawk). It is a comprehensive interpreted scripting language designed to be used for manipulating text.

I have written out a moderately long set of notes for this episode and these are available here

hpr2116 :: Duffer Gardening

Released on 2016-09-12 under a CC-BY-SA license.

Duffer Gardening

In August I was invited on the Duffercast podcast as a guest.

While waiting for all of the participants to arrive, inscius (Mikael) in Sweden, chalkahlom (Gavin) in Hungary and myself in Edinburgh, Scotland, decided to record a show for HPR, since we were using Mumble. Because two of the participants are gardeners we chatted about gardening.

This show is the result.

More about The Duffercast may be found at

Thanks also to The Bugcast for the use of their Mumble server!

Note: The Calendula that Mikael mentioned is more commonly known as a Marigold

hpr2109 :: Hacking my inner ear

Released on 2016-09-01 under a CC-BY-SA license.

Hacking my inner ear

In April 2015 I suddenly found myself getting dizzy as I bent down – to the extent where I actually fell over at one point. I went to see a doctor but didn’t get a diagnosis.

A medical student I know suggested it might be BPPV - Benign Paroxysmal Positional Vertigo, and with that in mind I researched it and found what turned out to be a cure.

See the full notes for more details:

hpr2096 :: Useful Bash functions - part 2

Released on 2016-08-15 under a CC-BY-SA license.

Useful Bash functions - part 2


This is the second show about Bash functions. In this one I revisit the yes_no function from the last episode and deal with some of the deficiencies of that version.

As before it would be interesting to receive feedback on these versions of the function and would be great if other Bash users contributed ideas of their own.

Full Notes

Since the notes explaining this subject are long, they have been placed here.

hpr2093 :: GNU Health

Released on 2016-08-10 under a CC-BY-SA license.

GNU Health

This is an interview with Dr Tom Kane and his student Euan Livingstone in Tom’s office at Edinburgh Napier University (ENU) on 2016-07-06.

Tom and Euan are investigating ways of running GNU Health for evaluation and demonstration purposes, using multiple Raspberry Pi systems and an Intel NUC. In particular they want to evaluate the conformity of interoperability (FHIR) standards, and are trying to build a reference implementation for decision makers who are procuring a Health and Hospital Information System.

In the interview Tom used some terminology that I have provided links for here and at the end:

I had forgotten where I’d seen Luis Falcón, originator of GNU Health, being interviewed. It was on FLOSS Weekly, as linked below.

The complete notes for this episode, with pictures of the equipment, are here.

Thanks to Tom and Euan for taking the time to talk to me.

hpr2081 :: Fixing my daughter's laptop

Released on 2016-07-25 under a CC-BY-SA license.

Fixing my daughter’s laptop

My daughter is a student at university and uses her laptop with a headset most of the time. She shares a flat with a friend and they are both studying, so they don’t want to annoy each other with noise.

The headset my daughter uses has a very long cable and earlier this year she tripped over it. The microphone jack was OK, but the headphone jack snapped off at the first ring and the remaining piece was left in the socket.

This episode is about my attempt to remove the broken piece of the jack plug. To find out more about the method I used and how successful it was see the full notes with pictures here.

Note: The Amazon links below are for information. I have no financial involvement with Amazon; these are not Affiliate links.

hpr2073 :: The power of GNU Readline - part 1

Released on 2016-07-13 under a CC-BY-SA license.

The power of GNU Readline - part 1

We all use GNU Readline if we we use the CLI in Linux because it manages input, line editing and command history in Bash and in many tools.

I have been using Unix and later Linux since the 1980's, and gradually learnt how to do things like jump to the start or the end of the line, delete a character backwards up to a space, or delete the entire line.

I think that learning GNU Readline is worthwhile since it contains a lot more features than what I just described. I thought I would do a few episodes on HPR to introduce some of what I consider to be the most useful features.

I want to keep the episodes short since this is a dry subject, and, if you are anything like me, you can't take in more than a few key sequences at a time.

The source of my information is the GNU Readline Manual. This is very well written, if a little overwhelming.

To read the rest of the notes for this episode follow this link:

hpr2060 :: Introduction to sed - part 5

Released on 2016-06-24 under a CC-BY-SA license.

Introduction to sed - part 5

This episode is the last one in the "Introduction to sed" series.

In the last episode we looked at the full story of how sed works with the hold and pattern buffers. We looked at some of the commands that we had not yet seen and how they can be used to do more advanced processing using sed's buffers.

In this episode we will look at a selection of the remaining commands, which might be described as quite obscure (even very obscure). We will also look at some of the example sed scripts found in the GNU sed manual.

To read the rest of the notes for this episode follow this link:

hpr2045 :: Some other Bash tips

Released on 2016-06-03 under a CC-BY-SA license.

Some other Bash tips


As we saw in the last episode 1951 (and others in this sub-series) there are eight types of expansion applied to the command line in the following order:

  • Brace expansion (we looked at this subject in episode 1884)
  • Tilde expansion (seen in episode 1903)
  • Parameter and variable expansion (this was covered in episode 1648)
  • Command substitution (seen in episode 1903)
  • Arithmetic expansion (seen in episode 1951)
  • Process substitution
  • Word splitting
  • Pathname expansion

We will look at process substitution and word splitting in this episode but since there is a lot to cover in these subjects, we'll save pathname expansion for the next episode.

I have written out a moderately long set of notes about this subject and these are available here

hpr2036 :: Glasgow Podcrawl 2016

Released on 2016-05-23 under a CC-BY-SA license.

Glasgow Podcrawl 2016

Kevie and Dave Morriss chat about the upcoming Glasgow Podcrawl. This year's event takes place on the 29th of July 2016 and kicks off at 6pm in the State Bar, Holland Street.

The event is open to anybody with an interest in podcasting, open source software or creative commons music. Whether you're an enthusiast or just interested in finding out more, also if you're a member of a band, then we would love to have you along for a yarn over a few pints.

Check out for more details and a map of how to get to the bar.

Music on this episode is "Beer" from Darkman Sounds

hpr2023 :: Setting up my Raspberry Pi 3

Released on 2016-05-04 under a CC-BY-SA license.

Setting up my Raspberry Pi 3

I bought a Raspberry Pi 3 in March 2016, soon after it was released. I want to use it as a server since it's the fastest Pi that I own, so I have tried to set it up in the best way for that role.

In this episode I describe what I did in case you want to do something similar.

Refer to the full notes for the details:

hpr2011 :: Introduction to sed - part 4

Released on 2016-04-18 under a CC-BY-SA license.

Introduction to sed - part 4

In the last episode we looked at some of the more frequently used sed commands, having spent previous episodes looking at the s command, and we also covered the concept of line addressing.

In this episode we will look at how sed really works in all the gory details, examine some of the remaining sed commands and begin to build useful sed programs.

To read the rest of the notes for this episode follow this link:

hpr2007 :: My new laptop

Released on 2016-04-12 under a CC-BY-SA license.

My new laptop

I attended OggCamp15 in Liverpool at the end of October 2015. As usual I bought some raffle tickets as a contribution to the expenses of the (un-)conference, not paying much attention to the prizes.

Actually, the star prize was a laptop donated by Entroware, a significant sponsor of the event, one of the most impressive prizes ever offered at OggCamp. There was quite a lot of excitement about this prize.

I attended the drawing of the raffle at the end of proceedings on the Sunday. Dan Lynch (of Linux Outlaws, and a frequent organiser of OggCamp) was in attendance overseeing the selection of the raffle tickets. Various smaller prizes were won and the tension built up as the final drawing approached.

Things got very tense when the first number drawn for the laptop was called and nobody responded. Then another draw was made.

Imagine my shock and surprise when I realised I had the winning ticket! I had won the star prize in the OggCamp raffle!

See the full show notes here for the details of the laptop.

hpr1997 :: Introduction to sed - part 3

Released on 2016-03-29 under a CC-BY-SA license.

Introduction to sed - part 3

In the last episode we looked at sed at a more advanced level. We looked at all of the command-line options which we will cover in this series and examined the s command in much more detail. We covered many more details of regular expressions.

In this episode we will look at more sed commands and how to use them.

To read the rest of the notes for this episode follow this link:

hpr1986 :: Introduction to sed - part 2

Released on 2016-03-14 under a CC-BY-SA license.

Introduction to sed - part 2

In the last episode we looked at sed at the simplest level. We looked at three command-line options and the 's' command. We introduced the idea of basic regular expressions.

In this episode we will cover all of these topics in more detail.

We are looking at GNU sed in this series. This version contains many extensions to POSIX sed. These extensions provide many more features, but sed scripts written this way are not portable.

To read the rest of the notes for this episode follow this link:

Note: Since recording the audio I have added a sixth example to the full notes to cover the topic of word boundaries, which I had omitted at the time.

hpr1976 :: Introduction to sed - part 1

Released on 2016-02-29 under a CC-BY-SA license.

Introduction to sed - part 1

sed is an editor which expects to read a stream of text, apply some action to the text and send it to another stream. It filters and transforms the text along the way according to instructions provided to it. These instructions are referred to as a sed script.

The name "sed" comes from Stream Editor, and sed was developed from 1973 to 1974 as a Unix utility by Lee E. McMahon of Bell Labs. GNU sed added several new features including better documentation, though most of it is only available on the command line through the info command. The full manual is of course available on the web.

To read the rest of the notes for this episode follow this link:

hpr1971 :: BlinkStick

Released on 2016-02-22 under a CC-BY-SA license.



In late 2013 I noticed the local Edinburgh Hacklab were offering soldering courses building a BlinkStick. I offered to sign my son Tim up to the next course since he wanted to learn to solder. He couldn't afford the time at that point, but we agreed to buy some BlinkSticks to build at home.

This episode describes some of our experiences with building and using the device.

The version we bought and built was the v1.0 release, since that and the BlinkStick Pro were all that was available. The base version now available is v1.1, and there are several other products available from the manufacturer in addition to these. The company is called Agile Innovative Ltd, based in the UK.

I have written out a moderately long set of notes about this subject and these are available here

hpr1951 :: Some additional Bash tips

Released on 2016-01-25 under a CC-BY-SA license.

Some additional Bash tips


As we saw in the last episode 1903 there are seven types of expansion applied to the command line in the following order:

  • Brace expansion (we looked at this subject in episode 1884)
  • Tilde expansion (seen in episode 1903)
  • Parameter and variable expansion (this was covered in episode 1648)
  • Command substitution (seen in episode 1903)
  • Arithmetic expansion
  • Word splitting
  • Pathname expansion

There is also another, process substitution, which occurs after arithmetic expansion on systems that can implement it.

We will look at one more of these expansion types in this episode but since there is a lot to cover, we'll continue in a later episode.

I have written out a moderately long set of notes about this subject and these are available here

Audio Note

This time, in the spirit of experimentation and as a way of learning Audacity I processed my audio thus:

  • Turned the stereo tracks to mono

  • Used a Noise Gate plug-in to reduce background noise (after "training" it on some silence)

  • Performed a Truncate Silence pass to reduce the length of pauses

  • Applied a small amount of amplification

Let me know if this had any positive or negative effects on the end product.

hpr1946 :: Wok Cookery

Released on 2016-01-18 under a CC-BY-SA license.

Wok Cookery

Not for the first time I'm following in the footsteps of Frank Bell. Frank did an HPR episode entitled "A Beginner with a Wok", episode number 1787, on 2015-06-09. On it he spoke about his experiences stir-fry cooking using a wok.

Frank got a lot of comments about his episode and there seemed to be an interest in the subject. I have been interested in Chinese, Indonesian and other Far Eastern cookery styles for some time, and do a lot of cooking, so I thought I'd record a show about one of the recipes I use.

My son visits around once a week and eats dinner with me. I offered to cook him my version of Chow Mein, which since he is vegetarian, needed to use no meat. This is my description of the recipe I used.

I loosely based this version of Chow Mein on Ken Hom's recipe in his book Chinese Cookery, page 226. This is from his 1984 BBC TV series, which I watched. I also learnt many of my preparation techniques from Ken Hom's books and TV shows.

I have written out a long set of notes to accompany this episode and these are available here


Apologies for the sounds of a mouse scroll wheel in the audio. I was trying a new microphone position and didn't realise how sensitive it was to these sounds.

hpr1941 :: What's in my case

Released on 2016-01-11 under a CC-BY-SA license.

What's in my case

I'm a fountain pen geek and I thought I'd share my geekiness on HPR in case there are any other FPGeeks out there.

I have a pen case which I bought from China through eBay, and so I felt that this allowed me to add this show to the 'What's in my ...' series.

I have written out a long set of notes to accompany this episode and these are available here

hpr1938 :: How I prepare HPR shows

Released on 2016-01-06 under a CC-BY-SA license.

How I prepare HPR shows


I have been contributing shows to Hacker Public Radio since 2012. In those far off days (!) we sent everything in via FTP, and had to name the files with a combination of our host id, our name, the slot number and the title. The show notes had to contain a chunk of metadata in a defined format to signal all of the various attributes of the show. I found myself making numerous mistakes with this naming and metadata formatting and so started designing and writing some tools to protect myself from my own errors.

I started developing a Bash script in mid-2013 which I called hpr_talk. I used Bash since I thought I might be able to make something with a small footprint that I could share, which might be useful to others. The script grew and grew and became increasingly complex and I found I needed to add other scripts to the toolkit and to resort to Perl and various Perl modules to perform some actions.

Then in 2014 Ken changed the upload procedure to what it is now. This is a much better design and does away with the need to name files in odd ways and add metadata to them. However, this left my toolkit a bit high and dry, so I shelved the plans to release it.

Since then I have been enhancing the hpr_talk toolkit, adding features that I found useful and removing bugs, until the present time. Now it is probably far too complex and idiosyncratic to be of direct use to others, and is rather too personalised to my needs to be easily shared. Nevertheless, it is available on GitLab and I am going to describe it here in case it (or the methods used) might be of interest to anyone.

I have written out a moderately long set of notes about this subject and these are available here

Audio Notes

I had to record this in two parts. In the second part there was a constant background hum which I tried to remove. My removal process was not particularly successful I'm afraid, so it cuts in and out. I'm still learning how to do this sort of thing in Audacity!

hpr1903 :: Some further Bash tips

Released on 2015-11-18 under a CC-BY-SA license.

Some further Bash tips


There are seven types of expansion applied to the command line in the following order:

  • Brace expansion (we looked at this subject in the last episode 1884)
  • Tilde expansion
  • Parameter and variable expansion (this was covered in episode 1648)
  • Command substitution
  • Arithmetic expansion
  • Word splitting
  • Pathname expansion

We will look at some more of these in this episode but since there is a lot to cover, we'll continue in a later episode.

I have written out a moderately long set of notes about this subject and these are available here

hpr1884 :: Some more Bash tips

Released on 2015-10-22 under a CC-BY-SA license.

Some more Bash tips

We looked at Parameter Expansion back in HPR episode 1648 where we saw how Bash variables could be used, checked and edited. There are other sorts of expansions within Bash, and we'll look at one called "Brace Expansion" in this episode, which follows on from episode 1843 "Some Bash tips".

I have written out a moderately long set of notes about this subject and these are available here

hpr1868 :: Glasgow Podcrawl review

Released on 2015-09-30 under a CC-BY-SA license.

Glasgow Podcrawl review

The second Glasgow Podcrawl took place on the 10th of July 2015. The participants were:

The event started at 6pm in the State Bar on Holland Street, moved on to the Bon Accord, the Inn Deep and finally to the Three Judges.

Dave Morriss departed after visiting the second bar to head back to Edinburgh, but everyone else lasted to the very end!

In this episode hear the details of this singular event, and a whole lot about many other things.

hpr1864 :: Turning an old printer into a network printer

Released on 2015-09-24 under a CC-BY-SA license.


I have a USB printer I bought back in 2005 when I bought a Windows PC for the family. It's an HP PSC 2410 PhotoSmart All-in-One printer. This device is a colour inkjet printer, with a scanner, FAX and card-reading facilities. It has been left unused in a corner for many years, and I recently decided to to see if I could make use of it again, so I cleaned it up and bought some new ink cartridges for it.

It is possible to use this printer on Linux using CUPS for the printing and SANE for scanning. I connected it to my Linux desktop for a while to prove that it was usable. However, rather than leaving it connected in this way, I wanted to turn it into a network printer that could be used by the rest of the family. My kids are mostly away at university these days but invariably need to print stuff when they pass through. I searched the Internet and found an article in the Raspberry Pi Geek magazine which helped with this project.

Full Notes

Since the notes explaining this subject are long, they have been placed here:

  1. HP PSC 2410 PhotoSmart All-in-One printer:
  2. main web site:
  3. CUPS Wikipedia entry:
  4. HP Linux Imaging and Printing (HPLIP):
  5. Scanner Access Now Easy (SANE):
  6. "Converting the Raspberry Pi to a wireless print server" from the Raspberry Pi Geek magazine:
  7. Linux Foundation OpenPrinting work group:
  8. Arch Wiki on CUPS - Linux Server Windows Client:
  9. Internet Printing Protocol (IPP):

hpr1852 :: Operation Wallacea

Released on 2015-09-08 under a CC-BY-SA license.

Operation Wallacea

This summer my daughter Clara spent a month as a volunteer Research Assistant on Hoga Island in Indonesia learning to dive and helping to survey the coral reef and other habitats.

In this episode we talk about Clara's experiences with Operation Wallacea.


1 Welcome to Hoga Island
1 Welcome to Hoga Island
2 Relaxing near the Lodge
2 Relaxing near the Lodge
3 Beach
3 Beach
4 Soft and hard corals
4 Soft and hard corals
5 Divers and soft corals
5 Divers and soft corals
6 Upside-down jellyfish
6 Upside-down jellyfish
7 Mangroves
7 Mangroves
8 Humbug Damselfish
8 Humbug Damselfish
9 Blue Damselfish
9 Blue Damselfish
10 The hut from inside
10 The hut from inside
11 The hut's verandah
11 The hut's verandah
12 The Shop
12 The Shop


hpr1843 :: Some Bash tips

Released on 2015-08-26 under a CC-BY-SA license.

Today I want to talk about three Bash commands:

  • pushd
  • popd
  • dirs

These let you change directory on a Linux system (and others which support Bash) but keep a record of where you have been in a stack structure. The stack can be viewed and manipulated with these commands as well.

I have written out a moderately long set of notes about these commands and these are available here

hpr1827 :: How I make bread

Released on 2015-08-04 under a CC-BY-SA license.

Ken Fallon was asking for bread-making advice on a recent Community News recording. I've been making my own bread since the 1970's and I thought I'd share my methods in response. Frank Bell also did an excellent bread-making episode in 2013.

I have prepared a long description of my bread-making process, with photographs and a recipe, and this is all available here:

hpr1822 :: Some tips on using ImageMagick

Released on 2015-07-28 under a CC-BY-SA license.

Some tips on using ImageMagick

I like to use images in HPR shows if I can. I have experimented with various ways of preparing them since I first started contributing, but I'm particularly impressed with what I am able to do using ImageMagick.

The ImageMagick system contains an enormous range of capabilities, enough for a whole series of shows. I thought I would talk about some of the features I use when preparing episodes to give you a flavour of what can be done.

I'm the rawest amateur when it comes to this kind of image manipulation. Just reading some of the ImageMagick documentation (see links) will show you what an enormous number of possibilities there are. I am only using a few in this episode.

I have prepared longer show notes and demonstrated some scripts to explain how I process images. These can be found here.

hpr1816 :: Visualising HPR tags

Released on 2015-07-20 under a CC-BY-SA license.

As you know, HPR asks for tags to be added to the episodes we contribute. These are intended to be used to produce some kind of improved topic search at some point in the future.

I find it difficult to decide what tags to add to my shows, and I expect many people feel the same way about it. Should I use common tags like Linux or does that not differentiate it enough? How many tags should I add, should the words be plural or singular?

We have recently been asked to contribute to the task of adding tags to previous shows, so it's very much a hot topic at the moment.

In thinking about this I wondered if there was a way in which existing tags could be represented in a visual way to help with the process of choosing and rationalising tags. It was the type of thought that occurs to you in the shower or while out for a walk.

In my last job I occasionally used a package called GraphViz to generate graphical representations. I used it to generate a chart showing how the organisation (a university) was divided up into schools, departments, sections and so on in a hierarchical manner. I wondered if it could be used for this task.

I decided to use my currently preferred scripting language, Perl, and found there was a module which let me access GraphViz. I started putting together a script.

The script was created in an evening and is still rather rough. It performs a very simple query on the database to obtain the show numbers of shows with tags, their titles and their tags. It then uses a CSV parser to parse the tag list and builds a hash table indexed by tags, where the contents per tag are the show numbers that use this tag.

Having built this hash table it is used to generate GraphViz data by making each tag and each show number a node and joining them together.

Finally the script processes the graph to produce output in SVG format which is available to view.

Bear in mind that this is not a finished project - it may never be finished! The script may not be ideal. My understanding of GraphViz may be insufficient, and the rendering of the SVG may not be good (I got various results on different browsers).

However, you might find it interesting or even useful. Feedback on the idea is welcome.

hpr1811 :: Life and Times of a Geek part 2

Released on 2015-07-13 under a CC-BY-SA license.


In the last part I told you of my first encounter with a mainframe computer and the Algol60 language while an undergraduate student at Aberystwyth University.

Today I want to talk about the next stage as a postgraduate student at the University of Manchester.

It seems to have taken me over 6 months to prepare this episode of this series, for which I apologise. I seem to get distracted as I do my background research.

Full Notes

Since the notes explaining this subject are particularly long, they have been placed here: and an ePub version is also available here:

hpr1777 :: Magnatune Favourites

Released on 2015-05-26 under a CC-BY-NC-SA license.

Magnatune Favourites

Andrew Conway and Dave Morriss, who each have a lifetime membership with Magnatune, talk about the label and share some favourite tracks.

About Magnatune

Magnatune Logo
Magnatune Logo

Magnatune is an American independent record label based in Berkeley, California. It was founded in 2003 by John Buckman.

When first set up music could be bought from Magnatune through a download interface on the website with a "pay what you like" pricing model. Later it was possible to purchase physical CDs and in 2007 complete albums and individual tracks could be bought through

Magnatune moved to a membership plan in 2008 and in 2010 dropped the CD printing service. The subscription model offers monthly or lifetime membership. Members can download as much as they want, or with a streaming membership can stream as much as they want. Many download formats are available and all music is without DRM.

Magnatune encourages buyers to share up to three copies with friends. All of the tracks downloaded free of charge are licensed under the Creative Commons Attribution-NonCommercial-ShareAlike (BY-NC-SA) License.

It's legal to play Magnatune music on a non-commercial podcast without paying collecting society fees to organisations such as ASCAP, BMI or SoundExchange.

Music Choices

The picture we mentioned when discussing the artist Kalabi
Picture from Kalabi's page on Magnatune

See also if you want more.

  1. Wikipedia entry on Magnatune:
  2. Magnatune site:
  3. Wikipedia entry on Creative Commons:
  4. John Buckman's blog:
  5. Web-based Magnatune player:

hpr1776 :: Vim Hints 004

Released on 2015-05-25 under a CC-BY-SA license.

Joining commands together

In this episode I want to look at more movement commands and how to use them in conjunction with commands that change things in the file. I also want to add some more elements to the configuration file we have been building over the last few episodes.

I have covered a lot of ground in this episode, introducing a number of new subjects. This is partly because I felt the series needed to get to the point where you could start to make full use of Vim if you are following along, and partly because the episodes up to this point have been moving a little too slowly! I hope the change in pace and length hasn't put you off.

Full Notes

Since the notes explaining this subject are particularly long, they have been placed here: and an ePub version is also available here:

  1. Vim Help:
  2. Graphical Cheat Sheet:
  3. Vim Hints Episode 3

hpr1757 :: Useful Bash functions

Released on 2015-04-28 under a CC-BY-SA license.


I enjoy writing Bash scripts to solve various problems. In particular I have a number of scripts I use to manage the process of preparing a show for HPR, which I am developing at the moment.

My more complex Bash scripts use a lot of functions to perform the various tasks, and, in the nature of things, some of these functions can be of use in other scripts and are shared between them.

I thought I would share some of these functions with HPR listeners in the hopes that they might be useful. It would also be interesting to receive feedback on these functions and would be great if other Bash users contributed ideas of their own.

Full Notes

Since the notes explaining this subject are long, they have been placed here:, and an experimental ePub version is available here:

  1. Bash Support Vim plugin:
  2. HPR episode Bash parameter manipulation:
  3. How to write functions (from The Linux Documentation Project):
  4. Download the pad and yes_no functions:

hpr1740 :: Mailing List Etiquette

Released on 2015-04-03 under a CC-BY-SA license.

Mailing List Etiquette


In February 2015 I created a script to add a section to the monthly Community News show notes. The added section summarises the discussions on the HPR mailing list over the previous month. My script processes the messages archived on the Gmane site and reports on the threads it finds there.

In writing this script I noticed the number of times people made errors in replying to existing message threads and initiating new threads on the list. I thought it might be helpful if I explained some of the do's and don'ts of mailing list use to help avoid these errors.

Full Notes

Since the notes explaining this subject are long (the size limit is 4000 characters), they have been placed here:

Experimental EPUB Notes

For this show I have tried generating an EPUB version of the full notes. This can be found here: Comments on this idea are welcome.

  1. Gmane archive of the Hacker Public Radio mailing list:
  2. Wikipedia article on message groupings referred to as conversations, topic threads, or threads:
  3. A brief note on how to punctuate the phrase "do's and don'ts":
  4. Wikipedia article on Usenet:
  5. Thunderbird add-on ThreadVis:
  6. Wikipedia article on the RFC document:
  7. Text of RFC5322:
  8. Wikipedia article on Email:
  9. Wikipedia article on MIME used in email:
  10. Description of a threading algorithm from Jamie Zawinski:
  11. Text of RFC1153:
  12. Wikipedia article on posting style:
  13. A recent large thread on the Mailman-Users mailing list discussing the subject of replying to lists:

hpr1734 :: Vim Hints 003

Released on 2015-03-26 under a CC-BY-SA license.

Moving Around

In this episode I want to look at how you move around the file you are editing in Vim. I also want to add some more elements to the configuration file we started building in the last episode.

Full Notes

Since the notes explaining this subject are long (the size limit is 4000 characters), they have been placed here:

I usually create my notes with Markdown and pandoc. As an experiment this time I have used a pandoc template which uses the same CSS that provides the style for the main HPR pages. I hope it makes these notes look better than the very bare HTML I have produced in the past.

  1. Vim Hints Episode 1
  2. Vim Hints Episode 2

hpr1724 :: Vim Hints 002

Released on 2015-03-12 under a CC-BY-SA license.

Vim Ate my Homework

In this episode I want to look at how to keep your work secure with Vim. Next episode we will look at how to create and edit files.

Avoiding data loss with a backup

The best place to start is with the configuration file which we met last episode. As we saw, this is usually $HOME/.vimrc. However, it can also be $HOME/.vim/vimrc, which is actually recommended since it keeps all Vim files in the same place. I use the former, since that's the way I have always done it.

Let's add some options to this file. Configuration options consist of command mode commands. Actually, to be precise about it, any Vim Script expression may be written there.

First it's a good idea to ensure that Vim runs with all of its standard features enabled. The option for this is called compatible (meaning compatible with Vi), which we need to turn off. This is done with the option:

set nocompatible

Next, it's highly advisable to make Vim generate a backup file whenever it opens a file for editing. The backup file has the same name as the original file with a tilde appended. The configuration command is:

set backup

The backup file is a copy of the file which existed before editing started.

By default the backup file is saved in the same directory as the file being edited. If this is a problem (and to me this is not), then it is possible to tell Vim to save backups in a fixed place. This is done with the command set backupdir= followed by a list of directories. For example:

set backupdir=~/.backup,.,/tmp

If you were to add this to your configuration file, Vim would save backups in a top-level directory ~/.backup (which must already exist), then if this fails it will save in the current directory, falling back to /tmp if all else fails. Whether you do this is up to you. I would suggest you do not, at least not until you are more experienced with Vim.

Undoing and redoing changes

Vim can undo changes you make to a file. This is useful if a change was the wrong change or in the wrong place. It can also redo the undone change.

The u command in normal mode undoes the last change. The redo function is invoked by pressing the Ctrl key while pressing r. This key sequence is normally represented as CTRL-R.

Vim keeps a record of the changes, so successive u commands undo successive changes back in time. Conversely, CTRL-R redoes the undone changes forward in time.

Normally the change history is lost when Vim exits, but two configuration options can be used to save it. The undofile option ensures change history is written to a file and undodir shows the (pre-existing) directory which is to hold these files.

set undodir=~/.vim/undodir
set undofile

It can be a little surprising if you press u in a file you have just opened in Vim to find that it undoes something you changed last time you edited it! However, on the whole I think this is a great feature.

File recovery

The Swap File

By default Vim uses a recovery mechanism where it generates a swap file. Under Unix and Linux this file has a name built from the name of the file being edited with a dot prepended (making it a hidden file) and with the extension ".swp". So, if you were editing the file testfile the swap file would be a file called .testfile.swp in the same directory.

It is possible to make Vim write the swap file elsewhere, such as on another partition. You can also turn this recovery capability off. It is probably advisable to use the default settings while you are learning Vim.

The swap file is updated after typing 200 characters or when you have not typed anything for four seconds. The swap file is deleted as soon as Vim stops editing the file.


Case 1: there are changes in the swap file

If something bad happens during an editing session, such as the loss of power, the swap file will remain after the event. If you know that you need to recover your edit session then you can simply type the following in the directory where the file you were editing exists:

vim -r filename

You will see a message such as the following:

Using swap file ".testfile3.swp"
Original file "~/testfile3"
Recovery completed. You should check if everything is OK.
(You might want to write out this file under another name
and run diff with the original file to check for changes)
You may want to delete the .swp file now.

Press ENTER or type command to continue

See the explanation on the Vim wiki.

Alternatively, when you try to edit a file you were editing at the time of the failure Vim will detect the presence of a swap file and alert you with a message such as:

Found a swap file by the name ".testfile2.swp"
          owned by: hprdemo   dated: Fri Feb 13 15:33:41 2015
         file name: ~hprdemo/testfile2
          modified: YES
         user name: hprdemo   host name: i7-desktop
        process ID: 16181
While opening file "testfile2"
             dated: Sat Dec  6 18:34:32 2014

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r testfile2"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".testfile2.swp"
    to avoid this message.

Swap file ".testfile2.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

Vim here is indicating that there are unsaved changes that can be recovered. It is also warning that if someone is editing the same file (such as you in another window) this might account for the presence of the swap file.

Assuming it's appropriate, you can recover the changes and continue editing by pressing r at the above prompt. You will see messages such as the ones above relating to the vim -r filename example.

Be aware that if you continue editing the original swap file will continue to exist and you will get the same message again next time you edit the file. Vim will create a new swap file (called /home/hprdemo/.testfile2.swo in this case) to protect the new editing session.

This situation can be a little confusing if you have not encountered it before. There are a number of ways you can resolve this:

  1. You can save the recovered file and exit Vim (type :wq). You can then edit the same file all over again. You will see almost the same message as before, but you can now delete the swap file by pressing d. The message you see the second time round will contain the additional warning that the file you are editing is newer than the swap file - that is because you just saved a new copy of it!

  2. You can save the file and exit Vim as above, but then explicitly delete the swap file. In the example you would do this by typing: rm .testfile2.swp

  3. As before you can save the file but this time without exiting Vim (type :w). Then tell Vim to re-edit the current file with the command :e. You will then see the warning about there being a swap file, and you can type d to delete it.

Case 2: there are no changes in the swap file

If, when you see the message about finding a swap file you see that there are no changes to recover you can just delete the swap file by pressing d. You can then continue with editing the file as normal.

Don't Panic!

This recovery process is complex because Vim is trying to ensure that you are protected against losing your changes.

As it says in the Vim manual DON'T PANIC!


  • The configuration file should contain the following:
set nocompatible
set backup
set undodir=~/.vim/undodir
set undofile
  • Use u in normal mode to undo a change
  • Use CTRL-R in normal mode to redo an undone change
  • Re-starting Vim after a crash will invoke a recovery dialogue

hpr1714 :: Vim Hints 001

Released on 2015-02-26 under a CC-BY-SA license.

Introduction to Vim

This is the start of the Vim Hints series.

As a Linux user there are many editors available to you. Which one you want to use depends on your needs and the amount of time you want to dedicate to learning how to use it.

One of the editors from the early days of Unix is vi, written in 1976. Contemporary with it is Emacs, also originating in 1976. However, it seemed to become the norm (in my experience anyway) that vi rather than Emacs was provided as standard with versions of Unix, and this has often continued into Linux.

I originally started using Unix around 1988 and found vi available to me. I learnt how to use it in a rudimentary way since I knew I'd find it on any Unix systems I came across.

Many derivatives and clones of vi have been created. The one which has become the most popular and available is Vim, the name of which is an acronym for Vi IMproved, created in 1991 by Bram Moolenaar. This is what I use, and I have not wanted to learn another editor since adopting it, even though I have experimented with several. This is the editor we will be looking at in this series.

What's the series about?

The thinking behind this series is:

  • You may already be using Vim; there are features you may not be aware of that can be revealed here
  • You may be using a different, simpler editor; you might want to use Vim and gain from its advanced features

Of course, you may prefer to learn Emacs instead. That's fine; you should choose the tool that best suits your needs. Both Emacs and Vim have quite steep learning curves, but the broad range of capabilities you gain from knowing either is considerable.

I am not an expert in Vim. In fact I am continuing to learn new Vim features on a regular basis. However, I have been using it for many years and would like to share some of what I have learnt.

Why use Vim?

With simpler editors you can move about a file, add, remove and change text and save the results. The editor might have syntax highlighting and some degree of knowledge of the programming language you are typing. You might have spell checking as well.

With Vim and other more advanced editors you have all of this and a lot more. You can perform global changes throughout a file, process many files at once, add plugins to the editor to change its behaviour, and so on. Also, there is a language behind the scenes which can be used to build extensions.

Using Vim

Usually, typing the command vi at the command line actually invokes vim. Vim runs in vi-compatible mode by default, which results in Vim enhancements being unavailable.

Vim uses a configuration file, which is called .vimrc on Linux. (Vim will also run on Windows, OSX and other operating systems but we will not be covering these implementations in this series.) Vim also has a GUI interface invoked by the command gvim, and it has its own configuration file .gvimrc.

I you don't have a .vimrc create one with touch ~/.vimrc before you start. This will stop Vim running in vi-compatible mode. We will look at what the .vimrc can be used to do later.

You can start Vim on its own without pointing at a file, but normally you use it to edit a file, which need not already exist. So, to create a new file called testfile invoke Vim with the command: vim testfile

Once running, Vim shows the contents of the file. All the lines on the screen where there is no content are marked with a tilde "~" character. If you are creating a file the first line on the screen will be blank, and last line will contain the name of the file followed by "[New File]" and some other details which we will examine later:

"testfile" [New File]       0,0-1         All

All the rest of the lines will contain a tilde.

Vim is a modal editor. The mode you usually start in is normal mode where you can move around the lines of the file and perform actions, but nothing you type is actually written to the file. In fact, the keys you type are actually editing commands. This is one of the features of Vim that causes problems for new users.

Since this is a new file there is not much you can do other than enter text, and to do this you need to switch to insert mode. Do this by pressing the i key. The message -- INSERT -- will appear on the bottom line of the screen. Now type some text, pressing the Enter key at the end of each line.

You might notice that in insert mode you can press the arrow keys and move back to text you have already typed. This is a Vim feature and was not available in the original vi editor.

When you have finished entering text, press the Esc key to exit from insert mode. Now you can move around in normal mode, but remember that the keys you press are now commands not data to be entered into the file.

To move around in normal mode use the arrow keys or the home row keyboard keys: k to move up, j to move down, h to move left and l to move right.

This brings us to the last mode we'll look at: command mode. To enter this mode press the : (colon) key in normal mode. This moves the cursor to the last line of the screen, which starts with the colon you just typed. Here you can enter another class of commands. This time, we'll just look at how you can save the file and exit Vim.

Saving the file is achieved with the w command, and to exit from Vim the q command is used. These can be typed together, so :wq writes the file and exits.

If you were to use :q on its own, having entered data into Vim, this would not work. Vim prevents you from throwing away your work this way. If you really meant to quit without saving then the q must be followed by an exclamation mark ("!"). So :q! lets you exit Vim without saving.

Summary so far

  • Vim usually starts in normal mode
  • Arrow keys or h, j, k and l for left, down, up and right for navigation in normal mode
  • i enters insert mode
  • Esc exits from insert mode and reverts to normal mode
  • : in normal mode enters command mode
  • :w in normal mode writes the file
  • :wq in normal mode writes and exits
  • :q in normal mode exits but only if nothing was changed or added
  • :q! in normal mode exits regardless of any changes


  • I was wrong about the contents of the last line of the Vim screen in the audio. The notes have been corrected.



Other resources

hpr1694 :: My APOD downloader

Released on 2015-01-29 under a CC-BY-SA license.

My APOD Downloader

Astronomy Picture of the Day

You have probably heard of the Astronomy Picture of the Day (APOD) site. It has existed since 1995, is provided by NASA and Michigan Technological University (MTU) and is created and managed by Robert Nemiroff and Jerry Bonnell. The FAQ on the site says "The APOD archive contains the largest collection of annotated astronomical images on the internet".

The Downloader

Being a KDE user I quite like a moderate amount of bling, and I particularly like to have a picture on my desktop. I like to rotate my wallpaper pictures every so often, so I want to have a collection of images. To this end I download the APOD on my server every day and make the images available through an NFS-mounted volume.

In 2012 I wrote a Perl script to perform the download, using a fairly primitive HTML parsing method. This script has been improved over the intervening years and now uses the Perl module HTML::TreeBuilder which I believe is much better at parsing HTML.

The version of the script I use myself also includes the Perl module Image::Magick which interfaces to the awesome ImageMagick image manipulation software suite. I use this to annotate the downloaded image with the title parsed from the HTML so I know what it is.

The script I am presenting here is called collect_apod_simple and does not use ImageMagick. I chose to omit it because the installation of this suite and the related Perl module can be difficult. Also, I do not feel that the annotation always works as well as it could, and I have not yet found the time to correct this shortcoming.

A version of the more advanced script (called collect_apod) is available in the same place as collect_apod_simple should you wish to give it a try. Both scripts are available on GitLab under the link

The Code

The script itself is described in the full show notes, available here:

hpr1664 :: Life and Times of a Geek part 1

Released on 2014-12-18 under a CC-BY-SA license.

Life and Times of a Geek - part 1

I really liked David Whitman's idea of doing a show on his birthday, so I'm borrowing the idea.

This show is being released on my 65th birthday, and I decided to use this opportunity to tell you about my long experience with computational devices as part of the series "How I Found Linux". Thinking about what I want to cover, I realise that it might be quite a lot, so I'm organising the shows into a collection of short episodes.

I have been thinking about doing this for a while. Up until now I was concerned that it would be a bit self-indulgent, but I have been advised to just go ahead and do it. I hope you find the shows interesting.

The full notes for this episode are to be found here:

hpr1656 :: My audio player collection

Released on 2014-12-08 under a CC-BY-SA license.

My Audio Player Collection

I got broadband installed in my house in 2005 after I'd bought my first PC. I'd owned a lot of PCs before that, but they had all been cast-offs from the university I was working at, and I accessed the Internet via dial-up to my work.

This was around the time I got sick of listening to the radio and first discovered podcasts, and so I decided I wanted a portable audio player (or MP3 Player as they tended to be called back then).

Since then I have been listening to podcasts pretty much all of the time and have worked my way through a number of players. I thought it might be interesting if I chronicled the devices I have owned in the past 9-10 years.

The full show notes for this episode are available at: hpr1656_full_shownotes.html

hpr1648 :: Bash parameter manipulation

Released on 2014-11-26 under a CC-BY-SA license.

Bash parameter manipulation

I'm a great fan of using the Linux command line and enjoy writing shell scripts using the Bash shell.

  • BASH (or more usually Bash or bash) is the name of a Unix shell. The name stands for Bourne Again SHell, which is a play on words. Bash is an extension of the shell originally written by Stephen Bourne in 1978, usually known as SH.

  • Bash was written as part of the GNU Project which forms part of the Linux Operating System.

  • A shell is the part of the operating system that interprets commands, more commonly known as the command line.

  • A knowledge of Bash is very helpful if you would like to be able to use the power of the command line. It is also the way to learn how to build Bash scripts for automating the tasks you need to perform.

In this episode we look at what parameters are in Bash, and how they can be created and manipulated. There are many features in Bash that you can use to do this, but they are not easy to find.

As I was learning my way around Bash it took me a while to find these. Once I had found them I wanted to make a "cheat sheet" I could stick on the wall to remind me how to do things. I am sharing the result of this process with you.

The version of Bash which I used for this episode is 4.3.30(1)-release

The full notes for this episode are to be found here:

hpr1636 :: How I make coffee

Released on 2014-11-10 under a CC-BY-SA license.

My Coffee History

I'm a coffee lover. I have tried many ways of making coffee.

When I was a child my parents made their coffee in a percolator on the stove top. I remember how great it smelled though it tasted awful to me at that age.

I have owned a variety of filter machines over the years, and these have also been available at the places I have worked. They seemed to do a reasonable job, but nothing special.

One time I owned an all-glass Cona coffee maker, which was very fancy and expensive. It was too fragile for me and eventually met its end while being washed. I don't recall it making particularly wonderful coffee, but it would also make tea, which was a novelty.

I made a number of visits to Indonesia several years ago. There are a lot of pretty good coffee beans available there but the way of making a cup of coffee is not really to my taste. A good dollop of ground coffee in a large cup with boiling water added and large quantities of sugar. Straining those coffee grounds out through your teeth is not a pleasant experience.

As the fashion for the Cafetiere or French Press developed I acquired a number of these. Until recently these were all glass. I found I invariably broke them either by being over zealous when pressing down the plunger or being clumsy when washing them up. It's not a bad way of making coffee, but I have an alternative that I much prefer - the Moka Pot.

Moka Pot

A few years ago I bought a Bialetti Moka Pot. I had never heard of these before, but my son, another avid coffee drinker, pointed me to them. I bought a three-cup pot to start with. This is a small pot; the three refers to three 50ml espresso cups. I also bought a 9-cup pot which is much bigger.

My Bialetti 3-cup and 9-cup pots
Picture: My Bialetti 3-cup and 9-cup pots

The pot consists of three main elements: a base which holds the water, a funnel which holds the ground coffee and the top which holds the coffee once made. There is a gasket and a metal filter on the underside of the top part to prevent coffee grounds entering.

A disassembled Bialetti
Picture: A disassembled Bialetti

The Bialetti is heated on a gas or electric stove and forces boiling water through ground coffee under steam pressure. It makes coffee similar to but not the same as espresso coffee.

The base is filled with water just under the level of the pressure release valve.

Bialetti filled with water
Picture: Bialetti filled with water

I use Italian coffee for the Bialetti since it seems to taste better than any others I have tried.

My current favourite coffee
Picture: My current favourite coffee

Once opened I keep my coffee in a vacuum container.

Coffee in a vacuum container
Picture: Coffee in a vacuum container

The funnel is placed into the water-filled base.

Bialetti ready for coffee
Picture: Bialetti ready for coffee

The funnel takes about two scoops of coffee

Bialetti being filled with coffee
Picture: Bialetti being filled with coffee

The pot is placed on the stove. I have a gas stove and so I use a trivet for stability. I have to take care that the gas flame is not too high or the handle will melt, as has happened in the past!

Bialetti in action
Picture: Bialetti in action

You need to listen out for the bubbling sound the pot makes when the water has passed through the coffee into the top compartment. Letting the remaining steam pass through will over-heat the coffee which you do not want to happen.

Coffee is brewed
Picture: Coffee is brewed

I make a cup of coffee consisting of one part coffee, one part cold milk and one part boiling water. This makes a large cup of pretty strong yet very smooth coffee which helps to wake me up each morning.

A comforting brew in the wrong cup!
Picture: A comforting brew - in the wrong cup!

The Bialetti usually gets one use per day, after which it is washed up. Some purists say that it should only be rinsed out so that the coffee residues on the inside are not removed. I have not noticed any difference personally.


hpr1518 :: 02 The podcasts I listen to

Released on 2014-05-28 under a CC-BY-SA license.

I listen to a lot of podcasts. I started listening to them back in around 2005 after buying my first portable player.

This is a continuation of the 85 podcast feeds I subscribe to. In my last show I reported on the first 41 of the set. Here are the remaining 44 feeds.

Note: The list below is generated by a script which performs a query on my database. I have relied on parsing the feeds themselves for the websites, using the link value. In a few cases the value is unfortunately incorrect or missing because the feed is mis-configured.

I have included an OPML version of the list in case you want to load it or part of it into your podcatcher. Find it at

  1. Amateur Skeptics

  2. Geeks Without God

  3. InKredulous

  4. Rationally Speaking

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-06
    • Description: Rationally Speaking is the bi-weekly podcast of New York City Skeptics. Join hosts Massimo Pigliucci and Julia Galef as they explore the borderlands between reason and nonsense, likely from unlikely, and science from pseudoscience. Any topic is fair game as long as we can bring reason to bear upon it, with both a skeptical eye and a good dose of humor! We agree with the Marquis de Condorcet, who said that in an open society we ought to devote ourselves to "the tracking down of prejudices in the hiding places where priests, the schools, the government, and all long-established institutions had gathered and protected them." Rationally Speaking is produced by Benny Pollak and is recorded in the heart of New York City's Greenwich Village.
    • Category: Skepticism
  5. Skepticality:The Official Podcast of Skeptic Magazine

  6. Skeptics with a K

  7. Skepticule

  8. The Pod Delusion

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-04
    • Description: The Pod Delusion is a weekly news magazine podcast about interesting things. From politics, to science to culture and philosophy, it's commentary from a secular, rationalist, skeptical, somewhat lefty-liberal, sort of perspective.
    • Category: Skepticism
  9. The Pod Delusion » Pod Delusion Extra

  10. The Skeptics' Guide to the Universe

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-10
    • Description: The Skeptics' Guide to the Universe is a weekly Podcast talkshow discussing the latest news and topics from the world of the paranormal, fringe science, and controversial claims from a scientific point of view. -The Skeptics' Guide to the Universe: Your escape to reality -Produced by the New England Skeptical Society in association with the James Randi Educational Foundation(JREF) :
    • Category: Skepticism
  11. The Skeptic Zone

  12. 2600 - 2600: The Hackers Quarterly

  13. bsdtalk

  14. /dev/random Cast

    • Website:
    • Feed:
    • Format: Atom
    • Last episode: 2014-01-24
    • Description: /dev/random is a show created by a bunch of random people, at a random time, on random topics that MAY be of interest ... to someone. The show is available here and WAS also available via the AWESOME Hacker Public Radio (HPR) ( ) until they wised up.
    • Category: Technical
  15. FLOSS Weekly (MP3)

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-09
    • Description: We're not talking dentistry here; FLOSS all about Free Libre Open Source Software. Join host Randal Schwartz every Wednesday as he talks with the most interesting and important people in the Open Source and Free Software community. Records live at every Wednesday at 8:30am PT/11:30am ET.
    • Category: Technical
  16. Free as in Freedom

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2013-10-17
    • Description: A bi-weekly discussion of legal, policy, and other issues in the open source and software freedom community (including occasional interviews) from Brooklyn, New York, USA. Presented by Karen Sandler and Bradley M. Kuhn.
    • Category: Technical
  17. Frostcast OGG

  18. Full Circle Magazine » podcast

  19. GNU World Order

  20. Hacker Public Radio

  21. KernelPanic Oggcast

  22. Audio Feed.

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-02-09
    • Description: The cross platform podcast that makes technology work for you and not the other way around. The place to go for all geeks who slide between Mac, iOS, Android, Linux and Windows offering an essential mix of hacks, tips, howto's and tweaks spiced up with a dash of geek culture. Also check out our Mediafeed that has both our audio and video episodes.
    • Category: Technical
  23. Linux Basement Podcast

  24. Linux In Da House Ogg-Vorbis Feed

  25. Linux Luddites » Ogg

  26. LinuxLUGcast – Ogg

  27. Linux News Log (ogg)

  28. Linux Outlaws

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-13
    • Description: Two pragmatic geeks talk about the latest news concerning Linux, free and open technology or anything else they deem noteworthy which may include such absurd things as hockey or bands you never heard of. This means there's many a joke and derailed conversation along the way, so don't come here expecting only Linux or software freedom talk — just sit back and relax, partner.
    • Category: Technical
  29. Linux Voice Podcast

  30. mintCast » OGG

  31. Network Security Podcast

  32. Security Now (MP3)

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-08
    • Description: Steve Gibson, the man who coined the term spyware and created the first anti-spyware program, creator of Spinrite and ShieldsUP, discusses the hot topics in security today with Leo Laporte. Winner of the 2009 and 2007 people's choice award for best Technology/Science podcast. Records live at every Tuesday at 1:00pm PT/4:00pm ET.
    • Category: Technical
  33. SourceTrunk

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-07
    • Description: Sourcetunk will try to demystify the beautiful beast that is Open Source and show the listeners the more practical examples of Open Source and Free Software. It will discuss software for Linux, BSD, MacOSX and Microsoft Windows systems
    • Category: Technical
  34. Sunday Morning Linux Review – OGG Feed

  35. The Command Line Podcast

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-01-26
    • Description: A regularly published podcast by a self-described hacker, curmudgeon and hacktivist about the practice and profession of programming drawing on over a decade of professional experience and a lifetime spent hacking, the intersection of politics and society with technology and anything else clever, elegant or funny that catches my mind as a die hard technology geek.
    • Category: Technical
  36. The Linux Link Tech Show Ogg-Vorbis Feed

  37. The Mind Tech Podcast

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-02-26
    • Description: The Mind Tech Podcast is your weekly dose of tech, privacy, security and conspiracy. Each week we’ll talk about the very latest tech news and the continued threats to internet freedom.
    • Category: Technical
  38. The Techie Geek Podcast

  39. The Podcast

  40. This Week in Tech (MP3)

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-13
    • Description: Your first podcast of the week is the last word in tech. Join Leo Laporte, Patrick Norton, Kevin Rose, John C. Dvorak, and other tech luminaries in a roundtable discussion of the latest trends in digital technology. Winner of the 2005 People's Choice Podcast Award for best overall podcast and Best Technology Podcast. Released every Sunday by midnight Pacific.
    • Category: Technical
  41. TuxRadar Linux Podcast (mp3)

  42. Ubuntu Podcast » MP3

  43. Unseen Studio » Crivins (OGG)

  44. Unseen Studio » TuxJam (OGG)

hpr1516 :: 01 The podcasts I listen to

Released on 2014-05-26 under a CC-BY-SA license.

I listen to a lot of podcasts. I started listening to them back in around 2005 after buying my first portable player.

I now listen to podcasts to the exclusion of just about everything else and have several players which I rotate between. I gave up watching TV over two years ago. I have written my own podcatcher software based upon Bashpodder, with a PostgreSQL database to manage everything, which holds feed, episode, playlist and player details.

My interests range from Astronomy to Virology with a bias towards IT-related subjects. I currently subscribe to 85 feeds, which I present to you here in two batches. I have attached my own category to each feed, so I can load all the Science episodes on one player, and Documentary episodes on another, and so forth. I have added the category to the list as well and have sorted the list by category and the title.

Note: The list below is generated by a script which performs a query on my database. I have relied on parsing the feeds themselves for the websites, using the link value. In a few cases the value is unfortunately incorrect or missing because the feed is mis-configured.

I have included an OPML version of the list in case you want to load it or part of it into your podcatcher. Find it at

  1. Friday Night Comedy from BBC Radio 4

  2. Geologic Podcast

  3. Documentary of the Week

  4. In Our Time With Melvyn Bragg

  5. Lives in a Landscape

  6. The Radio 3 Documentary

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-04
    • Description: In-depth documentaries which each week explore a different aspect of history, science, philosophy, film, visual arts and literature. The Sunday Feature is broadcast every Sunday at 7.45pm on BBC Radio 3. Each episode lasts 45 minutes. We aim to include as many episodes of The Sunday Feature in the podcast as we can but you'll find that some aren't included for rights reasons.
    • Category: Documentary
  7. Costing the Earth

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-13
    • Description: Man's effect on the environment, questioning accepted truths, challenging those in charge and reporting on progress towards improving the world. Presenters, Tom Heap and Dr Alice Roberts, travel the UK and the world in search of solutions to the challenges facing the natural world and the people and wildlife that live in it. Broadcast at 21.00 on Mondays, Costing the Earth runs for 27 weeks of the year, split into three series. Podcast episodes are added weekly.
    • Category: Environment
  8. Mark Kermode and Simon Mayo's Film Reviews

  9. The Film Programme

  10. Escape Pod

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-12
    • Description: The Science Fiction Podcast Magazine. Each week Escape Pod delivers science fiction short stories from today's best authors. Listen today, and hear the new sound of science fiction!
    • Category: Literature
  11. PodCastle


    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-14
    • Description: is designed to provide a Chart for Creative Commons Music, in a way that is easily able to be integrated into other music shows that play Creative Commons Music. has a daily exposure podcast, playing one new track every day, a weekly podcast, playing the last week of tracks played on the podcast, plus the top rated three tracks from the previous week. There is also a monthly podcast which features the top rated tracks over the whole system.
    • Category: Music
  13. Best of Natural History Radio

  14. Coast and Country

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-08
    • Description: Countryside magazine featuring people, walks and wildlife from rural Britain. Clare Balding’s ‘Ramblings’ and ‘Open Country’ with Matt Baker and Helen Mark join forces to bring you a weekly tour of the best of the British countryside. In ‘Ramblings’ Clare joins her guests on a country walk that’s been significant in their lives. ‘Open Country’ travels to a different corner of the British Isles every week, seeking out the wildlife, the landscapes and the controversies that excite the passions of local people. Each twenty-five minute programme is broadcast on Saturday at 6.07am and repeated on Thursday at 3pm. New episodes are added every Saturday morning.
    • Category: Nature
  15. From Our Own Correspondent

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-10
    • Description: Insight, wit and analysis as BBC correspondents, journalists and writers take a closer look at the stories behind the headlines. Presented by Kate Adie. Broadcast on BBC Radio 4 in the UK on Thursdays at 1100 (local time) and Saturdays at 1130 (local time) for about 25 weeks of the year. BBC World Service broadcasts every day from Monday to Friday plus a weekend edition all year round, presented by Pascale Harter. For more information, a full list of programme broadcast times and the podcast Terms of Use go to
    • Category: News
  16. Peter Day's World of Business

  17. A Point of View

  18. Moral Maze

  19. Thinking Allowed

  20. 365 Days of Astronomy

  21. Astronomy Cast


    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-01
    • Description: Awesome Astronomy is the show for anyone and everyone who has even the slightest interest in astronomy and science. Join Ralph & Paul at the beginning of each month, for an informative and fun astronomy program exploring the mysteries and wonders of the universe. You can be guaranteed a passion for astronomy, simple explanations of complex and fundamental topics, space and science news, absorbing interviews and answers to listeners' astronomy questions. As both presenters have been accused of being a little skeptical in the past, you can also expect everything to be fact-based but frivolous, with an emphasis on highlighting the wonderful science that reveals ever more about our complex and exciting universe. Join us on our journey to understand it all!
    • Category: Science
  23. BBC Inside Science

  24. Click

  25. Discovery

  26. Dr Karl and the Naked Scientist

  27. Inside Health

  28. Naked Astronomy - From the Naked Scientists

  29. Naked Genetics - Taking a look inside your genes

  30. Naked Neuroscience - From the Naked Scientists

  31. Naked Oceans from the Naked Scientists

  32. Science for the People

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-09
    • Description: Science for the People is a syndicated radio show and podcast based in Edmonton, Alberta, that broadcasts weekly across North America. We explore the connections between science, popular culture, history, and public policy, to help listeners understand the evidence and arguments behind what's in the news and on the shelves.
    • Category: Science
  33. Science in Action

  34. The Digital Human

  35. The Infinite Monkey Cage

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-03-10
    • Description: Award winning science/comedy chat with Brian Cox, Robin Ince and guests. Witty, irreverent look at the world according to science with physicist Brian Cox and comedian Robin Ince. New Series starting on BBC Radio 4, Monday 18th November at 4.30pm (repeated on Tuesday evenings at 11pm) for 6 weeks.
    • Category: Science
  36. The Life Scientific

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-04-08
    • Description: Each week, Jim al-Khalili invites a leading scientist to tell us about their life and work. He'll talk to Nobel laureates as well as the next generation of beautiful minds to find out what inspires and motivates them and what their discoveries might do for us.
    • Category: Science
  37. - The Naked Scientists Podcast - Stripping Down Science

  38. This Week in Microbiology with Vincent Racaniello

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-01
    • Description: This Week in Microbiology (TWiM). A podcast about unseen life on Earth hosted by Vincent Racaniello and friends. Following in the path of his successful shows 'This Week in Virology' (TWiV) and 'This Week in Parasitism' (TWiP), Racaniello and guests produce an informal yet informative conversation about microbes which is accessible to everyone, no matter what their science background. As a science Professor at Columbia University, Racaniello has spent his academic career directing a research laboratory focused on viruses. His enthusiasm for teaching inspired him to reach beyond the classroom using new media. TWiM is for everyone who wants to learn about the science of microbiology in a casual way. While there are no exams or pop quizzes, TWiM does encourage interaction with the audience via comments on specific episodes, email and Skype. Listeners can also use to suggest topics for the show by submitting articles, papers, video and images to the site and tagging them with "TWiM". Each week Racaniello will view the tagged content and select items for discussion. For questions and/or feedback please email
    • Category: Science
  39. This Week in Parasitism

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-10
    • Description: TWiP is a monthly netcast about eukaryotic parasites. Vincent Racaniello and Dickson Despommier, science Professors from Columbia University, deconstruct parasites, how they cause illness, and how you can prevent infections.
    • Category: Science
  40. This Week in Virology with Vincent Racaniello

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-11
    • Description: This Week in Virology is a netcast about viruses - the kind that make you sick. Professors Vincent Racaniello, Dickson Despommier, Rich Condit and science writer Alan Dove and guests deconstruct viruses, how they cause illness, and how you can prevent infections.
    • Category: Science
  41. Doctor Who: Radio Free Skaro

    • Website:
    • Feed:
    • Format: RSS 2.0
    • Last episode: 2014-05-11
    • Description: Radio Free Skaro is possibly the most popular, most prolific and charmingly irreverent (but never irrelevant) Doctor Who podcast around. All previous episodes are available on the iTunes feed, as well as the Radio Free Skaro homepage - Enjoy!
    • Category: Sci-fi

hpr1473 :: FOSDEM Discussion

Released on 2014-03-26 under a CC-BY-SA license.

I decided to attend FOSDEM 2014 this year. I had thought about going to last year's conference but didn't get organised enough to make it. When I mentioned my plans to my friend Tom, he thought he'd attend too, and we agreed to meet up there.

When we got back from the conference I wanted to record a conversation with Tom about our impressions of the event. We tried to do this four times before we finally managed it. We struggled through one recorder battery failure and two Mumble failures before we achieved success. This is the result of our conversation.

Apologies for the phone interference in the background, I hadn't realised the recorder (a Tascam DR-07) would pick it up.


hpr1461 :: FOSDEM Keysigning Event

Released on 2014-03-10 under a CC-BY-SA license.

I attended FOSDEM 2014 in Brussels, Belgium. During the conference there was a key signing event which I attended. These are my impressions of the process and the follow-up.

Detailed notes:

hpr1362 :: Fixing a bad RSS feed

Released on 2013-10-22 under a CC-BY-SA license.

There have been problems with the podcast feed for "mintCast", apparently as a result of a bug in Wordpress. The feed contains multiple "enclosure" tags containing the same audio over and over again. While the mintCast hosts are looking for a fix I would like to find a local work-around.

I have also encountered a problem with the "Pod Delusion Extra" feed which contains multiple enclosures in some episodes. Unlike the "mintCast" example I don't want to lose these enclosures but want to find a way of repackaging them into individual episodes.

These problems affect some podcatchers, the modified Bashpodder I use being amongst them. To counteract this problem I have written two short Perl scripts to copy and clean each feed before submitting it to my podcatcher.

Detailed notes:

hpr1303 :: A Music Pairing Under Unlikely Circumstances

Released on 2013-07-31 under a CC-BY-SA license.

Today Dave interviews Tim, his son, and Tim's friend John, who is visiting from the USA.

Tim and John met on the Internet in 2006 as collaborating composers of electronic music. They have become good friends over the years; Tim has visited John in the States, in 2011 where they met for the first time in real life, for John's wedding. This also marks the first time that John and his wife Caitlin have travelled overseas, which they did to visit Tim in the UK.

In the podcast we discuss how they met, how their different world views affected each other, and how their relationship quickly transcended music.

Here's a picture of Tim and John visiting Edinburgh Castle in July 2013:

Tim and John visiting Edinburgh Castle in July

Contrary to what was said in the podcast, Tim prepared a mix of the various compositions he and John have made. Links to some of the full tracks are available below.

Here are Tim's notes for the music mix:


Some of Tim and John's work -
Their latest collaboration -

hpr1291 :: Parsing an ISO8601 formatted duration field with Perl

Released on 2013-07-15 under a CC-BY-SA license.

Ken recently asked Dave for help with a Perl regular expression for parsing ISO8601 time durations. As a consequence a Perl script was written, which is available at

In this show Ken and Dave discuss this script at some (considerable) length. Keen listeners might want to view the script as they listen. Detailed show notes describing how to put together a Perl regular expression are also available at

Unfortunately some of the line numbers in the script referred to in the show are now incorrect since Dave could not stop himself updating it.

For detailed show notes on how Dave created the script see:

hpr1286 :: iCalendar Hacking

Released on 2013-07-08 under a CC-BY-SA license.

Having failed to make repeating reminders in his calendar for the HPR Community News shows on the Saturday before the first Monday of every month, Dave resorts to writing raw iCalendar rules. This also proves to be quite difficult and a Perl script is resorted to, also with mixed success.

hpr1204 :: My Magnatune Downloader

Released on 2013-03-14 under a CC-BY-SA license.

The Problem

I'm a fan of Magnatune ( and have been buying music from them for 7 or 8 years. The Magnatune website itself is good for exploring and downloading, and interfaces for browsing and purchasing are available in a number of players on Linux. I have direct experience of:

  • Amarok: allows you to browse, purchase, examine artist information and album details.
  • Rhythmbox: the plugin, which used to allow browsing and purchasing, is currently unavailable, but is apparently due to return soon.
  • Gnome Music Player Client: (a front-end to the Music Player Daemon, mpd) offers a Magnatune browser plugin
  • Magnatune Web 2.0 player: a web-based tool which will browse, play and download Magnatune music.
  • Magnatune Android player: a fairly basic browser and player for Android 2.0 and up.

The Magnatune Web 2.0 player is the best of the bunch as far as I am concerned, particularly since it allows me to explore the music collection whilst listening to streamed music at the same time. However, none of these interfaces provide me with exactly what I want in terms of the download process, so I decided to write my own.

The Plan

I currently host my music on my HP Proliant microserver, share it across the home network, and play it with the Music Player Daemon ( on my desktop system. I normally keep the album cover image, artwork and related material in the same directory as the album itself, and I want to be able to save all files in their appropriate places automatically.

Magnatune provides an API which is documented at, though this information is only available to members. Data is available in several formats: XML, SQlite and MySQL.


I didn't want to launch into building a full-blown application, especially since I only needed a downloader, so I decided to create a collection of Bash and Perl scripts.

I decided to use the XML data organised by album. This is updated on about a weekly or two weekly basis, and there is a signalling mechanism through a downloadable file containing a checksum. When this changes the large data file has changed and can be downloaded. At the time of writing I simply run this by hand when I receive an email alert from Magnatune.

Magnatune uses an unique key made from the artist and album names which it refers to as the SKU (Stock Keeping Unit) or albumsku. They use this as an URL component and in XML tags. I use it to identify the stuff I download and to keep a simple inventory.

I decided to write some basic scripts:

  • To download the catalogue
  • To extract information from the catalogue
  • To download an album
  • To unpack the downloaded items into the target directory

I wanted to learn more about manipulating XML data, so I decided to use XSL, the Extensible Stylesheet Language. This lets you define stylsheets for XML data, including ways of identifying XML components with XPath and of transforming XML with XSLT.

I have included a number of links to the resources I used in the shownotes.


I have placed all of the scripts, their associated files, and HTML and PDF README files (extended shownotes) in a GitLab repository. This can be browsed at or, if a copy is required it can be obtained with the command:

  git clone

This makes a local git repository containing a copy of all of the files in the current directory.

Note: The code was originally hosted on Gitorious (, but with the demise of this service it was moved to GitHub and the details above updated. Then since the Microsoft takeover of GitHub, it has been moved to GitLab and the details updated as needed.


  • update_albums: a Bash script to download a new version of the album catalogue, as a bzipped XML file, if it is different from the current version. It generates a summary of the catalogue for simple searching using XSLT.
  • report_albumsku: a Bash script to take a SKU code and look up the album details in the XML file.
  • get_album: a Bash script to download an album, cover images and artwork. It takes the SKU as an argument and uses it to make an URL for an XML file which points at all of the components, and this is downloaded (with authentication). The script then parses this file to get the necessary URLs for downloading. I only use the OGG format but it could easily collect any or all formats available from Magnatune. The script records the fact that this particular SKU code has been downloaded so that it isn't collected again in error. All downloaded files are given names beginning with the SKU code and are stored for the installation phase.
  • install_download: a Perl script which unpacks the downloaded zip file to its final destination then adds the cover images and artwork to the same place. I used Perl because it allowed me to query the zip file to determine the name of the directory that was going to be created.

Further Developments

I have added further scripts to this system since I created it. I have one that synchronises the music files from my workstation to the server, and two that give me a simple wish-list or queue functionality.

Since I have a 200GB download limit per month on my broadband contract I try not to download music too often and avoid contention with the rest of the family. My queueing system is used to keep a list of stuff I'd like to buy from Magnatune, and I simply feed the top element from the queue into my download script every week or so.

In the future I expect to be refining all of these scripts and making them less vulnerable to errors. For example, I have found a few cases where Magnatune's XML is not valid and this causes the xsltproc tool to fail. I'd like to be able to recover from such errors more elegantly than I'm doing now.

At some point I may well be tempted to consolidate all of the current functions into a single Perl script.


I have no connections to Magnatune other than being a contented customer.


hpr1148 :: Development Discussion

Released on 2012-12-26 under a CC-BY-SA license.

I am trying to write a script which will implement the scheduling rules for HPR. I spoke to Ken Fallon about this, and where it would fit in the overall design of the HPR system, when we met up at OggCamp 2012 in August, but we didn't manage to resolve very much. So, recently Ken and I began a discussion over Mumble to try and make progress. A few minutes in we decided to record our discussion for posterity, and this is the result.

The notes which I had sent Ken before our Mumble session are available in PDF format.

hpr1091 :: Useful Vim Plugins

Released on 2012-10-05 under a CC-BY-SA license.

Useful Vim Plugins

I started learning vi a long time ago when I first encountered Unix systems. In those days you could usually count on a system having vi (or at a pinch, when the system would only boot into single user mode, ed). Learning Emacs didn't seem like a good choice since it wasn't usually available on the systems I was administering.

I don't remember when I changed to Vim, but for many years I have used it (actually gVim) as an IDE (Integrated Development Environment), particularly for writing Bash and Perl scripts.

In these notes I have listed some of the plugins I use to enhance Vim and gVim's functionality. If you have never made enhancements to this editor, here's a site with a very good tutorial on how to install plugins


This plugin provides a file browser within Vim/gVim. A particular directory is opened by typing :NERDTree somedir. A tree is displayed in a window which can be scrolled and traversed to find files to edit.

In case you're interested, the colour theme I use in gVim is "Murphy".

Type :h NERD_tree for the large and comprehensive help file.

I prefer to use NERDTree in gVim and not in Vim. To achieve this I have the following in my ~/.vimrc

  " NERDTree settings (only in GUI mode)
  if has("gui_running")
      let NERDTreeRoot = '~'
      let NERDTreeIgnore = ['\~$', '\.swp$']
      let NERDTreeShowHidden = 1
      let NERDTreeShowBookmarks = 1
      let NERDTreeChDirMode = 2
      let loaded_nerd_tree = 1


This one provides a Bash scripting IDE for Vim and gVim. I find it most usable in gVim where it offers a comprehensive set of menus which you can see in the example.

From the Help text:

  It is written to considerably speed up writing code in a consistent style.
  This is done by inserting complete statements, comments, idioms, and code
  snippets. Syntax checking, running a script, starting a debugger can be done
  with a keystroke. There are many additional hints and options which can
  improve speed and comfort when writing shell scripts.

The plugin can be used from the menu or by typing short-cut sequences such as \ct which inserts the current date and time at the cursor position. It's an amazingly detailed package that's well worth dedicating the time to learn if you often write Bash scripts.


This plugin provides a Perl scripting IDE for Vim and gVim. As with the Bash plugin from the same author I find it most useful from gVim where the menus can be used to perform a wide range of actions.

Again, you can use it to insert statements, boilerplate text and comments, in a similar way to the Bash plugin. You can also get regular expression help, check, run and debug the script

Two of the functions I find particularly useful are perltidy and perlcritic. Perltidy will reformat your Perl script, and Perlcritic will critique it according to the rules based on Damian Conway's book Perl Best Practices.

Note the lower window showing the various problems detected by perlcritic.

If you are a C or C++ programmer Fritz Mehner also provides a plugin for these languages here.


This is a man page viewer for use within Vim. Use :Man topic or press K on a keyword. Can view perl, php and python help.

This is a great way to view man pages, with the ability to search and cut and paste the contents.


The plugin provides mappings to easily delete, change and add "surroundings" such as quotes, braces and parentheses.

The following extract from the Help text should make this clearer:

  Consider the following examples.  An asterisk (*) is used to denote the cursor
    Old text                  Command     New text
    "Hello *world!"           ds"         Hello world!
    [123+4*56]/2              cs])        (123+456)/2
    "Look ma, I'm *HTML!"     cs"<q>      <q>Look ma, I'm HTML!</q>
    if *x>3 {                 ysW(        if ( x>3 ) {
    my $str = *whee!;         vlllls'     my $str = 'whee!';


A very powerful interface to git.

The image shows the result of the :Gstatus command which is equivalent to typing git status on the command line.


This plugin provides source code browsing by listing tags (functions, classes, structures, variables, etc.). The list is in a window in Vim or in a menu in gVim.

The plugin makes us of the Exuberant Ctags utility to index tags in a source file. I believe that most Linux distributions ship with this utility, but if not it seems to be easily available in repositories.

The image shows gVim with the tag list in a window. I find the menu in gVim more useful myself.


Provides insert completion functionality using the Tab key.

The example shows a Perl script where the choice being made from the list offered by Supertab is uptodate. Note also that manpageview is being used to view the manpage for the CPAN module.

It has taken me a while to learn not to use the Tab key to enter TAB characters but to use CTRL-Tab instead. However, I have decided that the advantages of redefining the Tab key in this way outweigh the disadvantages. You might not agree!

Become a Correspondent