About Me

My photo
By day I'm a propeller-head geek. I design software for electronic components for a major automotive supplier. When I'm not earning a paycheck, I enjoy playing music -- primarily jazz and classical but I dabble in other genres as well. I also compose, arrange, and play with electronic gadgets and toys. My other hobbies include photography, colored pencil drawing, genealogy, model railroading, and crosswords.

Wednesday, August 21, 2013

Embedded Systems Virus?

I posted this in response to a question on the LinkedIn Embedded group:
I was thinking if it is possible to inject some virus in a micro-controller based embedded system?
As we move toward the Internet of Things (or pervasive computing, or ambient intelligence, or ...) there appears to be a convergence toward standard interfaces, whether these interfaces are widely published or not. Look at the automotive industry. Every modern car has dozens of embedded systems that are interconnected (via CAN or some other network). Connectivity with the World at large is becoming more affordable and common (e.g. GPS navigation, Wi-Fi internet, and over-the-air services like OnStar and Sync). Also consider that a computer does not necessarily have to be connected to the internet to be vulnerable to attacks -- in the "old days" viruses passed from machine to machine on floppy disks (aka "sneakernet") and today we still use portable media (i.e. USB drives). 

To answer the OP's question: is it possible to inject some virus in a micro-controller based embedded system? I believe it is *possible*. Perhaps not likely at this moment but we are fast approaching a time when the likelihood of attacks on embedded systems will dramatically increase. There have, to date, been a few academic studies on hacking into automotive systems and these have proven successful to some extent. Automotive companies (most notably GM) are now taking a serious look at cyber-security and we can expect to see stringent security (as well as safety) requirements for at least the most vulnerable modules for model years as soon as 2016. 

As far as non-automotive micro-controller-based embedded systems, they are all around us - and SPECIFICALLY connected and accessible. Every smartphone (iPhone, Android, etc.) is such a device. Also, we are becoming more and more dependent on "the cloud" -- what if a way was discovered to "poison the pool" by infecting the cloud?I'll bet there have already been some serious attempts!

Friday, May 31, 2013

All Politics is Local

It was Tip O'Neill who coined the phrase, "All politics is local." There's nothing more local, or political, than a condominium association if you own and reside in a condominium (and I do).

My condominium complex is a "conversion" (from apartments) that began about 12 years ago. There are 346 units in our development and when the housing market crashed, about many of the units remained unsold. The developer fell on hard times and the association struggled financially. The present treasurer has worked since 2007 to keep us solvent, build our reserves to the minimum required by the bylaws, and at the same time bring the quality of the property up to par with the high standards of our surrounding township. He did his job well enough to be reelected twice (our board members serve for two years). Recently, the developer (and his bank) sold his interest to a new investor, who essentially bought the 108 remaining unsold units.

Despite board members going door to door a couple weeks ago, urging owners to attend the annual meeting so that our interests would be fairly represented, the meeting was lightly attended. Our board of directors consists of seven owner/members who serve for a two year term. Four seats were up for election this year.
After the treasurer's state-of-the-association presentation, the new investor briefly introduced himself but otherwise didn't draw much attention to himself or his business partner, who attended the meeting with him. When nominations were being made for the four vacant director seats, four names were proposed by the investor: himself, his partner, and two others who were not present. There were seven nominations in total, one of which was our beloved treasurer. I don't think anyone (other than perhaps the sitting board members) realized what was about to happen. The votes were tallied and listed one by one. The first person listed received 28 votes; the second, something like 18 votes. The third person on the list was the investor, and there was an almost perceptible gasp as the number 128 was written next to his name. A silent tension filled the assembly as the votes for the next three nominees - the investor's partners - were filled in; the lowest number of votes among them was 108. We were railroaded. Ultimately, all four vacant seats were filled by the investor and his people. There was at least one irate owner who wanted to contest the results - it evidently had not yet "clicked" with her that this one person, the investor, wielded 108 votes while the remainder of the forty or so people in the room collectively held only 28 votes.

Here's the part where I rant:

  • We now have an "owner" (investor) with only a 31% share of the entire property (108 of 346 units) but a majority vote on the board of directors. This situation could be even more extreme next year when the other three seats are up for election.
  • I'm pretty sure the investor does not live in the complex and therefore has little interest in the community beyond his bottom line.
  • I asked him if it was his intention to develop and sell the 108 units or just keep them as rental property and he indicated that selling was the "long term" plan but he didn't want to "flood the market" with all the units at this time.
  • Our beloved treasurer, unceremoniously pushed out, is no longer at the helm. "Thanks for saving the world, I'll take it from here." It's unknown if his grand plan will be maintained or if the investor thinks he has a better plan (no doubt his goals are different).
  • I can't blame the sitting board for this coup - they tried to warn us (the owners).

Tuesday, May 21, 2013

A More Compact "Pythonic" Guido Function


from random import choice

def guido2(gtxt):
    return [guidoPitches[(len(vmap)*choice([0,1,2]))+vmap[c]]
            for c in gtxt.lower() if c in vmap]

Wednesday, May 15, 2013

A Simple Composition Algorithm According to Guido

I'm reading Musimathics, by Gareth Loy. Composition and methodology is the subject of volume 1, chapter 9, where "Guido's Method" is discussed. The author presents an implementation of Guido's method in his own devised language called MUSIMAT but I wanted to see if I could do the same in Python. So here it is:


import random

guidoPitches = [                        'G3', 'A3', 'B3',
                'C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4',
                'C5', 'D5', 'E5', 'F5', 'G5']
vmap = {'a':0, 'e':1, 'i':2, 'o':3, 'u':4}

def guido(gtxt):
    G=[]
    for c in gtxt.lower():
        if c in vmap.keys():
            G.append(guidoPitches[(len(vmap.keys())*random.choice([0,1,2]))+vmap[c]])
    return G

guido('Ut queant laxis resonare.')