CLI Partitioning is a great place to start. Note that it’s also possible to resize a “dirty” NTFS volume, though of course the risk of losing data goes up. I generally do this when getting a new machine that comes with Windows pre-installed, because it’s less work than possibly re-installing windows some time in the future.
Partitioning from the command line
June 6, 2009 by jonmccuneUSB to Ethernet adapters
June 3, 2009 by jonmccuneI went through some pain to figure out some USB to Ethernet adapters that work reasonably well on Linux. The pain was primarily derived from needing several dozen of them, not being able to definitively test anything without actually getting my hands on them, and getting bad information from various vendors about how many devices are in stock.
Linksys USB200M – works fine but has a fragile ethernet connector. Uses “ASIX” driver for ax8817x.
Linksys USB300M – also works fine and has a nice short cord to provide strain relief for the connectors. Uses “ASIX” driver for ax88772 (not ax88772a).
Sabrent “USB 2.0 TO Fast Ethernet” (their capitalization), NT-USB20 – seems to work fine, no fragile connectors, but no cord either so one could conceivably damage the usb port on a laptop if the cable gets a yank. Uses “pegasus” driver.
Summer 2009 Event Plans
May 5, 2009 by jonmccuneNot necessarily in this order:
- Grass Roots Racing G.R.A.S.S. Series Apr 18, Jun 13, Jul 18, Aug 15, Sep 19
- Rachel Carson Challenge Jun 20
- Pittsburgh Triathlon Jul 26
- Philly LiveStrong Challenge Aug 23
- 24 hours of 7 Springs Sep 5
- Bike the Katy Train in Missouri TBD
GPIO on a Gumstix Console VX
April 28, 2009 by jonmccuneEvery embedded-style project begins by blinking LEDs. Once the LEDs blink, anything is possible.
My platform is the Gumstix starter pro pack, which includes a “verdex XM4″ main board, and the “console vx” expansion board. I was initially thinking I would hijack one of the serial ports, so I started looking at the docs for the Gumstix UARTS. However, I’m trying to do this with as little change to the default software environment as possible, and the default environment does not include a terminal program (e.g., minicom). Likewise, some tests of the serial ports using “echo” and “cat” did not impress.
Thus, I changed my focus to the general purpose I/O (GPIO) through-holes on the console vx. I found this discussion where people are trying to achieve something similar with the console LCD expansion board, which is actually quite similar to my console vx. The critical information, though, was that there is such a directory as /proc/gpio, and that echo and cat are sufficient to interact with the files contained therein. I followed the advice in that discussion and started with the AC97 header. These schematics were helpful in learning what went where, as was Table 4.1 in the Table 4.1 in the PXA255 Processor Developer’s Manual.
Looking at the bottom of the console vx board, the AC97 header has two rows of 4 pins, and the top-right one has a square solder pad (as opposed to the others, which are round). I deduced that the square hole was ground. Here is an ASCII diagram of which GPIO pins go to which through-holes:
?,30,29,GND
31,?,?,28
Thus, to set and clear one of pins 28-31, one would enter the following at the command prompt:
$ echo “GPIO out set” > /proc/gpio/GPIO28
$ echo clear > /proc/gpio/GPIO28
The string “GPIO out” tells the system to put this pin into the “GPIO mode”. Most of the pins also have alternate functions, so this is necessary. During a boot cycle, the pins seem to “remember” that they are in GPIO mode and set to ‘out’, so those can be omitted after the first invocation.
Firmware updates for AMD CPUs
April 27, 2009 by jonmccuneAMD has recently decided to add support for updating the firmware on its processors on amd64.org. The Linux instructions simply say that the “Microcode update for AMD processors uses the firmware loading infrastructure.” I wasn’t familiar with the firmware loading infrastructure, and it took some serious detective work to figure things out.
I did `aptitude install firmware-tools`
I then noticed (since firmware-tools does not appear to have any meaningful documentation) that /etc/firmware now exists. I then found
this message suggesting that the firmware should live in /etc/firmware, and this message suggesting a directory structure of amd-ucode/microcode_amd.bin. Well, that didn’t work. I received errors to the tune of:
microcode: CPU0: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: failed to load file amd-ucode/microcode_amd.bin
microcode: CPU1: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: failed to load file amd-ucode/microcode_amd.bin
microcode: CPU2: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: failed to load file amd-ucode/microcode_amd.bin
microcode: CPU3: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: failed to load file amd-ucode/microcode_amd.bin
Microcode Update Driver: v2.00 , Peter Oruba
I then ran a simple ‘locate firmware’ command and saw many instances in /lib/firmware. I moved amd-ucode/microcode_amd.bin into that directory, and received more meaningful feedback in `dmesg` (following rmmod microcode; modprobe microcode`):
microcode: CPU0: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: size 1936, total_size 960
microcode: CPU0: patch mismatch (processor_rev_id: 1020, equiv_cpu_id: 1022)
microcode: size 968, total_size 960
microcode: CPU0: updated (new patch_level=0x1000083)
microcode: CPU1: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: size 1936, total_size 960
microcode: CPU1: patch mismatch (processor_rev_id: 1020, equiv_cpu_id: 1022)
microcode: size 968, total_size 960
microcode: CPU1: updated (new patch_level=0x1000083)
microcode: CPU2: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: size 1936, total_size 960
microcode: CPU2: patch mismatch (processor_rev_id: 1020, equiv_cpu_id: 1022)
microcode: size 968, total_size 960
microcode: CPU2: updated (new patch_level=0x1000083)
microcode: CPU3: patch_level=0x1000065
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: size 1936, total_size 960
microcode: CPU3: patch mismatch (processor_rev_id: 1020, equiv_cpu_id: 1022)
microcode: size 968, total_size 960
microcode: CPU3: updated (new patch_level=0x1000083)
Microcode Update Driver: v2.00 , Peter Oruba
It still doesn’t look perfect (i.e., it thinks the particular .bin file is not right for my CPU), but at least now I think I’m using the “firmware loading interface” successfully.
Many links to http://www.urbanmyth.org/microcode/ were also provided, but that site seems to be Intel-only.
UPDATE 2009/05/05:
It was working just fine. The microcode_amd.bin file contains more than one microcode patch, and it’s just an “eccentricity” of the microcode.ko module that it prints a warning about the mismatch.
Subtle bugs in Thunderbird
April 20, 2009 by jonmccuneIn this post I will bash Thunderbird. However, it is my mail client of choice, so even though it is somewhat crappy it is better than everything else.
On OS X: sometimes attachments don’t work correctly. My best An attempt at an explanation is that, when viewing multiple emails with attachments in succession, and trying to open each attachment (e.g., PDFs from a network scanner) by double-clicking on the attached file, sometimes the attachment of the previously viewed email opens instead.
In Linux and on OS X: Auto-checking for new mail in IMAP folders (e.g., I have sieve script that auto-sorts certain emails) sometimes doesn’t work. When it fails, I have to click on the folder before Thunderbird will realize that it contains new messages. Today it actually crashed, and then when I restarted Thunderbird the two folders that get the most mail were re-downloaded in their entirety. This is the first time Thunderbird has actually crashed in a way that I thought might be related to this issue (which is good -> crashes are easier to debug than subtle logic problems).
Anyways, just venting. It would be schweeeet if these bugs got tracked down and fixed. If I had a time machine, I would attempt to do it myself.
Lenny is out!
February 23, 2009 by jonmccuneThough mildly embarrassed that it took me 9 days to notice, Debian “Lenny” has been released! Though good in the long-term, a fair number of machines around here are presently running Etch. So far I’ve updated my webserver which induced a lot more pain than I’d hoped for.
Things to watch out for:
Subversion upgrades may break existing working copies and / or repositories and require some manual work.
One may RTFM here:
http://www.debian.org/releases/lenny/i386/release-notes/ch-upgrading.en.html
Call me Doc
January 16, 2009 by jonmccuneI have a PhD!
First initials only in BibTeX
January 11, 2009 by jonmccuneI have a great big .bib file for my thesis and some entries have full first names and some only have initials. For consistency, I want initials everywhere. Rather than edit these entries, I want to tell BibTeX to just use first initials. Thanks to this page, I realized this isn’t too bad.
I copied plain.bst (on a Mac with LaTeX installed using Fink, it ends up as /sw/share/texmf-dist/bibtex/bst/base/plain.bst) to custom.bst. Then, I found the line containing ‘format.name’ and changed ‘ff’ to ‘f.’, like this:
Before:
{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
After:
{ s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
And of course you must change / add the following before the \bibliography{} entry:
\bibliographystyle{custom}
pyvnc2swf: Capture Screen Video as Flash
January 6, 2009 by jonmccuneI came across pyvnc2swf while looking for efficient ways to do screen capture. This is a really handy program that behaves as a VNC client and captures video of whatever happens. Of course, the VNC server can run locally so there need not be any network involved. The coolest part is that the video is output as a .swf file. The tool is even friendly enough to generate a little .html file so it’s ready to stick on a web page immediately.
There’s also an edit.py which can convert the .swf to .flv or .mpg, although Mpeg support requires PyMedia. I had trouble installing PyMedia, and have not gotten Mpeg support to work. Well, the .deb wouldn’t install on Debian Etch (because many of the required dependencies don’t exist for Etch), and it wouldn’t install on Ubuntu Intrepid Ibex (8.10) because liblame-dev is no longer an Ubuntu package (I think it’s been superseded by other packages but the PyMedia .deb doesn’t know that). Anyways, I suspect building it from source would work fine on Ubuntu but I haven’t tried it.
I also tried using a VGA2USB frame-grabber (several hundred dollars) from epiphan. I could only capture 640×480 video at 10~12 fps (not a problem by itself), and the results were quite noisy (too noisy to be useful for my purpose) in the ~500 MB .avi file that was produced. The .swf file of the same actions was less than 2 MB.