Run Multiple Bash Commands In Parallel

Bash, whilst great for simple things, can be tricky to use more advanced programming techniques that are easily exposed in things like Java, or Go. Multithreading is one such problem. I often find myself with a series of tasks to perform that I’d like to run in parallel up to a predefined concurrency threshold. My

LEAP#396 Capacitive Touch Organ

The MPR121 is a capacitive touch sensor. Originally produced by Freescale (now NXP), the part is end-of-life but still widely available, especially on breakout boards.

I wrote some code and built a little penny (5 cent actually) organ to test it out. It implements a simple 12-tone (chromatic scale from C5/523.25Hz) organ:

  • on interrupt from the MPR121..
  • uses the Adafruit_MPR121 library to get touch state via I2C/Wire
  • sounds the corresponding tone with a speak (more...)

LEAP#395 8051 Programming with SDCC

The main purpose of this program is simply to have something for testing the LEAP#394 AT89C2051 Programmer, and also my first trial of SDCC - Small Device C Compiler.

It is almost but not quite the simplest LED blinky program possible. It blinks an LED on P1_0, using a do-nothing loop to approximate 1Hz cycle time.

I’m impressed. For a chipset that is meant to be long dead, getting a C toolchain up and (more...)

LEAP#394 Arduino 8051 Programmer

I’ve been meaning to dive a bit deeper into Intel MCS-51/8051 devices and programming ever since I built a Electronic Clock Kit powered by an AT89C2051.

Reading the AT89C2051 datasheet, its seems programming is actually a quite straight-forward process - the only complication being the need for a 12V programming voltage in addition to standard logic high of ~5V.

So while I could go out and buy a programmer, I found the idea of building (more...)

LEAP#393 Dickson Charge Pump

The Dickson Charge Pump is a neat trick for multiplying an input voltage. It is basically a capacitor bucket-brigade, with diodes for flow control, and a switching signal to make it go. It is not the most efficient voltage booster, and cannot drive very high currents, but may be a convenient solution depending on the application.

The version I’ve implemented here runs on an Arduino with a 62kHz PWM signal and generates a zener-regulated 12V (more...)

LEAP#392 BoldportClub Whiteboard

The BoldportClub project #22 whiteboard is a neat little “breadboard enhancer”, featuring variable and coin-cell power supplies and prototyping areas. As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub

hero_image

Here’s a simple demonstration using the 4 LEDs on the shroud as outputs for a 4-stage CD4060 ripple counter:

Also included is a sheet of StickerCAD icons. I used them on my laptop case - including a (more...)

LEAP#391 Packaging the mV Meter

A while back I breadboarded an ATmega328-based millivolt meter based on a design by Scullcom Hobby Electronics. It uses an LTC2400 ADC and LT1019 voltage reference, and has some nice display modes on a 16x2 LCD.

It’s a nice design so I decided to go the whole hog and fab a PCB at OSHpark, but this time using EasyEDA for the schematic capture and board design. Althoughit’s PCB design tools are relatively primative, it (more...)

LEAP#389 Two-Stage Amp Design

Reviewing techniques for two-stage CE amplifier design. My calcs are a bit off (under-estimated gain), but I got a workable Class A amplifier out of it! As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub hero_image

LEAP#387 GPS Modules

This is the first time I’ve played around with a GPS module, so it was an interesting dive into NEMA standards. But at the end of the day, the TinyGPSPlus library makes it a piece of cake to get GPS readings. I log these to serial and display the main facts on an LCD. As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub hero_image

LEAP#386 The Blue Pill

Popularly known as the Blue Pill, the STM32F103C8T6 Minimum System Development Board seems like an excellent gateway drug for getting into ARM Cortex-M3 development.

This is particularly true as it is possible to program it with the familar Arduino IDE.

It is my first look at one of these boards, so I have simple expectations - follow along some of the tutorials on the web/youtube and at least get a simple program running on (more...)

LEAP#385 BolportClub Widlar Blinky

The µA723 voltage regulator is a classic from 1967, and was celebrated in the Boldport Club “Widlar” (Project #21). It is a bit boring to just regulate voltage, but since the µA723 contains an error amplifier and voltage reference … yes, it is possible to make an oscillator instead. My version of the Widlar glows an orange LED…

As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on (more...)

Oracle ORA-02287: sequence number not allowed here

I’ve recently hit an issue when trying to include a sequence.nextval in an Oracle database view. the database throws the following error: [crayon-5aba534de1f38771671729/] I can see why that might not be allowed – each time you select from the view you’ll get a new sequence number making it a bit daft for most circumstances. I

Oracle View Sequence Test

[crayon-5aba534de29e0881227783/]  

Move Proxmox Container to Different Storage (Updated for LXC)

The Proxmox Web GUI does not give us the ability to migrate a container from one storage device to another directly. To move a container onto different storage we have to take a backup of the container and restore it to the same ID with a different storage device specified. This can be time laborious when working

Reduce Proxmox LXC Backup Size and Time

Proxmox backs up guests byte-for-byte in a compressed archive. Looking at LXC backups specifically, the file system is compressed into the target backup file with just a few exceptions – temp files aren’t included. You can also add your own exceptions by editing the vzdump.conf to exclude specific file patterns. All that said, one of

Generating Diceware Passwords in Python

Today I’m going back to a theme from a post last year and looking at generating passwords with my favourite programming language. A tweet from Simon Brunning pointed me to Micah Lee’s article at The Intercept and my first thought was to write a function to do this in Python. So here it is;

def generate_diceware_password(word_count=6):
    import random
    word_dict = {}
    passphrase = []
    with open('diceware.wordlist.andy.txt') as f:
        for line in f. (more...)

Teaching an old dog to Fish

Inspired by the recent furore around Shellshock I decided that it was time to try an alternative to bash. By the very grown up process of shutting my eyes and poking my finger at the results of a search for “shell” I ended up at fish shell, described by the project as “a command line shell for the 90s”. I’m presuming that this means the 1990s and is not a minimum age requirement.

I’m (more...)

Generating Reasonable Passwords with Python

Thanks to a certain recent Open SSL bug there’s been a lot of attention paid to passwords in the media. I’ve been using KeePassX to manage my passwords for the last few years so it’s easy for me to find accounts that I should update. It’s also a good opportunity to use stronger passwords than ‘banana’.

My problem is that I have always resisted the generation function in KeePassX because the resulting strings are very (more...)

My Career

The next time anyone asks me what I do for a living I’m just going to point them to this YouTube video.

Found on the twitters thanks to Nick Hodge and Jess Dodson.

Howto debug Mendix java actions

To debug Java Actions used in a Mendix Microflow you need to make some configuration changes to the way you start the Mendix runtime.

Add the following in your project settings, in server configuration add the following to Extra JVM parameters:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

Mendix Project Settings

Start your application in Mendix.

In your Java IDE you need to configure remote debugging. The following screenshot shows my configuration in IntelliJ

Mendix Intellij remote debugging

Start the debugger, put some breakpoints in your (more...)