An embedded.fm listener (Mike) is working on starting a program for a local elementary school that introduces Engineering with a main focus on programming and electronics. He wanted to know if I had any suggestions.
Friday at lunch, I mentioned NaNoWriMo (national novel writing month). It isn’t until November but I admit I sketched out my outline starting in August.
They do the “contest” as a fundraiser, raising money for libraries in distant lands. It is free though they ask for donations. They supply support, forums, local meetups, and some prizes if you finish (one was a radio station that would let you read a chapter, another was coupons for getting books printed at a self publishing site).
It was fun. More importantly, it made me confident I could write a book when the time came that I wanted to do a real one.
I did Unix system administration in college. That was many, many years ago. And really, I managed the consultants, wrote quick references for users, made new accounts, and only filled in on deep technical management when someone made me (usually when someone else was sick or had lit something on fire). Good times. But I really was an expert unix user at one time for multiple unix varieties (hey, the math cluster was hpux so I got deep into that the summer I spent working on computational math libraries to model fluid flow).
But, as I mentioned, it was many, many years ago. Since then, I’ve played with Linux, dabbled here and there. I’m more comfortable with Mac OS in the command line (yes, I’m that awful person who remapped my flower and control keys so my fingers didn’t need to re-learn ctrl-z when developing with xcode).
My next contract will be all Linux-y and I’ve been wanting to do more embedded Linux (why is everyone so excited? When I played with it in 2006 it seemed like a great way to spend $100k in development time and then switch to something deterministic). Having borrowed a Beagle Bone Black, reinstalled Windows to have 64-bits so I can access all of my RAM, and installed a virtual machine so my husband will stop laughing at me when I destroy things, I’m ready.
My first mini-project is to rebuild the BBB’s Angstrom distribution. The board I have is a bit old and the OS has been updated. It would be nice to return it from whence I borrowed it, all updated.
Of course, it isn’t that easy, I’m plagued with stupid things I feel like I should know. And I’m reading Chris Hallinan’s Embedded Linux Primer: A Practical Real-World Approach (2nd Edition). I read the first edition many years ago (about the time it came out since we were still working on the embedded Linux project then, though my role was manager-only, not developer).
As I struggle with getting everything set up and configured as I like, I figured I should note some of my favorite commands.
On my Linux VM, here are some of the things I shouldn’t forget:
> cat /proc/version Linux version 3.8.13-16.2.2.el6uek.x86_64 (email@example.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Tue Nov 26 08:41:44 PST 2013
I like to know where I am and what I’m running.
> sudo usermod -a -G dialout elecia
Since I got an off-the-shelf VM (Oracle’s Linux 6), I wanted an account for myself. I know better than to run as root all the time. On the other hand, I keep failing to be able to use things. It took me a stupidly long time to remember that I have to log out after changing permissions.
> screen /dev/ttyUSB0 115200
As long as I remember to switch my USB-serial cable to the VM, I can snoop on the BBB as it boots up and use a command line there. U-boot is neat. Also, control-a then k kills the screen but leaves it openable (it detaches).
On my unmodified BeagleBone Black
root@beaglebone:~# cat /proc/version Linux version 3.8.6 (koen@rrMBP) (gcc version 4.7.3 20130205 (prerelease) (Linaro GCC 4.7-2013.02-01) ) #1 SMP Sat Apr 13 09:10:52 CEST 2013
I think I’m going to need to learn more about Linaro. I has come up a few times. I don’t think it is like ucLinux which can run without an MMM. Still, Linaro seems common for microcontrollers (the system-on-a-chip (SOCs)) that I’m likely to want to use.
This one is general more general:
ln -s /usr/local/bin/python2.7 python
That is linking the source (/usr/local/bin/python2.7) to the dest (python in the current directory). I’ve missed symbolic links.
Alias is ok:
alias ll="ls -lags"
But it should be noted that friends do not do
alias vi="rm -rf"
When their terminal is left open in a public environment. That’s just wrong. Of course, the way I use vi, it might as well be right.
I’ve been trying to stay in the Linux environment for most of the stuff I’m doing. When I find myself typing in questions into my Windows browser, I stop and go back to Linux. The fact that the VM captures my keyboard so I can’t alt-tab out of there is probably a good thing.
Building Angstrom has been difficult, lots of dependencies that are required to be something else by another part of my OS. Since I got the off-the-shelf VM from Oracle, I don’t think I got what would have been easiest to build Angstrom. I’m not sure what they want but it isn’t the Linux I have.
Oh, another good command to remember:
find . -name sanity.conf
Where the dot is where to search (from here through all directories) and -name is what to search for. I initially typed “find sanity.conf” which leads to a pleasing error message
find: `sanity.conf': No such file or directory
But that was the clue to me that find was one of those trickier commands that I usually mapped.
I was looking for sanity.conf because I got error messages that suggested I look in there for more information. Inside, there was a comment:
# Expert users can confirm their sanity with "touch conf/sanity.conf"
Windows doesn’t have this whimsy. I’d forgotten that. Linux is more clearly built by people, with all of the interpersonal spats associated therein.
Windows is more of a machine, with the personality of an annoying, talking paperclip. Linux is more of a crowded bar with lots of people talking in many groups. If you can find a quiet spot and a good group, you’ve won.
But standing on the outside, trying to figure out where to go, is excruciating. And wearing the wrong distribution can get you shunned.
The build instructions for my are-you-ok widget is up on SparkFun! How neat!
This isn’t the end for that project. I’ve been working on getting email on Maxwell (surprisingly not difficult). I’m going to visit Hugh this weekend to see why his accelerometer is fussy.
In a couple weeks, Elizabeth will be on the podcast again to talk about what needs to happen next, if she’s happy with the system and what changes to make. There is a rumor that SparkFun will have a kit of parts for me to give away at that time to podcast listeners. (I need a contest! Guess a number? The quotes are too easy thanks to google.)
For someone who seems to be always starting a contract next week (sigh), I have been busy. My EELive talk is going up on element14. I’m staying about a week ahead though this week I have to do the summary and I’m not ready. Also, on element14, Sophi Kravitz asked me questions about consulting but I kept distracting her with RTOSs and stories of are-you-ok widgets. I’m happy with her resulting interview.
I went to the SOLID conference. it was interesting and eclectic. O’Reilly gave a big stack of my books away while I signed them and stress-chatted with people. I was there as press, recording things for the podcast. But Christopher says the noise level is too high, the results are too difficult to listen to. Argh. I’m not sure what I’m going to do. I do need to do something to “pay” for the press pass (and all the people I talked to).
I am still working with the Beagle Bone Black, though slowly. I updated my MacBook Pro from Win7 32-bit to Win7 64-bit which lets me use more than 2G of RAM. That is a complete re-install so I’m still finding things I forgot to back up (my bookmarks!). One reason to do this was to run virtual machines so now I have Linux running too. (It is the Oracle 6 one which seems to be Fedora based, I’m still orienting on how things work.) I’m trying to build Angstrom, just to update the OS that is on the board (step 1: update with known good image, step 2: update with my built image that should be the same as the known good, step 3: break everything).
I’m currently installing Python 2.7 because some precursor to actually building Angstrom needs it. It just gave me an error in the build process of python because it doesn’t have some library it needs. This is exactly how I remember Linux being.
I hope you have a good, relaxing weekend. I plan to.