Project, JournalOctober 16, 2009 1:02 pm
Running anaconda 11.4.1.62, the MythDora system installer - please wait...
/usr/bin/python: error while loading shared libraries: libpython2.5.so.1.0: cannot open shared object file: No such file or directory
install exited abnormally [1/1]
disabling swap...
unmounting filesystems...
	/mnt/runtime done
	disabling /dev/loop0 LOOP_CLR_FD failed: 6
	/proc done
	/dev/pts done
	/sys done
	/mnt/stage2 done
sending termination signals...done
sending kill signals...done
you may safely reboot your system

My current theory as to why I can’t install MythDora from DVD or CD or LiveCD is that I have bad burns from OS X. Maybe it doesn’t set all the right “bootable DVD” signals so that something (including libpython) isn’t extracted or mounted at boot. I believe the error message because I can’t find libpython when I mount the image in OS X.

The other possible theory is that the hardware I’m using is just that screwy. Linux is strongest on slightly older hardware (so that someone has written the drivers for it), so I asked for a cast-off. This cast-off, it was finally admitted to me, is unwanted because it was not stable as a Windows XP box. I’ve got another cast-off (same reason, but different-enough hardware to try again) to try.

Argh.

Project, JournalOctober 8, 2009 11:38 am

I mentioned it again Tuesday, Lifehacker Wednesday … I can confidently say that replacing a television subscription service with what you can legally view online is no longer in the “early adopter” range. There’s still plenty of room to build your own (say if you want HD more than AppleTV), so it’s not “commodity” yet either, but the bleeding edge bled elsewhere.

Tips, Project, JournalOctober 5, 2009 10:08 am

So we’ve been thinking that, for as little as we watch TV, the cable bill is rather high. However, we want HD (but now there’s significantly more free HD available), and we need a DVR. I might miss some of the cable channels if I’m sick and at home, but that doesn’t happen often enough to plan for it. I think we could watch over-the-air with a side of Netflix and be perfectly happy. However, I’ll have to roll a DVR replacement because the children expect their shows now, with fast forward and rewind. (Bill Cosby said parents don’t want justice, they want quiet, and we’ve learned how right he is! If we want to eat breakfast without children climbing all over us, that episode of Super Why or Imagination Movers or Mickey Mouse Clubhouse sounds pretty tempting. If they don’t talk to the TV, we turn it off as soon as we inhale our food. Usually, however, they interact with the show and we’re not disappointed with the educational opportunity while we eat in peace and quiet.) Super Why is on PBS so we can watch it over-the-air, and Disney has episodes online and seasons on Netflix. It will take some juggling, but I think we can go without cable. I’m planning a gentle, gradual, slow transition, though.

So that means the first piece of hardware is something to send HD signals to a home-grown DVR. I thought this would be very confusing, a wide field of choices, blah blah blah. Well, it isn’t. After reading bronzefinger, there’s only one choice: the Hauppauge HD PVR. The usual dithering of checking online reviews and trying to imagine which feature set I want is unnecessary without choices. Newegg had the best price, and a rebate that ended that weekend (2 weekends ago), so I just ordered it. We’re still getting the hang of using this box, but so far this glacial move away from the glassy medusa has been surprisingly, disturbingly (as in, why didn’t we do this sooner?) easy.

Tips, Project, JournalOctober 3, 2009 9:31 pm

I happened across the Telematics Freedom Foundation PDF on FLOSS Media Centers, and the chart in the middle was great! For as little as we watch TV, the cable TV bill is gigantic! So we’re considering ditching it (keeping the cable modem of course, but that portion of the bill doesn’t feel as outrageous unless you compare it to most of the rest of the developed world where the US loses on bandwidth to households and price per bandwidth), but we like the DVR feature. So we need to replace it with something like TiVo. From the chart, I eliminated Neuros (don’t want another set-top box, although it does look cool) and MediaPortal (I don’t run servers on Windows). The next filter was that I want to watch and record TV, so that knocked out all but MythTV and Freevo. (Shame; XBMC and its derivatives Plex and Boxee look nice.) Those two have about the same feature sets, but I noticed that Feevo didn’t have keyword search in media library; if I go to the trouble of adding keywords (and I do), I want to be able to search those. So it’s MythTV.

