BBC micro:bit expoloration

On a whim I nipped out and bought the only BBC micro:bit in stock at PB Tech in New Plymouth as I was curious to have a play and see where it might fit in between Raspberry Pi’s and Arduino’s for teaching kids.

I thought turning it into a simple digital watch would be a fun place to start learning so, below is the result.

The virtual micro:bits, below, are interactive so click on the ‘shake’ button to simulate shaking it in real life to display the time.


Pi-hole in a Docker Container on a Raspberry Pi

While I was disappearing down a rabbit hole investigating unbound as a DNS Privacy server, I came across Pi-Hole – A black hole for Internet advertisements.

I’ve always used uBlock Origin for ad blocking but that is a per client thing which is a bit of a hassle.

Pi-hole provides ad blocking for all clients on the network, seamlessly.  I just configure DNS on each client, via DHCP, to point towards the Pi-Hole server.

Obviously, I love Docker so it’s in a Docker Container on a Raspberry Pi.

Currently, I’ve sacrificed DNS privacy but I’ll work on that later in terms of getting Pi-hole to send all DNS queries through my own DNS server.

This is how I implemented it.  Obviously, these aren’t detailed instructions but more of a reference to jog my memory if I need it!

Note: Substitute the IP address of the host that the Container is running on for ${IP} and ${IPv6}



Raspberry Pi Docker Container to send all LAN DNS requests to Cloudflare’s DNS over TLS

I wanted to implement this on a Raspberry Pi that I have running Docker.  However, I wasn’t able to find an image in Docker Hub for the ARM architecture that the Raspberry Pi uses so I made my own based on the x86-64 image, here.

  • Place the Dockerfile and unbound.conf in the same directory.
  • Docker file:

  • unbound.conf:


  • Build the Docker image:


  • Start a container as a daemon from the above image:


  • Configure all clients to point to the IP address of the Docker Host for DNS.

Install pip on OS X via Terminal


Wordpress is loading infos from ahmadawais

Please wait for API server to collect data from

Get Stock Quote from Yahoo using Node-RED

School Coding Class – 003

After getting to know the children, over the last two sessions, and finding out their strengths, I’ve decided to take a little detour from Scratch to a slightly more guided programme on

The children can continue the course at home if they’d like to – they’ll just need to remember which step they are up to in class!  If they would like to save their progress then feel free to create an account for them.

The course we’ll be following is here 🙂

School Coding Class – 002

One of the children in the group came up with a solution to what we were exploring.   The solution was very close to what I first came up with in My Original Blog.  Coincidentally, that night, I was reading a blog called ‘Applying the Linus Torvalds “Good Taste” Coding Requirement‘.  It made me go back and examine my solution and explore other options in Scratch.

My next solution got rid of all of the conditional ‘If Then’ statements and utilised lists, instead.  I wouldn’t expect any of the children to come up with this solution but it has certainly been an interesting exercise for me as I explore Scratch, as well!

I’ve shared the code here.

Scratch Code for Challenge 1

School Coding Class – 001

In the class, we are starting to learn some programming.  The language we are using is called Scratch.

Scratch is a free visual programming language. It is aimed at young people, mainly 8 years old and up, with a purpose of helping them learn programming.

Scratch is available online and it’s easy to create an account if you’d like to use it outside of school.  Just follow this link.

The first challenge we are working on is below!

Get Scratch to draw a shape in a random location on the screen:

The shape must have a random number of sides between three and eight

If the shape is a triangle, it should be RED
If the shape is a square it should be ORANGE
If the shape is a pentagon it should be YELLOW
If the shape is a hexagon it should be GREEN
If the shape is a heptagon it should be BLUE
If the shape is an octagon it should be PURPLE

Repeat the above forever.

The video, below, shows what we are hoping to achieve.

A solution for this challenge may look something like this:

Scratch Code for Challenge 1

While the code took me ten minutes to write, it will be a significant task for the children which gives some terrific real world challenges for them to explore.  We will build on ideas and concepts in small stages working up to a complete solution.

The ideas and concepts include:

  • Events
  • Angles
  • Positive and negative integers
  • Random numbers
  • Coordinates on an x and y axis
  • Variables
  • Conditional expressions
  • Iteration (Looping) – Count controlled and continuous

Of course, along the way, the children discover different things that interest them which they add to their code which adds to the fun 🙂

There’s a wonderful TED video, below, which talks about teaching kids to code with Scratch.