Phant Docker Container

Was having a quick play-around with getting the self-hosted version of the Sparkfun data logging service going on a Raspberry Pi using Docker a couple of nights ago.

The image was built on a Raspberry Pi 2 running the hypriot-rpi distro and uses the hypriot/rpi-node Docker image for nodejs.

The Dockerfile can be grabbed from Github here. There is also a pre-built image on Dockerhub if people want to give it a try.

If anyone has problems getting it going, feel free to post an issue on Github for it.

BE Maker Kit Campaign on Indigogo

The guys at Borderless Electronics are kicking things up a notch with the launch of their BE Maker Kit project to accompany their recent $9 Arduino compatible board.

The most interesting thing here is their “Learning System” which includes 10 hours worth of electronics-related learning materials in the form of video-based tutorials which can be used in conjunction with their kits.

More information about the project can be found on their campaign page.

Automated Node Monitoring with Puppet and Icinga

This guide outlines how to use Puppet to automatically add basic checks for provisioned nodes to an Icinga instance running on the same server. This tutorial assumes the use of Ubuntu 12.04LTS but this should work on any Linux distro.

I’ve tried to include as much information as I can. So there will be a basic primer on getting Puppet working and adding a new node to the Puppetmaster. If you have your own way of doing this, feel free to skip those parts of the guide. You can also use the basic setup guide on the Puppetlabs Wiki to get things up and running.

Continue reading Automated Node Monitoring with Puppet and Icinga

Retro Radio Re-Purposed as an iPhone Doc

Oyvind Dahl send in his Retro iPhone dock project. There are very comprehensive writeup of his build on his Blog here as well as in the video embedded above.

I wonder what he has in mind with those Vacuum tubes?

Well worth checking out the other parts of his site as well as there is a wealth of information for beginners, including PCB design and Soldering tutorials.

Controlling the Maplin Robotic Arm with a Raspberry Pi

After seeing this article on wikihow by Jamie Scott, I decided a trip to Maplins was in order and I ended up buying one of their Robotic Arm kits

The python script I written to control the arm is based on his with a few minor amendments. Mainly, error handing for keyboard interrupts and mapping of the commands to more easily remembered versions in a dictionary.

The script and documentation are available from Github.


Picsu: The Power-supply that Fits in a Drive Bay

Thanks to Tucker Merrick for submitting this one: The Picsu, the brainchild of Tucker’s brother, is a power supply which is small enough to fit in the drive bay of a standard PC tower case and features a serial port that allows you to control the voltage and current output by the supply via your favourite terminal application.

I have to say, this is a great idea for those of us (like me) who have limited desk space. These would also be a good idea for school/college E.E labs.

The Kickstarter project page for this can be found here. At the time this was written, they has $932 raised.  Any help the wider community could give here would be very much appreciated.

Checking File Permissions the Easy Way Using Python

Edit: Doh! Looks like I forgot something. In Linux, if a file or directory has read, write or executable permissions for the Owner only (nothing for ‘group’ and ‘others’) check_files() doesn’t add a dictionary entry for that path if the user running the script does not own the file or directory. Adding one little ‘elif’ block fixes this. (see the slightly revised code below.)

It never ceases to amaze me what even a wet-behind-the-ears hobbyist like myself can do with Python. I needed a way to get the file permissions and check for the existence of a large number of paths that I could re-use in other scripts. The function shown below is what I came up with.

It takes a Python list containing file/directory paths as an argument and returns a dictionary containing the Paths as keys and the concatenated values ‘READ’, ‘WRITE’, EXECUTE’ separated by commas (or ‘NOACCESS’ if the user doesn’t have read, write or executable permissions) to indicate the users level of access to each path, or just the value ‘NOEXISTS’ if the path does not exist.

def check_files(paths):
        dict = {}
        for p in paths:
            if not os.access(p, os.F_OK):
            if(os.access(p, os.W_OK)):
            if (os.access(p, os.X_OK)):
            elif os.access(p, os.F_OK) and not (os.access(p,os.R_OK)) and not (os.access(p, os.W_OK)) and not (os.access(p, os.X_OK)):
            status="" # Set blank before we enter the loop again
        return dict

This function will only give you the permissions for the user running the script but as this was all I needed I did not see that as a major problem. Hope someone finds this useful. As always, you can flame me/prop up my massive ego in the comments 🙂

Ubuntu SFTP-Only Account How-to

This guide will show you how to setup Linux user accounts restricted to using SFTP only. These accounts will be unable to run arbitrary shell commands on the server or access/create files outside their own home directories. The steps in this guide were tested on Ubuntu Server 10.04 with version 5.3p1 of the OpenSSH daemon, obtained from the Ubuntu software repositories.

Although this guide is aimed at Ubuntu users, it should also be applicable to other flavors of Linux as well. The most important factor to consider is the version of OpenSSH you have installed on your system. Version 5.0 or above is recommended as these versions support the OpenSSH ChrootDirectory configuration option that we’ll be using here.

Right, that’s enough of the rambling, let’s get to it…


Continue reading Ubuntu SFTP-Only Account How-to