A few months back I bought a BBC Micro:bit at the Science Centre in Glasgow and it's been fun building apps with the single board device. I thought I'd write a blog entry about the latest project which will be a more permanent installation in our bathroom. A toothbrush timer! Kitronik sell an add on board which provides power from a coin cell battery and a piezo buzzer called a Mi:power, they also sell a Mi:power case which is designed to fit around a Micro:bit fitted with the Mi:power. This assembly combined with some code offers a neat toothbrushing timer. By using the display on the front we provide a short countdown - with a little tune through the buzzer. The program show 6 areas of the mouth to brush each for 20 seconds before showing a toothy grin and a finishing tune. Each time the area of the mouth changes it plays a 'level up' style jingle. Links to the parts: Mi:power https://www.kitronik.co.uk/5610-mipower-board-for-the-bbc-microbit.html Mi:powe...
Recently I've been thinking about how to run a .Net application using Mono inside a Docker, along with this we'd like to use Twelve Factor config . Whilst it is possible to use some library to access environment variables instead of using appSettings it becomes difficult for database and message broker URLs which other libraries may expect to find within the App.config or Web.config file. The solution I came up with follows: Build the application without an App.config moving the existing configuration file renaming it App.config.template . Substitute any environment variables you want with ${} . E.g: <amqp> <connections> < connection name="rabbit" server="${RABBITMQ_URL}" password="${RABBITMQ_PASSWORD}" /> </connections> </amqp> Include within the Docker image a script named sub.sh similar to this and add it to /conf : #!/bin/sh while read line do eval echo ...