you’d think timezones would be sacrosanct

Somethings in life are supposed to be rock solid, unchanging & immutable. Not so for the list of available U.S.-based timezones as seen in Raspbian lately. In Buster, the latest operating system version (based on Debian), they decided to just arbitrarily remove a timezone selection for the United States.

Debian post

It all stems from the introduction of a second Pacific-based timezone called Pacific-New. This zone related to legislation that would have prevented daylight savings time changes to interrupt a presidential election. And yet, the bill never passed and this timezone made it into Debian (and Raspbian).

Like many users in the U.S., when presented with the two options (Pacific, Pacific-New) we selected the latter, possibly assuming that “Pacific” was some sort of designator for U.S.-islands-in-the-Pacific-which-weren’t-Hawaii.

So now with this Buster release, Pacific-New vanished into thin air and without any information to the community who support it.

But it doesn’t end there. The contents of files like /etc/timezone in Buster now don’t contain US/Pacific as one might expect. They now contain America/Los_Angeles instead. Seriously? Just think of all the shell scripts that are now buggy as a result of changes like this.

The folks from Raspbian suggest that all US/timezone​ timezones are now deprecated in lieu of America/City_Name. The entire point to having the former is that it allows pulldown menus in software to indicate a short list to the enduser. There are literally hundreds of city name entries within the America listing since it includes North, Central and South America of course.

This is a real face-palm moment for software developers and for endusers as well. Instead of selecting from perhaps five timezones, you’ll now need to select from hundreds of representative cities within two continents.

rip, red hat

Say it isn’t so.

Since the end of October is all about scary stories… Just on the heals of Microsoft buying github for US$7.5B last year, IBM has now has purchased Red Hat Linux for a cool US$34B dollars.

Screen Shot 2018-10-30 at 12.34.56 PM

Granted, I haven’t used Red Hat in a few years mostly since it is one of the few paid UNIX-based operating systems out there. Ubuntu, backed by Canonical, is clearly the better choice for anyone who knows what’s going on.

IBM is the antithesis of open-source software, as is Microsoft. This is just sad. But good riddance. Now get in the hole, Red Hat.

this-is-capitalism

intel edison

I recently purchased the (now discontinued) Intel Edison Breakout Board Kit from Fry’s Electronics. I’m guessing that I overpaid for this product offering by Intel since they’re only $23 at the time of this writing.

edison

I assume that there was a moment a few years ago in which Intel must have thought that they needed to enter into this whole IoT business and rule the space, given their history. I’m sure they were made confident in the sheer volume of Raspberry Pi and Arduino boards being shipped each year. “How hard could this be?”, I’m sure they asked themselves before venturing out into terra incognita.

Setting it up

Setting up the board was a bit different from earlier attempts with either Raspberry Pi or Arduino boards. Intel decided that it would have you use a paired-down Linux customization called Yocto to generate the operating system. The result is a slim o/s with just enough breathing room for things to run.

Additionally, it uses not one but two micro-USB cables to your workstation for a fair bit of that setup which seems unique. The first connection powers the Edison and creates a virtual network adapter and can be used to flash the code. The second is strictly serial and can also be used to communicate with the board. From the specifications, it includes two UARTs, for what it’s worth. Once setup, you can power it from the single connection, however.

At times, this duality can lead to trouble as seen when attempting to connect the Edison within Intel’s System Studio software. It was unable to connect using the hostname alone since this would try to use the wi-fi connection rather than the (expected) serial connection within their own software.

The Edison comes equipped with both Bluetooth and wi-fi. I would like to say that setting up the networking was easy; it wasn’t. I found the labyrinth of documentation to be daunting at times. The initial suggestion to get the chip running simply failed. I then had to do enough research to chase an alternative path to setting it up by using their Platform Flash Tool Lite version. Having then successfully connected the wi-fi to my network, I then attempted to see what was under the hood.

NodeJS

