h1

Scribbles to myself

May 28, 2014

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 (mockbuild@ca-build44.us.oracle.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.