Aurélien Gâteau

Pixel Wheels 0.16.0

written on Sunday, April 19, 2020

I finally found the time and motivation to get a new version of Pixel Wheels out, so here comes 0.16.0.

Not many engine changes in this new version, mostly new content: first a new track: "Welcome". This track takes place in the countryside, so you'll race among fields and should spot an old tractor. As its name imply it's a simple track, designed to be the track new players begin with.

Welcome track

It is part of a new championship called "Country Life", which for now contains only this track, so it's very short... I plan to add a new track to it in the next version.

The other content addition is a new car: the Dark M.

Dark M

It's a bit longer than the others. Maybe I should shorten it a bit, what do you think?

Generating reports with Python, Markdown and entr

written on Monday, April 13, 2020

Let's say you need to parse and analyse some raw data, for example a log file, to generate a report.

An easy way to get started with this is to write some Python, Perl, Ruby or shell code to work on your file and print meaningful information about it.

To illustrate this article I am going to write a Python script to "analyze" the var/log/syslog log file, whose entries look like this:

Apr 12 11:53:42 dozer org.kde.KScreen[6995]: kscreen.xrandr: #011Primary: false
Apr 12 11:53:42 dozer org.kde.KScreen[6995]: kscreen.xrandr: Output 68 : connected = false , enabled = false
Apr 12 11:53:43 dozer org.kde.KScreen[6995]: kscreen.xrandr: Emitting configChanged()
Apr 12 11:53:47 dozer dbus-daemon[991]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.416652' (uid=1001 pid=7186 comm="/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdev" label="unconfined") (usi
Apr 12 11:53:47 dozer org.kde.powerdevil.backlighthelper: QDBusArgument: read from a write-only object
Apr 12 11:53:47 dozer org.kde.powerdevil.backlighthelper: message repeated 2 times: [ QDBusArgument: read from a write-only object]
Apr 12 11:53:47 dozer dbus-daemon[991]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'
Apr 12 11:54:04 dozer kernel: [716525.975149] usb 3-2: USB disconnect, device number 64
Apr 12 11:54:04 dozer kernel: [716525.975156] usb 3-2.1: USB disconnect, device number 65
Apr 12 11:54:04 dozer kernel: [716526.040164] usb 3-2.3: USB disconnect, device number 66
Apr 12 11:54:04 dozer upowerd[1672]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1/3-2.1:1.0/0003:046D:C046.0025
Apr 12 11:54:04 dozer upowerd[1672]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1/3-2.1:1.0
Apr 12 11:54:04 dozer upowerd[1672]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1
Apr 12 11:54:04 dozer acpid: input device has been disconnected, fd 6

The script is going to take the log entries from stdin, iterate on the lines and produce a report on stdout.

Parsing the log file

The first thing to do is to parse the log file. Since we read the log from stdin, we can start with something like this:

import sys

def parse_line(line):
    # TODO

def parse_log():
    for line in sys.stdin.readlines():
        entry = parse_line(line)
        if entry:
            yield entry

def main():
    for entry in parse_log():
        print(entry)

if __name__ == "__main__":
    main()

Introducing Git Bonsai

written on Sunday, March 22, 2020

I don't know about you, but when I work in a git repository for a long time, I tend to accumulate branches, which I need to clean up.

There are a number of tools to do this, but since I have been teaching myself Rust I thought it was a good topic for a first "real" program. So here is "Git Bonsai", a command-line tool to help you keep your git repository clean and tidy by:

  • updating all branches to their remote ones
  • deleting the merged branches

For example, given a repository like this:

$ git log --all --oneline --graph
*   f97c782 (HEAD -> master) Merging topic1
|\  
| *   f6bfa90 (topic1) Merging topic1-1
| |\  
| | * 6943ed2 (topic1-1) Create topic1-1
| |/  
| * 4ea41ff Create topic1
|/  
| * eec4ebe (topic2) Create topic2
|/  
* b8b1506 Init
$ git branch
* master
  topic1
  topic1-1
  topic2