I was pleased to see that their own configuration utility which boots by default runs as a Node service. Once configured, the web interface provides little information than you probably already knew by inspection. They call their implementation of Node Intel XDK which is of course discontinued as well now.

System Studio

Intel provides an IDE for programming these devices. One needs to register in order to download the software. Having installed the interface, it’s easy to be impressed at how complicated the interface looks. It’s a lot like Microsoft Visual Studio with its number of panels and such.

Unfortunately, all this doesn’t work—we’re just talking about the “Hello World” example and it simply doesn’t work on the Edison. A single shell script called device-detection.sh does not appear to include the code for the device and further, throws a fatal syntax error in the Yocto bash itself.

Unfortunately, this means that any code compiled for the Edison uses the wrong target and so won’t run. Searching within their user community forum doesn’t result in anything useful so I’ve decided to abandon System Studio for the moment.

Arduino software

It looks like another option is to use the Arduino IDE software to push code to the Edison, assuming that we’re talking about C++ or similar compiled code. I haven’t tried this yet but I’m not sure if I really want to leave the relative comfort of JavaScript for C++ for this project anyway.

GPIO pins

Like a Raspberry Pi or an Arduino board, the Edison has GPIO pins. They’re just available on the back of the breakout board in this case. There is also a space for adding a barrel connector for power, should you want.

edison_rear

Overall impression

At a discounted price of $23, this falls into the middle range between a Raspberry Pi Zero W ($5 plus $6 for microSD) and the Raspberry Pi 3B ($35 plus $6 for microSD) price points. It can host a diminished Linux stack, serve up Node applications and appears to have two full UARTs at your disposal unlike the Raspberry which only has one full UART.

It’s probably okay for a few IoT projects but I doubt if I’d try to spin up a grand solution given its discontinued status. It was a good exercise in getting my feet wet with my first Yocto configuration at least.

I find myself disappointed with Intel’s inability to succeed within this product space. I could only guess how they failed at this; I have to assume that the right people skills were not included in the teams which contributed to this.

over the mount’n

Okay, that was a terrible pun. I thought I’d share something today which is pretty cool although it gets a little technical at the end. You can actually edit the files on a tiny microSD card like you might have in some device like a 3D printer or similar. And you don’t have to have it running (like in your product/device) in order to do so.

Smart Things (IoT)

We live in a world of ever-smarter things. There’s a new term, the Internet of Things (IoT) which basically means that lots of the products we’re using now not only have little computers inside, but they also use the Internet in some way.

Tiny Hard Drives

Given the diminutive size of some of these new products, they often use the microSD card as an actual hard drive. These days, they include an entire operating system which boots up the product’s computer and provides a variety of functionality.

microsd

The Bleeding Edge

For some of us, we like to install the very latest version of software for something like this. Those updates sometimes come in the form of an entire image file for the microSD card in this case.

Instructions for editing files on an image file itself

Okay, so I have downloaded an image for a Raspberry Pi computer and the version name is Jessie. The name of the operating system itself which runs on this computer is called Raspbian, btw. The image’s filename is then raspbian-jessie.img, easy enough.

I’m running these commands on a Linux-compatible computer:


$ file raspbian-jessie.img

raspbian-jessie.img: DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x0,130,3), end-CHS (0x8,138,2), startsector 8192, 129024 sectors; partition 2 : ID=0x3, start-CHS (0x8,138,3), end-CHS (0x213,120,37), startsector 137216, 8400896 sectors

So we’re interested in only one number here, that value after startsector for partition 2, namely 137216. Multiply that by 512 to get 70254592 which we use in the next command:

$ sudo mount raspbian-jessie.img -o offset=70254592 /mnt

This means, essentially, “open up the file indicated (at an offset of 7 million or so characters into that file) and show me everything that’s in it and put that in the /mnt folder area”.

So now, you can actually edit the image’s computer name in the /mnt/etc/hostname file, for example. Assuming we have done so, we now unmount the file:

$ sudo umount /mnt