The easy path is probably one of the bundled versions. Of those, Google search results seem to agree that if you can stand the longer up-front install time, MythDora is the easiest. I shouldn’t have to install it too often, and I don’t mind walking away from an installer either, so I think I should burn a copy of MythDora to try it out. Bonus is using RHEL at work might transfer to some comfort with RH’s Fedora Core too (I hope). I’m keeping LinuxMCE in mind too, in case we want to add that home automation. Since LinuxMCE uses MythTV as well, I don’t think it would be a painful transition for us after I install the same libraries and skins, but I suspect that starting there would be unnecessarily complicated.

Finding the right online reference comparing our choices has made all the difference so far. Yay for online!

Project, Unix, CodeSeptember 4, 2009 12:59 pm

Some days have little mysteries.

I was happy to learn the bash trick ${0##*/} to skip using basename (don’t need to add dependencies), and once I learned more about bash substring removal, it made perfect sense. $0 (or ${0}) is the script name, as called, often with leading directory information. You need curly braces for substring removal, so start with ${0}. Use # for stingy prefix matching (the smallest match from the start of the variable), and ## for greedy prefix matching (the largest match). So ##*/ is the largest match of any character than ends with a slash. Since / is the directory separator, that greedy match removes all leading directories from the script name … same as basename, but should be faster.

OK, so I feel like I’ve learned something! A small trick, but it weans me from excessive sed and awk too.

Yesterday’s neat trick was shoving all of my command-line arguments into an array. Why an array? I kept losing the quotes around a string with spaces (user comment) with unexpected script results. This is why I test my scripts! So I don’t have to worry about shift eating the script input, I’m in the habit of storing that input in a variable for safe-keeping; I’m now tinkering with an array for that purpose. (Yes, the implicit shift of getopts can be overridden with OPTIND=1, but $ARGS is immune to other tactics like set too.)

# save the args
ARGS="$@"
# or put the args into an array, space-preserving
typeset -a ARGARRAY=("$@")

The ARGARRAY is great: although I lose the quotes from the command line, the user comment is a single element in the array so it’s safe as long as I quote that variable when I use it. But back on the bash string replacement track: using the command-line input argument array, I quickly noticed that the flags starting with a dash (hyphen) disturb some string matching routines. So since I know about greedy string matching now, I thought this should work:

typeset -a UNDASHEDARGARRAY("${@##-}")

It doesn’t work. It still doesn’t work when I escape the hyphen UDAA=("${@##\-}"); either way, the result is just the same as the stingy removal of UDAA=("${@#\-}"): just the first dash goes away. Phooey.

The only approach I’ve found that works is to use the substring removal twice in a row.

typeset -a UDAA=("${@##\-}")
UDAA=("${UDAA[@]##\-}")
(also works with single octothorpes instead of pairs)

What also works is the overkill of removing all hyphens, leading or trailing or internal, with either

typeset -a ONE=("${@//-}") TWO=("${@//-/}")

However, internal hyphens don’t mess up string matching, and might be significant. One or two leading dashes indicate a flag, an option to the command; any other dashes might be useful.

So my little bash mystery today is why these two arrays are the same with --long-flags:
typeset -a FIRST=("${@#-}") SECOND=("${@##-}")

I don’t like these mysteries, but I know when it’s time to get back to work. I have a work-around, so I’ll use it.

UPDATE 14:09: looked at the strip_leading_zero2 () example function in the Advanced Bash-Scripting Guide to strip possible leading zero(s), and came up with a dash-prefix-stripper that works in one operation:

shopt -s extglob
typeset -a UNDASHEDARGARRAY=("${@##+(-)}")

I’ll ponder that one, and check extglob before set then unset it after.

Macintosh, ProjectAugust 9, 2009 7:33 pm

Unlike Syncplicity (dropping Mac support, failing most of Backup Bouncer), Dropbox passes Backup Bouncer!

sudo /usr/local/bin/rsync -aAHNX --delete --fileflags /Volumes/Src/ ~/Dropbox/bb/
sudo ./bbouncer verify -d /Volumes/Src/ /Users/hope/Dropbox/bb/
Verifying:    basic-permissions ... ok (Critical)
Verifying:           timestamps ... ok (Critical)
Verifying:             symlinks ... ok (Critical)
Verifying:    symlink-ownership ... ok
Verifying:            hardlinks ... ok (Important)
Verifying:       resource-forks ...
   Sub-test:             on files ... ok (Critical)
   Sub-test:  on hardlinked files ... ok (Important)
Verifying:         finder-flags ... ok (Critical)
Verifying:         finder-locks ... ok
Verifying:        creation-date ... ok
Verifying:            bsd-flags ... ok
Verifying:       extended-attrs ...
   Sub-test:             on files ... ok (Important)
   Sub-test:       on directories ... ok (Important)
   Sub-test:          on symlinks ... ok
Verifying: access-control-lists ...
   Sub-test:             on files ... ok (Important)
   Sub-test:              on dirs ... ok (Important)
Verifying:                 fifo ... ok
Verifying:              devices ... ok
Verifying:          combo-tests ...
   Sub-test:  xattrs + rsrc forks ... ok
   Sub-test:     lots of metadata ... ok 

That’s a clean slate for rsync 3.0.6 (patched) and for Dropbox (provisionally)! Nice to know Dropbox should keep my OpenMeta tags intact. At work tomorrow, we’ll see if Dropbox still passes, on the other end of the Dropbox wormhole; that will be the real test of Dropbox.

UPDATE: Not surprisingly, Dropbox doesn’t look as pretty on the other side of the wormhole. It mostly fails everything, so only use it for self-contained files (no extended attributes, no specialized metadata, no resource forks; just timestamps and bsd-flags).

sudo ./bbouncer create-vol Src
./bbouncer create /Volumes/Src
sudo ./bbouncer verify -d /Volumes/Src ~/Dropbox/bb
Verifying:    basic-permissions ... FAIL (Critical)
Verifying:           timestamps ... ok (Critical)
Verifying:             symlinks ... FAIL (Critical)
Verifying:    symlink-ownership ... FAIL
Verifying:            hardlinks ... FAIL (Important)
Verifying:       resource-forks ...
   Sub-test:             on files ... FAIL (Critical)
   Sub-test:  on hardlinked files ... FAIL (Important)
Verifying:         finder-flags ... FAIL (Critical)
Verifying:         finder-locks ... FAIL
Verifying:        creation-date ... FAIL
Verifying:            bsd-flags ... ok
Verifying:       extended-attrs ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:       on directories ... FAIL (Important)
   Sub-test:          on symlinks ... FAIL
Verifying: access-control-lists ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:              on dirs ... FAIL (Important)
Verifying:                 fifo ... FAIL
Verifying:              devices ... FAIL
Verifying:          combo-tests ...
   Sub-test:  xattrs + rsrc forks ... FAIL
   Sub-test:     lots of metadata ... FAIL 
	
sudo ./bbouncer verify -d /Volumes/Src ~/Dropbox/bb | grep ok
Verifying:           timestamps ... ok (Critical)
Verifying:            bsd-flags ... ok
./bbouncer clean /Volumes/Src
./bbouncer clean ~/Dropbox/bb 

So … be careful. On the origin end, your file is fine; on the other end of the wormhole, it might be mangled.

Macintosh, Project 3:22 pm

Past time to run Backup Bouncer on my Synology store-everything plan!

./bbouncer create-vol Src
./bbouncer create /Volumes/Src
sudo /usr/local/bin/rsync -aAHNX --delete --stats /Volumes/Src/ /Volumes/NetworkShare/Dst-rsync1
Number of files: 69
Number of files transferred: 26
sent 4621 bytes  received 655 bytes  2110.40 bytes/sec
total size is 365  speedup is 0.07
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
sudo ./bbouncer verify -d /Volumes/Src /Volumes/NetworkShare/Dst-rsync1
Verifying:    basic-permissions ... FAIL (Critical)
Verifying:           timestamps ... stat: ./some-file: stat: No such file or directory
FAIL (Critical)
Verifying:             symlinks ... ok (Critical)
Verifying:    symlink-ownership ... FAIL
Verifying:            hardlinks ... stat: link1: stat: No such file or directory
stat: link2: stat: No such file or directory
stat: link3: stat: No such file or directory
FAIL (Important)
Verifying:       resource-forks ...
grep: ./some-file/rsrc: Not a directory
   Sub-test:             on files ... FAIL (Critical)
   Sub-test:  on hardlinked files ... FAIL (Important)
Verifying:         finder-flags ... ok (Critical)
Verifying:         finder-locks ... FAIL
Verifying:        creation-date ... ok
Verifying:            bsd-flags ... ok
Verifying:       extended-attrs ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:       on directories ... FAIL (Important)
   Sub-test:          on symlinks ... FAIL
Verifying: access-control-lists ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:              on dirs ... FAIL (Important)
Verifying:                 fifo ... FAIL
Verifying:              devices ... FAIL
Verifying:          combo-tests ...
   Sub-test:  xattrs + rsrc forks ... FAIL
   Sub-test:     lots of metadata ... FAIL
sudo /usr/local/bin/rsync -aAHNX --delete --fileflags --force-change --stats /Volumes/Src/ /Volumes/NetworkShare/Dst-rsync2
Number of files: 69
Number of files transferred: 26
sent 4664 bytes  received 655 bytes  2127.60 bytes/sec
total size is 365  speedup is 0.07
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
sudo ./bbouncer verify -d /Volumes/Src /Volumes/NetworkShare/Dst-rsync2
Verifying:    basic-permissions ... FAIL (Critical)
Verifying:           timestamps ... stat: ./some-file: stat: No such file or directory
FAIL (Critical)
Verifying:             symlinks ... ok (Critical)
Verifying:    symlink-ownership ... FAIL
Verifying:            hardlinks ... stat: link1: stat: No such file or directory
stat: link2: stat: No such file or directory
stat: link3: stat: No such file or directory
FAIL (Important)
Verifying:       resource-forks ...
grep: ./some-file/rsrc: Not a directory
   Sub-test:             on files ... FAIL (Critical)
   Sub-test:  on hardlinked files ... FAIL (Important)
Verifying:         finder-flags ... ok (Critical)
Verifying:         finder-locks ... ok
Verifying:        creation-date ... ok
Verifying:            bsd-flags ... ok
Verifying:       extended-attrs ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:       on directories ... FAIL (Important)
   Sub-test:          on symlinks ... FAIL
Verifying: access-control-lists ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:              on dirs ... FAIL (Important)
Verifying:                 fifo ... FAIL
Verifying:              devices ... FAIL
Verifying:          combo-tests ...
   Sub-test:  xattrs + rsrc forks ... FAIL
   Sub-test:     lots of metadata ... FAIL 

One thing to note is that I need --fileflags with rsync to pass the finder-locks test; other than that the two rsync results look the same. Without the errors, those results are:

Verifying:    basic-permissions ... FAIL (Critical)
Verifying:           timestamps ... FAIL (Critical)
Verifying:             symlinks ... ok (Critical)
Verifying:    symlink-ownership ... FAIL
Verifying:            hardlinks ... FAIL (Important)
Verifying:       resource-forks ...
   Sub-test:             on files ... FAIL (Critical)
   Sub-test:  on hardlinked files ... FAIL (Important)
Verifying:         finder-flags ... ok (Critical)
Verifying:         finder-locks ... ok
Verifying:        creation-date ... ok
Verifying:            bsd-flags ... ok
Verifying:       extended-attrs ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:       on directories ... FAIL (Important)
   Sub-test:          on symlinks ... FAIL
Verifying: access-control-lists ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:              on dirs ... FAIL (Important)
Verifying:                 fifo ... FAIL
Verifying:              devices ... FAIL
Verifying:          combo-tests ...
   Sub-test:  xattrs + rsrc forks ... FAIL
   Sub-test:     lots of metadata ... FAIL 

Or, paring it down to failed tests,

Verifying:    basic-permissions ... FAIL (Critical)
Verifying:           timestamps ... FAIL (Critical)
Verifying:    symlink-ownership ... FAIL
Verifying:            hardlinks ... FAIL (Important)
Verifying:       resource-forks ...
   Sub-test:             on files ... FAIL (Critical)
   Sub-test:  on hardlinked files ... FAIL (Important)
Verifying:       extended-attrs ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:       on directories ... FAIL (Important)
   Sub-test:          on symlinks ... FAIL
Verifying: access-control-lists ...
   Sub-test:             on files ... FAIL (Important)
   Sub-test:              on dirs ... FAIL (Important)
Verifying:                 fifo ... FAIL
Verifying:              devices ... FAIL
Verifying:          combo-tests ...
   Sub-test:  xattrs + rsrc forks ... FAIL
   Sub-test:     lots of metadata ... FAIL 

The NetworkShare volume is a Synology RS-407 running an embedded Linux mounted via AFP (AppleShare). The permission problems (and ownership and hardlinks and resource forks and ACLs) might be how it’s mounted, but I’m concerned about those extended attributes. Might be time to ask Google and friends …

Macintosh, Favorite Software, ProjectJuly 20, 2009 6:36 pm

So I was following the OpenMetaApplications page, and my current crop of tools to test for file tagging (through OpenMeta so that tags are interoperable) is TagIt (an application to tag or browse the tag cloud), Tagger (looks like QuickLook for adding tags), and s-take’s OMSavePanel (an extra window for tagging for every Cocoa Save dialog window) and OMWizard (a “hierarchical” tag browser). We’ll see which ones I’m still using later …

Macintosh, Tips, ProjectJuly 2, 2009 1:00 pm

It’s all about good directions with good pictures. Left on my own, I was very frustrated with Basilisk II because I couldn’t get it to run. I started with the Basilisk II Setup Guide at the Macscene Wiki.

The first tip I needed was to use Nigel Pearson’s v19 for PPC on my MacBook Pro. I was downloading Intel or Universal versions before.

I added the disk image called Network Access.image, but I actually booted from Starterdisk.hfv [ref] just fine.

But the best part of these directions are the screenshots! A picture is worth a thousand words. I made my settings look almost exactly like these (just added Starterdisk.hfv), and Basilisk II booted into System 7.5.5! Holy dogcow!

Now that I’ve got all of the emulators working, it’s time to retire the old clutter! If I ever need to roll back to Mac II MatLab for unexpected reasons (hey, it happened to me once: I had to revive a IIci on a tight deadline!), I can do it without the hardware. None of my Mac IIci computers want to boot right now anyway.

Macintosh, Tips, ProjectJune 17, 2009 1:23 pm

Holy cow! I must be on a roll, because the next emulator I tried was also a waltz in the park. In the comments of an article on How to run Classic (pre OS X) apps on Intel Macs is

Pre-built SheepShaver setup for download
I’ve built a complete SheepShaver install, including _everything_ needed to run, as well as the last version of WordPerfect and several utilities. To download this 243mb image, go to http://groups.yahoo.com/group/wordperfectmac, to the Links section, to the “SheepShaver and Basilisk” folder, and click “SheepShaver-WordPerfect Install”. It’s about 20 minutes on a fast connection.

Enjoy,
John

Yeah, so you have to join that group (I set it not to send me mail, claiming I’d read it on the web), and suddenly there I was scrolling down to the bottom to download. Follow the directions (seriously), and bam! It Really Works.