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

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.



Welcome to HPR the Community Podcast Network

We started producing shows as Today with a Techie 11 years, 7 months, 25 days ago. Our shows are produced by listeners like you and can be on any topic that "are of interest to Hackers". If you listen to HPR then please consider contributing one show a year. If you record your show now it could be released in 22 days.


Latest Shows


hpr2302 :: Bash snippet - nullglob

After learning about the nullglob option I have started to use it


Hosted by Dave Morriss on 2017-05-30 is flagged as Explicit and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Bash Scripting | Comments (0)

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"
  9 
 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.


hpr2301 :: Baofeng UV5R VHF/UHF Handset part 3

An in depth series about the Baofeng UV5R VHF/UHF hand-held transceiver.

Hosted by MrX on 2017-05-29 is flagged as Clean and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: QSK, HAM radio | Comments (0)

This episode will be right up your street if you like rambling podcasts.

I planned to cover the supplied accessories of the Baofeng UV5R VHF / UHF Hand Held Transceiver however somewhere along the line I rambled off topic and started blathering on about a whole range of topics.

I cover the VHF / UHF spectrum, radio frequency, wavelength Omni-directional antennas, mains hum time stamp fingerprinting among other things.

Sit back and enjoy.


hpr2300 :: The first Intel CompuStick

A talk about the original intel compute stick with ubuntu factory installed


Hosted by JWP on 2017-05-26 is flagged as Explicit and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (1)

Well basically the stick out of the box was not very usable. I had to struggle with it for a long time to make it work for me doing even the most basic tasks. I went to http://linuxiumcomau.blogspot.com/ and things got better.


hpr2299 :: What's in My Bag

Here are the five items in the bag I take to my job.

Hosted by Shane Shennan on 2017-05-25 is flagged as Clean and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: What's in My Toolkit | Comments (0)

A computer instructor explains why there is a flashlight, a flash drive, a set of picture dice, a small notebook, and a cell phone in his bag.


hpr2298 :: Phantom Power Drain

diagnosing a phantom power drain on an automobile


Hosted by brian on 2017-05-24 is flagged as Explicit and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (2)

  1. disconnect negative battery cable.
  2. connect multimeter between battery and cable.
  3. read amp draw... 15-20 millivolts milliamps is on the high end.
  4. unplug fuses one at a time, until the problem circuit is identified.

... some lip smacking, and vocal fry.

Corrected 2017-05-27 - Editor


hpr2297 :: More Magnatune Favourites

Andrew and Dave offer you some more tracks from Magnatune


Hosted by Dave Morriss on 2017-05-23 is flagged as Explicit and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (2)

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.


hpr2296 :: Baofeng UV5R VHF/UHF Handset part 2

An in depth series about the Baofeng UV5R VHF/UHF hand-held transceiver.

Hosted by MrX on 2017-05-22 is flagged as Explicit and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: QSK, HAM radio | Comments (0)

In this episode I go through the general specification of the Baofeng UV5R VHF / UHF Hand Held Transceiver


hpr2295 :: MX Linux

Show about my latest Linux Distro find

Hosted by Tony Hughes AKA TonyH1212 on 2017-05-19 is flagged as Clean and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Hardware upgrades | Comments (1)

MX Linux OS

Hi To all in HPR land, this is Tony Hughes in the UK back with you. I noticed that the queue has a couple of gaps in the next week or so here goes again.

Apart from my last show I've recently done shows on current Linux distro's that are suitable for older hardware but with a modern look and feel and fully featured with the latest software available.

As you have probably gathered by now if you have listened to my other shows I am a big fan of older Lenovo Laptops. My main Lenovo is an X230i i3 with a 2.5G cpu and 8Gig of Ram and a 120Gig SSD, it did have Mint 17.3 running on it and after running Mint 18 / 18.1 for several months on my desktop PC I decided to upgrade to 18.1 on the X230i.

I completed the install and on first boot after install the boot time had risen from about 40s to over 2 minutes, I suspected a problem with the install so did it again with the same result. I couldn't find any issues reported on the net so resorted to installing Linux Lite which is based on Ubuntu 16.04 as is Mint 18. The problem persisted after this install despite getting near 40s boots on the Lenovo X61s with an SSD and the same Distro.

I did another web search but could not find any other reports of this issue with the X230i so put a post on the Facebook community Distro hoppers. The response I got back from one member was to try MX16.

MX Linux is a joint venture from the antiX and former MEPIS communities and is based on the latest Debian Stable "Jessie" with the XFCE desk top environment.

I duly downloaded it and installed it in a Virtual PC using virtual box to see what it looked and felt like. The install is fairly user friendly although if you've never had experience of Linux and installed other Distributions a new user may be a bit unsure when asked about the MBR and where to put it, other than that a fairly straightforward install.

On install there is a fairly good selection of the software you would need including a full install of LibreOffice, FireFox, Thunderbird, GIMP and synaptic package manager for adding further software from the repositories. MX have also included the ability to simply install codecs and additional drivers and a software installation system for popular Apps from the MX Welcome that comes up at boot or if disabled can be started form the menu. Also I installed it on a virtual 8Gig HDD and GParted reports use of 4.64Gig after install and updates, by default it only installs a 1G swap despite 2Gig allocated Ram in the VM.

I liked the look of MX and decided to give it a go on the X230i, install went smoothly and lo and behold boot was back to around 40s on first boot after install. So I've updated the install, installed my packages I use that are not there by default such as Audacity, Scratch and a couple of other things I use. I've also put it on the X61s I use and again working faultlessly, so I'm happy again. Since I installed MX I found out from a member of my Makerspace/LUG that he had experienced the same problem with Ubuntu 16.04 based distro's and crippled SSD Boot times.

I like MX so much when it come to time to reinstall my Desk Top PC, which is about the only PC I use that is not constantly changing OS, I think I will be putting MX on it. This is a big deal for me as I've been a loyal Mint user for over 5 years but MX is working so well on the Laptops at the moment it would be good to have the same OS on the Desktop PC as well.

Will MX stop my Distro Hopping, NO, I like trying out new things that's why I have several Laptops kicking around so I have spare hardware to try out new Linux stuff, but it is good to have something stable around when you need it, hence sticking with Mint for so long on the Desktop.


hpr2294 :: Activities with a Toddler

11 things you can do with a toddler you are taking care of.

Hosted by Shane Shennan on 2017-05-18 is flagged as Clean and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (5)

Here is the list I check when I am looking for something to do with my toddler. Note that these are good indoor activities.

[ ] Milk and TV
[ ] Duplo
[ ] Dollhouse
[ ] Meal preparation
[ ] Mixing bowl
[ ] Crafts or painting
[ ] Sink time
[ ] Chasing and tickling
[ ] Reading
[ ] Cat videos
[ ] Container of similar things

hpr2293 :: More supplementary Bash tips

Finishing off the subject of expansion in Bash (part 2)


Hosted by Dave Morriss on 2017-05-17 is flagged as Explicit and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Bash Scripting | Comments (8)

More supplementary Bash tips

Pathname expansion; part 2 of 2

Expansion

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.

Older Shows

Get a full list of all our shows.