And you’ve managed to edit its internal files in place! The typical activity next is to burn that image to another microSD, put it into your smart refrigerator’s computer or whatever and boot it up.

Conclusion

Okay, so you’re not as excited as I am but this is a giant leap forward in workflow for me. Since I maintain several of these image files, this is pretty cool stuff.

Imagine if you were trying to build a supercomputer with a hundred individual (small) computers and it were necessary to then build 100 different image files each with their own setup. This would be so not fun if you had to do this manually. Using this new method, you could script all this and then run it.  By the end of some lengthy process, you would have all hundred different image files as produced by this method. Huzzah…, right?

so many operating systems, so little time

Sometimes you need to do many things with the same hardware. Say, for example, you might need both Windows 10 and a Linux-type of operating system on the same computer. Here are some of your options for this.

You might say, “why would I want that?” There are times when you want to try out something new. You might need to test software compatibility with something you don’t have currently. You might purchase some new software or a printer which isn’t compatible with your current setup. Or, like me, you might be endlessly curious about the possibilities. You might want to create a smartphone app and need to see how that looks on a variety of phones.

Boot from a “Live” media

In this case, you have Ubuntu on a CD or on a USB thumb drive. You boot to this media and select the live option from the menu (“Try Ubuntu without installing”). You then get a Desktop experience running Ubuntu (Linux) on your existing hardware and you don’t even have to install it in the classical sense. Once you shutdown this system and remove the media, nothing whatsoever has changed on your original hard drive.

TryUbuntu

I’ve used both methods (CD and USB) and will attest that the latter will boot up faster than anything you’ve seen before, I’d guess.

Pros:

  • It’s very fast to boot this way from the USB drive.
  • You can try another operating system without making any changes whatsoever to your existing computer.
  • It makes short work of hacking a Windows-based computer if you don’t know the password(s) and accessing the files on its partitions.
  • It seems to be wonderfully compatible with a variety of computers and laptops without fussing with drivers.
  • Each session takes advantage of all the available RAM.

Cons:

  • Unless you change the defaults, any changes to your Desktop and configuration are lost upon restarting this session.

Set up two partitions and select one upon startup

In this case, you shrink the size of your existing hard drive’s partition to make room for another operating system.  You then install the new operating system to this second partition.

Upon restarting the computer, you then select which partition (operating system) you’d prefer.

GRUB

This technique is often called “dual booting”.

Pros:

  • The settings you change will be saved from one session to the next.
  • In many cases, you can access files on the other partition(s) if you know where to look.
  • You can take advantage of fast hardware like that on an Apple computer to use other operating systems like Linux.
  • Technically, you could install Windows 7 on one partition and Windows 10 on another.
  • This technique can be extended to many operating systems on many partitions.
  • Each session gets all the available RAM.

Cons:

  • You have to reboot in order to get back to the other operating system to use its tools and software.
  • In the case of OS X, major version upgrades usually try to overwrite the menu at the beginning which would normally allow you to select the other partitions. It’s almost as if Apple doesn’t want you to do this and breaks things on purpose, of course. If you’re technically-minded, you can fix this each time however.

Set up a virtual manager (VM) and “spin up” an operating system

This seems to be the preferred and newest method these days. You run a virtual machine manager, create a virtual computer using this technique and then install the new operating system to this.

QEMU

You then boot up the virtual computer and you see this as a window on your Desktop.

XP

Pros:

  • You can copy/paste from a Windows application into a Linux session’s Terminal session or any similar combination of from/to.
  • For demonstrations, you can easily show that something works with multiple operating systems (without rebooting or bringing multiple laptops).
  • Depending upon how much hard drive space, RAM and processor speed you have, you could potentially run several virtual machines at once.

Cons:

  • Technically, it’s the most challenging of the various options and the learning curve is steep.
  • It may require more RAM memory than what you currently have for this to run well.

Progress so far

I have plenty of experience using the first two methods above (live- and dual-boot) but have recently been working with the VM option, as described below.

