experiments in IPv6

I have been hearing that a new version of the TCP/IP addressing system is “imminent” since 1994. 18 years later, I have been moved to look into it, to see what it offers or requires. I found more requirements than benefits, some of which are noted below.

The argument is the old addressing scheme doesn’t have enough addresses to go around and it’s design subdivides it inefficiently. There are probably other more technical arguments but those are the reasons more often cites in favor of migrating to it: more address space, less waste. From Wikipedia:

In IPv4 an address consists of 32 bits which limits the address space to 4294967296 (232) possible unique addresses.

You’d think 4 billion addresses would be enough. Maybe so but then some people have been (mis)quoted as claiming the global market for computers was less than 10 or that no one would need a computer in their home. They could not have imagined either the network of today or the devices people use to access it.

IPv6 expands the pool a bit:

Mathematically, the new address space provides the potential for a maximum of 2128, or about 3.403×1038 unique addresses.

I self-host a couple of domains, complete with internet-connected email and web service so this may not apply to a lot of people.

The first thing I needed was access to the IPv6 internet. This doesn’t mean a new ISP so much as either having one that supports it already or using a tunnel service that encapsulates IPv6 packets in innocuous IPv4 packets, allowing them to be unpacked upon receipt. I have CenturyLink (née Qwest) and they don’t do IPv6 yet. So I went with Hurricane Electric and now have free access to services on IPv6. The folks at Hurricane have been doing this for quite some time and have probably answered your questions already. And there is an active forum community as well.

A handful of large public sites offer their content to both varieties — www.ipv6.apple.com, ipv6.google.com, ipv6.cnn.com, to name a couple. Lots of resources in the free/open source software world, as well. Microsoft requires it to be installed in some of its server products, even if you have no plans to use it.

So that’s all good. The equipment here all understands IPv6, from iMacs and MacBooks to a FreeBSD server and a Time Capsule used as a network interface to the ISP we use. So I set up the Time Capsule with the options I got from Hurricane Electric: you’ll need to use an older version of Airport Utility, as of this writing, since 6.0 doesn’t allow access to the IPv6 settings. Their setup page has the options you need for each dialog field:

In your network settings (here’s the Preference Pane in OS X Lion), turn on IPv6 and let it work it’s magic with auto discovery/autoconfig:
Apply those changes and you should be good to go.

To test it, use the Terminal/console app of your choice:

# ping6 ipv6.google.com
PING6(56=40+8+8 bytes) 2001:470:b:839:230:1bff:feaf:42c8 -->; 2001:4860:8005::69
16 bytes from 2001:4860:8005::69, icmp_seq=0 hlim=55 time=88.143 ms
16 bytes from 2001:4860:8005::69, icmp_seq=1 hlim=55 time=84.827 ms
^C?--- ipv6.l.google.com ping6 statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 84.827/86.485/88.143/1.658 ms

So you can now ride out on IPv6. Check out the sites listed up top and see if they work. Or try http://ipv6-test.com/ .
But what if you want to host services for an IPv6-enabled public? That’s a little trickier, with some previously undocumented gotchas.

Untitled (Self-Portrait)




Untitled (Self-Portrait)

Originally uploaded by escapetonewyork.

One of my Flickr contacts was accepted into the Outwin Boochever Portrait Competition Exhibition at the Smithsonian National Portrait Gallery in Washington, D.C.

“I should remain humble and say that being accepted is all I could hope for, but please may I have the $25,000 prize and commission from the National Portrait Gallery?”

Fingers crossed on this one . . . .

never have so many been deluded by so few for so long

It was a brutal year for the conservative movement, which at long last came crashing down after dominating American politics for nearly 30 years. One small consolation for at least some leading thinkers on the right is that they began to demonstrate perceptiveness that by and large eluded them in preceding years. Here are the top twelve insights of prominent conservatives in 2008:

[From TPMCafe | Talking Points Memo | The Top Dozen Insights of Conservatives, 2008]

You can read all that if you like, it’s amusing in its cluelessness, but a commenter sums up their core principles thusly:

Conservatives are for government smaller than liberals define it.
Conservatives are for taxes lower than liberals set it.
Conservatives are for regulation lesser than liberals define it.
Conservatives are for what non-Christians are against.
Conservatives are for what non-whites are against.
Conservatives are for what non-heterosexuals are against.
Conservatives are for what non-Americans are against.

They don’t have to define what they really believe. They just have to wait for liberals to say something and they’re against it. And if the answer isn’t clear enough, the rhetorical geniuses of the conservatives movement will be happy to fill in the blanks.

[From TPMCafe | Talking Points Memo | The Top Dozen Insights of Conservatives, 2008]

The word reactionary comes to mind.

iTunes library, fixing a broken one or moving one

find your Music folder/directory where these files live: you are looking for iTunes Library and iTunes Music Library.xml The XML file is a backup of the other file, which is the one iTunes uses: iTunes Library: data iTunes Music Library.xml: XML document text Move the iTunes Library file aside (rename it, put in your home directory, whatever)…. An example: <key>Location</key><string>file://localhost/private/Network/Servers/shuttle/usr/local/share/mt-daapd/media/Abbado_Berliner%20Philharmoniker/Mahler_%20Symphonie%20No.%205/01%20Trauermarsch.%20In%20Gemessenem%20Schritt.%20Streng.%20Wie%20Ein%20Kondukt.m4a</string> A quick and dirty way to do it on the command line, ie, in the Terminal?


I see some discussion about fixing busted iTunes libraries, either when moving one on the same computer or migrating to a new one. Here’s what I have found works for me.

