Setting up Beagleboard Black (BBB) with Ubuntu

This procedure assumes you are running on a PC running Ubuntu itself.

Do not power up the BBB until instructed.

1) Take a blank micro SD card 2GB or bigger and plug it into your laptop/desktop PC. I use Gparted to remove any existing partitions on this microSD card. Be sure you know which /dev/mmcblk0 or /dev/sd* is your micro SD card! For this procedure I will assume the SD card is at /dev/mmcblk0.
2) Download the *.img.xz file of your choice
As of this writing, Ubuntu 12.04, 14.04 and Debian 7.5 are available.
3) cd ~/Downloads
sudo su
xz -cd ubuntu-*armhf*-bone*.img.xz > /dev/mmcblk0

This will take 5-10 minutes with a card writing at 5MB/sec.
4) type exit to drop out of su mode (prompt is a $ instead of the su #).
5) sudo partprobe /dev/mmcblk0
ls -al /dev/mmcblk0
6) sudo parted -l
you should see two partitions under /dev/mmcblk0 — the first partition, flagged “boot” will be about 1 megabyte in size. The second partition will be about 2 gigabytes in size with the ext4 file system.
7) type sync to confirm that writing to SD card is complete. Then since you have not mounted the SD card (if you did, unmount it) pull the SD card out of your PC. Note that the micro SD card goes into the Beaglebone Black “upside down” with the contacts facing away from the PCB.
——————————-
Booting up the BBB:
* You will need a microHDMI to HDMI (or DVI, VGA, etc.) adapter to plug into your existing monitor–or, you can choose to run entirely remotely over SSH.

* BE SURE TO PLUG AN ETHERNET CABLE into your network before booting.

* Now with the Ubuntu microSD card inserted into the BBB, hold down the user/boot switch (the one closest to the microSD card on the opposite side of the PCB) and keep holding after plugging in mini-USB and 5.5mm power until the third LED from the Ethernet jack starts flashing (indicating the microSD is being accessed).

* WAIT about 1 minute with a black screen (not suspended, but just black) screen while Ubuntu start. THen you’ll see “ubuntu-armhf login” with username: ubuntu
password: ubuntu

You now have a basic Ubuntu setup. Using df -h reveals that <0.5GB is being used, which gives you the option of copying from SD to internal eMMC.

* don’t forget to change your password by typing passwd

* install the useful parse-edid program by typing:
sudo apt-get install read-edid

After this first Ubuntu boot, you do NOT have to hold down user/boot switch on future bootups to use the SD card. Subsequent boots take me 12 seconds to get to login prompt (with Class 4 SD card (a slow crummy card)).

Commentary:

http://robotic-controls.com/learn/beaglebone/beaglebone-black-ubuntu

based off of: http://www.armhf.com/index.php/getting-started-with-ubuntu-img-file/

Installing Madrigal Python API

For those in the aeronomy community, the Madrigal download page

http://madrigal.haystack.mit.edu/madrigal/madDownload.html

doesn’t tell how to actually install Madrigal. Here’s how to install Madgrigal Python API:

 

  1. Download API http://madrigal.haystack.mit.edu/madrigal/madDownload.html and extract into your home directory (e.g. ~/remotePythonAPI-2.2)
  2. in Terminal, type: python ~/remotePythonAPI-2.2/setupMadrigalWeb.py install

Disabling middle mouse paste Linux

A perhaps annoying X11 feature is the “middle mouse button paste” behavior that can lead to posting unwanted text in a document when you’re simply trying to scroll through it. Note: the method below has not been extensively tested by me, but seems to “just work”. Keep a backup of your original .Xmodmap file if one existed.

To disable middle-mouse button paste, do the following:

  1. In Terminal, type: xmodmap -pp. This will tell you the active mouse button function indicies. The second number is apparently the middle mouse button function, which we will map to an unused index. An example output of xmodmap -pp is

    There are 10 pointer buttons defined.
    Physical Button
    Button   Code
    1        1
    2        2
    3        3
    4        4
    5        5
    6        6
    7        7
    8        8
    9        9
    10      10
  2. In terminal, type  nano .Xmodmap
    and swap the last number with the second number. For the example above, type:
    pointer = 1 10 3 4 5 6 7 8 9 2
    and then save this .Xmodmap file.
  3. Logout and back in, and the middle-mouse paste should be disabled, while you are still able to use the middle mouse button to scroll.

    Reference:

    http://dev-loki.blogspot.com/2007/12/disable-middle-mouse-pasting-sort-of.html

    MATLAB: allow integer, non-exponential ylabel or xlabel

    MATLAB’s default behavior, which Mathworks says is currently not changeable, is to put exponential format into xlabel and ylabel for large numbers–even integers.

    To allow the xlabel and ylabel to be integers (e.g. 362093), put the following line after you set xlabel or ylabel:
    set(gca,'YTickLabel',sprintf('%7d|',get(gca,'YTick')))

    In this case, the ‘%7d’ means I want up to 7 integer digits on my y-axis.

    GUFW can’t start: Ubuntu 13.04

    On a fresh install of GUFW on Ubuntu 13.04, I was unable to get GUFW to start by clicking the icon. Going to Terminal and typing gufw, I saw a string of errors, culminating in:
    IOError: [Errno 13] Permission denied: ‘/tmp/gufw.pid’

    I saw that root had r/w permissions for this file, and everyone else had read pemissions. I couldn’t find anything on the web, so I typed:
    sudo rm /tmp/gufw.pid

    Then GUFW could start. Note, this was only “safe” to do because it was in the temporary directory /tmp. Don’t go around using sudo rm willy nilly!

    Copying or moving WINE to a new PC

    Migrating to a new PC or new install of Linux can be accomplished by first copying your entire home directory to an external HDD, then copying back to your new (install) PC with a tool like grsync. (I don’t necessarily recommend this method, but it can work).

    This can cause two issues for WINE.

    1. if your username changed, you have to update the “exec” lines of the .desktop files that reside in ~/.local/share/applications/wine/Programs/ (or create softlinks–maybe someone knows a more efficient way to do this?)
    2. Sometimes the softlinks in ~/.wine/dosdevices don’t survive the copying process (e.g. if your external HDD is NTFS formatted), because some filesystems (NTFS) don’t like filenames like “c:”. So at a minimum if your WINE programs don’t run, and there’s no “c:” in ~/.wine/dosdevices, you need to type:

    ln -s ~/.wine/drive_c ~/.wine/dosdevices/c:

    “Permission denied” when installing Matlab R2013a 64-bit on Ubuntu 13.04

    When installing Matlab on Linux, especially from an external/network drive, when you type
    sudo ./install
    you might get an error like:

    /tmp/mathworks_xxxx/sys/java/jre/glnxa64/jre/bin/java: Permission denied

    To fix this problem, try the following (steps for R2013a)
    1) copy the whole matlab installation directory to your local home drive ~
    e.g. to ~/mathworks_downloads

    2) type chmod +x ~/mathworks_downloads/R2013a/sys/java/jre/glnxa64/jre/bin/java

    3) try type sudo ./install again in your local drive matlab install directory