Bluetooth Speaker part 5 - Electronics, take 3

written on Sunday, March 8, 2020

This article is part of a series on creating a Bluetooth speaker from an old vacuum tube radio and spare parts I had lying around in the house.

If you remember well, my first attempt at electronics for this Bluetooth speaker project was using an all-in-one Bluetooth + amplifier board. It did not go well, so I tried to use the guts of an existing Bluetooth speaker instead. That almost worked, but I experienced stability issues I was not able to solve :(

This article is about the third attempt: following the instructions from the Radio Workshop (which I mentioned at the end of part 3) to get a working Bluetooth + mono amplifier (hopefully).

Pixel Wheels 0.15.0

written on Sunday, February 9, 2020

I am happy to announce the release of Pixel Wheels 0.15.0, the first version of year 2020! This version could almost have been called 0.14.2 as it's mostly made of bug fixes. Take this as an hint that the game is almost feature complete... at least that is how I analyze it :)

What's in this new version, you ask?

Bluetooth Speaker - Part 4 - Frontend work

written on Sunday, January 26, 2020

This article is part of a series on creating a Bluetooth speaker from an old vacuum tube radio and spare parts I had lying around in the house.

So, while I was waiting for the components I ordered at the end of part 3 to arrive, I spent some time working on the "frontend": the front panel of the radio.

In case you forgot, this is what the original front panel looked like at the beginning:

  • The front panel

After some work on the cabinet itself, the wood looked much better:

  • After tainting and varnishing
  • Speaker mounted in

But the original radio had a cloth and a grille to hide the speaker, so there was more work to do on the front side.

Bluetooth Speaker - Part 3 - Using an existing Bluetooth speaker

written on Monday, January 13, 2020

This article is part of a series on creating a Bluetooth speaker from an old vacuum tube radio and spare parts I had lying around in the house.

So after the failure of part 2, I decided to try a seemingly safer approach: buy a small Bluetooth speaker, tear it down and use its guts to power my radio.

I bought a small portable Grundig GSB 710 Bluetooth speaker. It's a mono speaker, but since the radio I am working was also mono, as was common by the time it was created, it felt like a good fit. I checked it worked and started to tear it down:

  • Opening the box
  • Main circuit is out, unplugged from its speaker
  • Control board removed
  • Soldering wires to the ribbon cable, ghetto-style, because I didn't have any connector handy
  • Covering the mess with thermoretractable tube

Bluetooth Speaker - Part 2 - Attempting to update the audio hardware

written on Monday, December 30, 2019

This article is part of a series on creating a Bluetooth speaker from an old vacuum tube radio and spare parts I had lying around in the house.

As I explained in part 1, the electronics looked too old so I decided to replace it with a small Bluetooth audio amplifier board and two loud speakers.

I ordered a TPA3116D2-based Bluetooth amplifier from Nobsound and a pair of MTX TX450C, 4 Ohms loud speakers.

  • The Bluetooth amplifier
  • The loud speakers

Bluetooth speaker - Part 1 - Introduction

written on Wednesday, December 25, 2019

This article is the first of a series on creating a Bluetooth speaker from an old vacuum tube radio and spare parts I had lying around in the house.

At the time I am writing this, the speaker is not done yet, so there is still a chance that I never finish it... As you will see, the journey so far as not been straight, I hit a few roadblocks and changed my mind while working on this project.

Let's start with the reason I started this project. When we moved in our house, more than a decade ago, I found this old vacuum tube radio left around by the previous owner:

  • The radio

I have always wanted to make something out of it, but never took the time to do so, until last month.

Pixel Wheels 0.14.1

written on Monday, November 18, 2019

Last week I released version 0.14.1 of Pixel Wheels (I am a bit late with the announcement, it has been a busy week).

The "Side buttons" input mode

I am happy to say this is the first release to include changes from other contributors, thanks to Tim Schumacher and Julien Bolard!

Here are the most important changes: