Ubuntu, coming to a drone near you

I just read David Meyer’s article, “Robots embrace Ubuntu as it invades the internet of things” on gigaom.com. It describes Canonical’s continued progress in the device space.

I’ve used Ubuntu as my desktop system for many years now, and I genuinely like it as an environment. I don’t use their Unity interface, but my daughter does. (My wife uses classic GNOME and I use a Cairo-GNOME hybrid.

Of course, drones, phones, fridges and other “black box” sorts of devices don’t use desktops. They deal with the underlying core of operations where it gets pretty ugly. That’s where I like Ubuntu as a base. One of my favorite aspects of Ubuntu, and why I tend to install it first for friends and family, is it’s usage of Debian package system. This package system is pretty resilient and does a great job of pulling together requirements for you. I install something and the system automatically says “Hey! You need all this other stuff to make that run. Do you want to install that too?” It also does a good job of cleaning up after itself, removing things that are no longer needed.

Ubuntu enhances this by having a good, reliable set of repositories, including commercial partners. They make it easy to turn off anything that is intellectually encumbered if your goal is to have a more open system. They also make it easy to add new repositories so you can keep up with your favorite packages that have not been included in their official list. It’s automation has been good. When I set up a system for a non-techie person and tell it to keep itself up to date, it generally does a good job of it on its own.

Now, I know that these kinds of things are all human conveniences, and that the needs of a drone or other device will be different. But just like Alamo Drafthouse has tapped into what I enjoy about seeing movies, Canonical has tapped into what I enjoy most about using my computer. I’m confident that this understanding will translate well into other areas and that having devices, desktops and servers that share that base will create some good benefits. I wish them well.

All that said, Linux is Linux. Any devices running it, no matter what flavor, is a good thing.

An it harm none, code as thou wilt

The other day I had a little problem to solve. It was not a complex problem. I wanted to generate a set of coupon codes to hand out for something. I wanted them to be in an alphanumeric format like A3YH-UB4S. I often do things like that in a LibreOffice spreadsheet, because I’m sort of lazy that way. I tinkered for a while at getting the randomness to work the way I wanted and to generate the numbers and letters the way I wanted, then realized I was going to have to write some sort of macro code to make it do what I wanted. At that point I decided that if I was going to write code, rather than write it in the spreadsheet tool I would do something external that could generate my list. I decided to use Python. I’ve been interested in doing something with Python for some time, mostly because there seems to be a lot of integration for it in tools like GIMP and Blender. The logic involved was not really rocket surgery. I did some searches to find out how to do the basic loops and output and soon had a trivial little program that did the job.

#makecodes.py
import random
import sys

for x in range(0,100):
    for y in range(0,9):
        z=random.randint(0,35)
        if z<10:
            z+=48
        else:
            z+=55
        
        if y<>4:
            sys.stdout.write(chr(z))
        else:
            sys.stdout.write("-")
    sys.stdout.write("\n")

If I work with this often there are a number of things I’ll probably do with it. For example, there is not real uniqueness check that is happening. It’s possible to generate duplicate codes. Ideally I should track each code generated and make sure there are no repeated values. I could also have a way to change the number of entries generated, and their format. However, for the time and task I had, this worked fine. I piped the output to a text file, pulled that into my LibreOffice base and generated the coupons.

Feeling proud, like the Brave Little Tailor, I made a social post about my first Python program. Of course, I immediately received feedback from some of my technical friends. Some praised my choice of Python. Others questioned it and suggested languages and approaches that would have been  a better accomplishment. However, my job was done. This was not something I plan to release (though I guess I just did by posting it here). It was a way to quickly solve a problem and let me see what coding Python was like.

There are many situations where we want to use technology to get something done. Sometimes these are critical circumstances that have far-reaching impact. In those cases it is very important that we understand the moving parts and how our actions and choices impact the rest of the environment (especially as we are more cloud-facing). However, there are also many situations where something just needs to be done and it’s fine to reach for the nearest technical duct tape for the job.

Depending on your role, it may be that your duct tape gets moved into production fairly often, so you should probably always consider that and not do things that are too weird. But technology is also about curiosity and finding new skills and ways to do things. If the duct tape will do, don’t sweat it. You solve your problem. You learn some things. The world continues to spin. Explore and experiment and be proud of your creations.

(I used Bluefish as my code editor. I’m becoming rather fond of it.)