Bonus: no slow AppleScripts or payments (donations cheerfully accepted and squandered). After almost 3 1/2 years more than four years, this continues to be a widely-read posting and still seems to work. I thought it was made obsolete with iTunes 8 or somewhere along there… As it’s been viewed more than 111,000 times and been found useful a few of those times, I wouldn’t object to a donation. But rather than spend your money, you could do me a favor and help yourself at the same time. Click that link and if you buy something at Amazon.com, they’ll send me a penny, maybe more. No obligation but also no cost to you.

As an aside, if you are going to comment along the lines of “I just moved my music from one Mac to another and nothing broke so why is this so complicated?” please don’t bother. The title specifically mentions a BROKEN library, you dig? Or perhaps your library has outgrown the current location and you want to move it but retain access to it as your primary library and keep all your playlists and history. That’s what this post deals with, not replicating a working installation, but changing one to suit a new environment or fixing a botch attempt at it. Peace.
And for goodness’ sake, read all the comments: some good stuff down there. Sadly, I had to throw away all the comments, as I disconnected them from the posts they were in response to.

First, what I have discovered about how iTunes manages music collections. There are two files it uses, one that is binary (ie, machine readable for faster performance on searching, sorting, add/edit/delete operations) and one that has the same information but in a human readable format (for a certain subset of humans who can read XML natively). The XML file is written from the binary file as a backup (check the dates to confirm).

Picture 16.jpg

iTunes will try to open the binary file when it starts up and if it’s not readable, it will re-create it from the XML file. That’s what we’re using to fix the damage or make any sweeping changes.

First, close iTunes. You’ll be working with files it uses/writes to and you’ll muck things up if you makes changes to files it has open and then your changes get clobbered, leaving the binary and the backup unusable. Don’t do that.

  1. find your Music folder/directory where these files live: you are looking for iTunes Library and iTunes Music Library.xml
    The XML file is a backup of the other file, which is the one iTunes uses:
    iTunes Library: data
    iTunes Music Library.xml: XML document text
    [NB for Windows users: you will be looking for iTunes Library.itl and iTunes Music Library.xml.]
  2. Move the iTunes Library file aside (rename it, put in your home directory, whatever). Create an empty file with the same name (or simply mangle a copy of it: seriously: this is where the backup copy comes in). If you are in the Terminal, you can just use touch(1), as in touch iTunes\ Library. You can also just open a file in whatever other editor you like and save it as iTunes Library.
  3. You’ll need to edit the XML file, in a text editor, not a word processor (not Word, as if I have to explain that). vi, emacs, pico, nano, TextWrangler, BBEdit, TextMate on the Mac side, NotePad/WordPad, et al on the Other Side. You are going to search and replace the current location with the new one. Every file/track/song has it’s own stanza in that file and within that, there is a Location key. You need to replace the old one — as an absolute path — with the new one.
    An example: <key>Location</key><string>file://localhost/private/Network/Servers/shuttle
    /usr/local/share/mt-daapd/media/Abbado_Berliner%20Philharmoniker/Mahler_%20Symphonie%20No.%205/01%20
    Trauermarsch.%20In%20Gemessenem%20Schritt.%20Streng.%20Wie%20Ein%20Kondukt.m4a</string>
    Picture 17.jpg
  4. A quick and dirty way to do it on the command line, ie, in the Terminal?perl -pi -e.backup s|oldpath|newpath|g iTunes Music Library.xml
    perl -pi.backup -e s|oldpath|newpath|g iTunes Music Library.xml

    This will create a backup file (cleverly called “iTunes Music Library.xml.backup”)

  5. Now, test it. iTunes needs to find that iTunes Music file and since it can’t read it (it’s empty or damaged), it will create one from the backup you just edited. Give that a minute or three to complete. See if your files are found and playable. This should also keep your playlists (which are just another XML stanza with the elements being track ID numbers).

This has worked for me more than once and if it’s reproducible, it should work for you. But note that I recommend a backup copy of the XML file. You can go back and re-do it from scratch if you get into trouble.

And I expect this is extensible in many interesting ways, like merging libraries from different users (something with diff and patch, perhaps?), switching from one repository to another (maybe a large home repository and a smaller traveling one). I’m not clever enough to figure those out, but if anyone else does, I’d love to hear about it.

[update] This looks interesting:

I had to do some more things with my iTunes library lately – like extracting all that ratings and exporting them into a new music player software I liked to test. I therefore wrote myself a little tool in C# that does the job of reading in the whole iTunes library and giving you programmatically access to that library. It only needs to have read access to the Mediathek.xml file iTunes stores in it’s music folder and you from there on can work your way through the bazillions of music tracks you may or may not have in your library. It even does the find-and-replace job a bit easier than the solution mentioned in the article above.

what he said

Style is what you get wrong, that makes what you do sound like you…. [From Neil Gaiman – Neil Gaiman’s Journal: what you can’t help doing ] I think ” your mistakes are your style ” sounds better, but whatever.

Style is what you get wrong, that makes what you do sound like you. Style is what you can’t help doing. Style is what you’re left with.

[From Neil Gaiman – Neil Gaiman’s Journal: what you can’t help doing]

I think “your mistakes are your style” sounds better, but whatever.

shoulda seen this coming

– NetNewWire (my RSS reader of choice) and FeedDemon are going free, ad-supported…. One of my last hold outs in the “dedicated desktop app” space.

I just got a license key for free a few weeks back. Oh, well . . . good for Brent, the cross-town indie developer.

Whuuut? – NetNewWire (my RSS reader of choice) and FeedDemon are going free, ad-supported. NNW is awesome. One of my last hold outs in the “dedicated desktop app” space. [Newsgator] [From Blowing Out the Dust: Afternoon Edition]