Wednesday, July 31, 2013

Beyond Compare with Mercurial

To get the excellent Beyond Compare to work as my graphical diff tool in Mercurial (Hg) on Windows, I needed to add the following lines to my mercurial.ini:
[extdiff]
cmd.bcomp = C:\Program Files\Beyond Compare 3\BComp.exe
opts.bcomp = /ro /solo
Then, from the commandline, I can use
hg bcomp
to get a diff of all changes in the directory, or I can specify a filename to see differences in it. Without the /ro /solo, I ran into issues with the temporary directories in a dir diff being deleted immediately before Beyond Compare got a chance to compare them. That's because without them, Hg thinks that Beyond Compare completed immediately. Those options tell Beyond Compare to hold off on telling Hg it's done until after you have manually closed Beyond Compare.

Monday, July 22, 2013

Beaglebone Flash Image on Linux

The BeagleBoard website assumes you're using Windows in all of its instructions. I am running Linux Mint and wanted to update the OS image on my SD Card.

My ThinkPad has a built-in SD card reader. I didn't know what Linux called it, but I did see SD cards I put in show up in my file browser. Turns out you can list your disk drives with the command:

sudo fdisk -l
I got output like this:
Disk /dev/mmcblk0: 3904 MB, 3904897024 bytes
255 heads, 63 sectors/track, 474 cylinders, total 7626752 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *          63      144584       72261    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          144585     7132859     3494137+  83  Linux
Then, I used this command to "burn" the image to the card:
sudo dd if=./Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.06.20.img of=/dev/mmcblk0
You might want to stick a "time" on the front of that command: it's going to take a while (a little more than half an hour for me). You can check on its progress by using ps -a to get the pid of dd, then send it a USR1 signal with sudo kill -USR1 pid. That will cause it to print status information to stdout.