Dual-boot MacBook

I’ve setup my MacBook Pro to boot both OS X and Ubuntu. It seems to work great so far. I hope to next setup a VM so that I can emulate a Raspberry Pi computer within the MacBook itself (for development purposes).

HP Laptop

I’ve setup my HP laptop to boot Ubuntu and have added a VM which has Windows 10 loaded in it. Remarkably, the Windows 10 install actually works better than the original (native) installation on this laptop.

Multi-boot Raspberry Pi computers (IoT re-purposing)

Since the Raspberry Pi (3 and Zero) computers have an easily-replaceable microSD card in them, I now have a small library of different images with which I may boot any individual computer. It’s just important to label each to avoid confusion.

So I might pull the microSD card for the robotic tank project out of a Raspberry Pi, replace it with the card for the closed ecosystem or for a different project altogether. Once it boots, it’s now a completely different computer, if you will.

microSD

Multi-boot 3D printer

Technically, the Robo C2 printer has a Raspberry Pi computer inside so it makes it easy to boot to different versions of the software. This is useful when you’re modifying things to add on new features, for example.

Smartphone software on a workstation

I’ve also had the opportunity of installing Android on a standard Dell Vostro 200 desktop computer. (It’s good for testing software and websites.)

Cloud-based alternatives

There are entire services available at Microsoft, Amazon and presumably Google in which you “spin up” a virtual computer and remote into it.

Amazon’s offering is called EC2 and I’ve had the opportunity to use it in the past. In the span of two hours, I was able to spin up or “instantiate” a virtual SQL Server in a datacenter somewhere, to upload a corrupt database, fix it there and then to download it back to me. I then killed that virtual server. The total cost was something like $4 to “borrow” their virtual hardware for a couple of hours. Compare this to the cost of purchasing an actual server, paying for Microsoft licensing, waiting for everything to arrive, setting it up, etc. I literally saved thousands of dollars with a service like this.

Microsoft’s offering is called Azure. I can’t say that I’ve used it yet but it works essentially in the same way that EC2 does: define an instance, spin it up and remote into it.

Looks like Google’s offering is their Compute Engine. It sounds like they’re trying to play “catch up” to both Amazon/Microsoft on this one.

There’s another player in this space, MacInCloud.com appears to be offering remote sessions into what are likely discreet/physical Apple computers. For all practical purposes, it would likely behave like a virtual computer might.

Private cloud

And finally, I had the opportunity to re-purpose about eight Dell Vostro 200 computers from work into a MaaS (metal as a service) private cloud. The underlying layer of software which did the cloud part is called OpenStack which allows you—like Amazon itself perhaps—to be the host for spinning up virtual servers.

It takes a lot of work to get the initial one or two computers running for this. But then, using a concept called Juju charms, you select what are essentially recipes of things to install which have complicated inter-dependencies and it seems to make it all work for you. Seeing these things run is pretty impressive given that this is in the free, open-space world.

The future

It’s hard to guess what’s next in this series of events. We may soon be running a VM with Windows 10 on a wearable single-board computer like the Raspberry Pi 3 or similar. In theory, then, you might wear a pair of Google Glass(es) or the Microsoft HoloLens which would interface with the Pi computer via Bluetooth. Given the lack of a keyboard, presumably the interface might be like the Amazon Echo/Alexa service: you ask for something, the system must recognize the command, submit it to a server and display the results or iterate through them via voice.

And yet, given the augmented reality (AR) side of things, you might say “keyboard” and a virtual reality keyboard could appear on the physical horizontal space in front of you and you just “type” on an imaginary keyboard to input data.

The interfaces could evolve to project these virtual keyboard-type interfaces onto an imaginary glass wall in front of you, much the same as you see in sci-fi movies these days. These glass-like devices probably would incorporate an outward-facing camera to catch and interpret your hand movements into discreet commands like typing, page-forward, scroll-down, dismiss window, etc.

GoogleGlassHololens