Quantcast
Channel: Chris McCormick - News
Viewing all 234 articles
Browse latest View live

Hope


Xmas Geodesic

Lonely Robot

0
0

Simple line sketch of a robot walking in a natural scene.

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

0
0

IMG_20170506_150538.jpg

No point crying!

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

A Smart Alternative to `watch make`

0
0

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

0
0

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

0
0

Screenshot

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.

Screenshot 2

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

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

0
0

Cloud Notepad on the Desktop

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.

Cloud Notepad on the Desktop

I run a copy on my phone and a copy on my laptop.

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

0
0

IMG_20170912_170725_387.JPG

Some mountains I copied from some website.

Lovelace Day 2017

0
0

A non-exhaustive list of technologies that I used this year which happen to be built by women:

I feel grateful to these people for enriching technology with their contributions.

Technological Artifact

0
0

Hand drawn technological artifact in the style of Scott Robertson

In the style of this guy in the style of Scott Robertson space ship sketches.

Other Worlds

0
0

planet-0.png planet-1.png planet-2.png planet-3.png planet-4.png planet-5.png

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

0
0

Tiny Core Linux SSH screenshot

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.

Happy penguin jumping

I'm a huge fan of this distribution!

Official disk images.

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

0
0

A list of real questions that could be answered by teensy little technology nuggets.

Raspberry Pi with Waveshare Rpi Hat

  • 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?

Generic USB Sound Device

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

0
0

plastimake-models.jpg

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

Across the Sea of Space

Browser Blockchain in ClojureScript

0
0

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.

Bitcoin whitepaper SPV

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.

Insect embedded in 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)))
Viewing all 234 articles
Browse latest View live




Latest Images