Hope
Xmas Geodesic
Over the Xmas holiday my friend Fenris and I built this geodesic dome (actually a truncated icosahedron) out of corrugated plastic sheets and gaffer tape.
It took about 4 hours over two sessions of cutting and then taping.
Lonely Robot
I went to the woods because I wished to live deliberately, to front only the essential facts of life, and see if I could not learn what it had to teach, and not, when I came to die, discover that I had not lived.
-- Thoreau, Walden
The 2017 Situation
A Smart Alternative to `watch make`
watch-make is a script that rebuilds your project only when make
detects it needs a rebuild, for example when source files change.
Features:
- Works with any existing Makefile based project.
- No dependencies apart from
make
. - Passes any arguments to
make
(such as-C mydir
). - Silent if there is nothing to build and does not swallow output when there is.
I wrote it in response to this Stack Overflow question.
The source code is hosted on GitHub.
Install it
curl -s https://raw.githubusercontent.com/chr15m/watch-make/master/watch-make > ~/bin/watch-make
chmod 755 ~/bin/watch-make
Full source code
#!/bin/sh
while true;
do
if ! make -q "$@";
then
echo "#-> Starting build: `date`"
make "$@";
echo "#-> Build complete."
fi
sleep 0.5;
done
Lost Town Of Belgium
Scout and I made this stop-motion short film.
How we made it:
- We used an old Android phone with one of those $10 phone tripods to take each frame.
- We flipped through the stills in Ristretto by hand, recording the output with RecordMyDesktop.
- We used avconv to convert between formats.
- We used Audacity to record the audio.
- We used OpenShot to edit the video.
Clerk: Event Logging Web App
There are times in life when you need to keep track of periodic events as they happen. For example when you have a new baby it is sometimes useful to keep track of when they feed, nappy changes, etc. Another example might be tracking how often you eat chocolate or drink beer.
Clerk is a simple self-hosted web application that I built which you can install to the home screen of your device (by doing "add to home screen" in your browser) or load up on your tablet or laptop. You can then keep track of simple events with two taps on your device - once to open the app and once to record the event.
For every event logged the event type
, timestamp
, and comment
are stored in CSV files. Events are stored in individual CSV files - one file per event type. You can also download all CSVs stiched together with an extra column for the event name.
Features
- Web based.
- Easy to deploy.
- Self-hosted & FLOSS.
- Simple text based CSV format.
- Allows multiple people to log events.
- Mobile friendly - "Add to Home Screen" web-app.
Install
- Download a release or get the source code with
git clone https://github.com/chr15m/Clerk.git
. - Copy the files to your PHP web hosting.
To require authentication, first create a password file:
htpasswd -c /path/to/.htpasswd username
Then copy ./example.htaccess
to .htaccess
and edit it.
Enjoy!
Cloud Notepad
I love this piece of software and I use it every day. It is a simple note taking application which syncs across all of your devices. It is a self-hosted single-page web app that runs on a PHP server and does not require a database.
I run a copy on my phone and a copy on my laptop.
- I used
Add to homescreen
on my phone so that it gets an icon and launches full-screen. - I'm using this site-specific browser trick to run the app in its own window on my desktop.
The app was built by Kaspars Dambis and I forked it to modify the design and add some usability tweaks like ctrl-S
to force sync. You can find the source code of my fork on GitHub if you want to install it yourself.
The Mountains
Lovelace Day 2017
A non-exhaustive list of technologies that I used this year which happen to be built by women:
- Carmen La's Clojurescript Reagent Markdown component ("Cryogen" is also neat).
- Katja Vetter's pd-lib-builder Makefile.
- Lea Verou's minimal CSS spinner (Mavo is also amazing!).
- Jessica Kerr: "My First Leiningen Template".
- Mary Rose Cook's game "Empty Black".
- Maria Geller's CLJS Javascript integration.
- Charlie Gerard's VR Threejs cityscape.
- Limor Fried (ladyada)'s Neopixel driver code (and several other bits of code for driving hardware and microcontrollers).
- My colleague Priyanka's excellent work on the Culture Counts software stack.
I feel grateful to these people for enriching technology with their contributions.
Technological Artifact
In the style of this guy in the style of Scott Robertson space ship sketches.
Other Worlds
I just finished another sketchbook.
Recently a friend linked me to The Etherington Brothers and I've been doing their tutorials.
Lately I've been concentrating on plants.
The 2018 Situation
Tech Nugget
Tiny Core Linux on Raspberry Pi
I'm discovering Tiny Core Linux, a beautifully executed, minimalist, immutable-by-default GNU/Linux distribution that runs nicely on the Raspberry Pi and other x86 and ARM devices.
The documentation is comprehensive but arcane so here are my field notes.
I'm using piCore the Raspberry Pi variant of TinyCore but most of these notes should work for other variants too. These notes assume you are already a GNU/Linux desktop user and know basic Linux command line fu.
I'm a huge fan of this distribution!
Here's the official README for the Raspberry Pi version.
Write the disk image to your SD card
sudo dd if=piCore-9.0.3.img of=/dev/mmcblk0
Make sure you get your sd card's device (e.g. mmcblk0
) correct so you don't overwrite the wrong disk!
Tip: you can see where dd
is up to by sending it a signal:
sudo kill -SIGUSR1 `pgrep -f mmcblk0`
After this put the sd card into your Raspberry Pi and it'll boot Tiny Core Linux with an SSH server running so that you can access it remotely over the network.
Find the Pi on your network
find-pis: use this little script to find the Raspberry Pi on your network so that you can ssh to it.
Default login:
username: tc
password: piCore
Immutable by default
Tiny Core Linux is a perfect fit for Raspberry Pi because it does not write to disk by default. Note that between reboots if you want to persist any changes you've made, you need to do it manually with filetool.sh -b
. You'll especially want to do this after first boot to persist the SSH server keys. This includes any changes you make to files in the home directory.
This lack of disk writes is a huge boon because it prevents issues that distributions like Raspbian have with SD card corruption when you power off the Raspberry Pi. Immutability is also just a good thing generally for building robust software systems.
Tiny Core Linux package repository
The packages are .tcz
files which like most package formats are a zipped up collection of files with some metadata. You can browse the packages available to the Raspberry Pi distribution.
Various useful commands
Persist current state to disk:
filetool.sh -b
Where to specify additional default file locations for persistence:
/opt/.filetool.lst
Download and install packages (nodejs binary package in this example):
tce-load -wi node.tcz
Show which packages are currently installed:
tce-status -i
Install a package for doing C/C++ compilation & development:
tce-load -wi compiletc
Find current OS version info:
version
Search for and install packages with console UI:
tce
Where to put your own startup and shutdown scripts:
/opt/bootlocal.sh
/opt/shutdown.sh
Getting WiFi working
You'll want the packages wifi
and firmware-rpi3-wireless
and then reboot and set up a connection:
sudo wifi.sh
Don't forget to persist your changes.
Getting sound working
You'll want the alsa
and alsa-utils
packages.
I managed to compile Pure Data and output a basic test tone. I went into the src
folder of Pd and issued make -f makefile.gnu
to build it from the source after checking it out from git.
GPIO access
I managed to interface with the Raspberry Pi GPIO by installing node
and then using the onoff
package installed via npm
. Lots of dev packages were required for a successful build (compiletc
probably covers most of them). Each time npm threw an error I looked at what the error message was to determine which package to install next until it built successfully.
I managed to get an LED to blink on pin 16 with this code:
var Gpio = require('onoff').Gpio;
led = new Gpio(16, 'out');
led.writeSync(1);
c = 0
setInterval(function() { led.writeSync(Number(c = !c)); }, 1000);
I had to run node
as root to get access to the GPIO.
Philosophical waxing
GNU/Linux has now been subsumed into the technological substrates of the world. It is found in most phones, servers and appliances that people interact with every day. There are probably 10 copies of Linux running in the median developed-world household. It has become infrastructure, like roads and wires and water pipes.
I don't see that many young people at GNU/Linux meetups these days. I don't think we GNU/Linux nerds are required by the world in the same way that we were before when it was sparkly and new.
It's exciting for me to find Tiny Core Linux which has re-ignited the spark of enthusiasm for this technology.
Internet of Things Questions
A list of real questions that could be answered by teensy little technology nuggets.
- In which physical folder is my child's birth certificate?
- What items of mine are not here?
- How much hand soap refill is left in my bathroom cupboard?
- What is the smallest storage space in which I can fit all of my furniture?
- Which items that I own do I never use?
- At what time of day do I interact with different items I own?
- What is the total weight of my filing cabinet and work desk?
- I need a new one of these, pull up the page where I purchased it in my browser.
- This thing does not belong to my grandmother. Who did she borrow it from before she died?
- List the items in my craft box which have "needle" in the name.
- How much television are my kids watching and what percentage are educational shows?
- Are there any NE5532s in my tool box?
- Graph my family's diet composition. How much of it is fresh food?
- Place a grocery order under $50 for the items I most commonly use that I will soon run out of.
- Search all of the physical books in my personal library for the following phrase.
- Are my running shoes in this house or the holiday house?
- We are leaving this hotel. Have we packed everything?
- Where have I put my phone and keys?
Most of these question could be answered without an internet connection. "Of Things" sounds kind of weird by itself though.
"Internet connected lightbulb" does not provide a use-case that anybody wants or needs.
The things should be telling us their data. They should not be telling corporations our data.
What you want is dumb little things that do one thing well. Good traditional design plus CPU, I/O, and memory.
Things that talk straight to us [and nobody else] with IR, sound, light, QR code, and raw radio.
Is there a word for "Internet of Things" objects which don't have an internet connection?
Maybe "ov things" lol.
"Neat little ov thing you got there friend."
Plastimake's Great for Making Homethings
A couple of years ago my friend Joe recommended this stuff called Plastimake to me.
It is a hard plastic which goes soft and malleable at around 60 degrees celcius. You drop some in boiling water until it goes clear and soft and then you can mold it into whatever shape you want. It cools and hardens again quickly in whatever shape you have molded it into. You can re-heat it to soften and re-use it again.
Scout and I have used it several times to hand craft little figures for play. I've also used it around the home and when prototyping things as it's a very quick way to get a hard plastic into exactly the shape you want.
Here's their video which is clear and honest:
Scitech Show
I'm playing a show tonight at the local science education centre, Scitech, for their adult event, After Dark.
I'll play live electronic music using some Gameboy, Commodore 64, and Raspberry Pi gear and algorave Pd patches. I'll also give a little talk about the tech and how it works.
Across the Sea of Space
Browser Blockchain in ClojureScript
I built a little blockchain-in-a-browser in ClojureScript to help understand the underlying algorithms.
You can simulate a network of peers by opening multiple browser tabs. Each peer can mine blocks and make transactions independently and the resulting blockchain will resolve conflicts correctly across all tabs.
A blockchain works by laying down a chain of blocks of transaction data.
Each block in the chain contains a cryptographic hash with two important properties:
- It proves a link to the previous block.
- It proves that difficult computational work has been done.
The proof-of-work is accomplished by iteratively updating a nonce until a low-probability hash is discovered.
These two properties mean a blockchain is digital amber.
If somebody wants to modify a transaction deep inside the amber it would be very difficult because they would have to re-create every layer of the blockchain by doing as much work as the original process required.
In my browser blockchain the hashing is implemented like this:
(hash-object [timestamp transactions previous-hash nonce])
As you can see the previous block's hash is included in the current block.
The hashing is performed iteratively in a loop until a hash with at least one byte of leading zeroes is found:
(loop [c 0]
(let [candidate-block (make-block (now) transactions previous-hash new-index (make-nonce))]
(if (not= (aget (candidate-block :hash) 0) 0)
(recur (inc c))
candidate-block)))