Inequality, Feudalism, and the Internet

Bruce Schneier speaks at Google on the nascent feudalism in computer security:

Highlights of the talk (some paraphrased and elaborated):

  • There is major inequality in the ability to provide security. Most individual users cannot provide it for themselves. But some big companies can. In fact, the companies are so good that they can provide it for others and bring individuals up to at least a minimal level of security.
  • This is the feudal model of security. Lords provided a minimal living standard in return for labor. They guaranteed that their peasants would survive, and the peasants worked a set number of days or provided a share of their crops as rent.
  • Typically we think of paying for security, but can we stretch the feudal model a bit further? What if users computers (while in screensaver mode or whatever) were used to help with security?
  • When people are afraid they are willing to make interesting bargains.
  • Everyone predicted that automobiles would make transportation faster. No one predicted the suburbs. Second-order social changes are hard to predict.

Strategizing for the Best Parking Space

Mind Your Decisions on parking lot strategy, from Traffic: Why We Drive the Way We Do (which I have purchased but not yet read):

It seems that the people who actively look for the “best” parking place inevitably spend more total time getting to the store than those people who simply grab the first spot they see…

They observed two distinct strategies: “cycling” and “pick a row, closest space.” They compared the results. “What was interesting,” [Professor Andrew Velkey found], “was although the individual cycling were spending more time driving looking for a parking space, on average they were no closer to the door, time-wise or distance-wise, than people using ‘pick a row, closest space.’”

The best way that I have found to operationalize “pick a row, closest space” is to go a few rows out from the row nearest the store entrance(s). It is important to be driving down the row facing away from the store, so that the first spot you reach is the closest.

The Culture That is Unix

We are about one year away from the Unix’s 35th birthday, but I recently enjoyed going through this piece from the 25th anniversary. I especially enjoyed the parts about how Unix was governed, and the way that its origins influenced its organizing structure in later years:

The general attitude of AT&T toward Unix–“no advertising, no support, no bug fixes, payment in advance”–made it necessary for users to band together….

The decision on the part of the AT&T lawyers to allow educational institutions to receive Unix but to deny support or bug fixes had an immediate effect: It forced the users to share with one another. They shared ideas, information, programs, bug fixes, and hardware fixes….

[Bill] Joy began producing the BSD Berkeley Software Distribution. It was first offered in March 1978. The license was on one side of a sheet of paper….

The fact that the BSD release had a simple license agreement, credited those who produced the software, and was priced at the actual cost of the media and distribution exemplifies what was best about Unix in its first decade and what made it such a popular operating system….

Sunil Das, of City University, London, notes that “technically, Unix is a simple, coherent system that pushes a few good ideas to the limit.” But let history not forget that some of those ideas had nothing to do with operating systems; they had to do with sharing, collaboration, and the user-driven evolution of technology supported by a capable, concerned pan-corporate community of developers and users.

Economic Redistribution in the Air

Economists like to talk about helicopter drops of cash as a way to avoid deflation. Passenger airlines can also teach an economic lesson, this one about redistribution:

But aside from the engineering, the most beautiful thing about a long-haul airliner is the economic wizardry which keeps it flying. On board are a variety of seats from the sybaritic to the spartan for which people have paid wildly varying amounts of money, even though each seat will reach the same destination in the same length of time. You may find this class division offensive. However, if you were to try to make aircraft egalitarian, the system would collapse. Without the people in the front paying handsomely to sit in splendour, many of the people in the back could not afford to travel at all. An airliner is in some ways slightly socialist — it redistributes wealth through voluntary means.

This redistribution works in both directions. You can operate business-class-only flights. Indeed, if you can fill them, these are highly profitable. But there is a problem here. Business travellers prefer airlines which offer frequent flights to their destination, since they value flexibility and wish to avoid needless hours or days spent away from home. Without economy class passengers, you cannot operate sufficiently frequent flights to suit business schedules. Hence almost all long-haul airliners are symbiotically configured for mixed classes.

That’s from Rory Sutherland of The Spectator and there’s more here including speculation about how bus systems could use this mechanism and how to improve in-air wifi.

This week and last I have been on several flights, but mostly on Southwest where the variance in ticket prices is somewhat lower than full-service airlines. I’m still waiting for a paper on in-group and out-group dynamics that quickly form during the Southwest boarding process, despite the semi-random ordering of boarding numbers. Everyone who checks-in exactly 24 hours before their flight has some probability of being in the A group, whereas everyone who checks in later has a lower chance. Earlier this year Southwest introduced the option to pay $10 and be automatically checked in at the earliest possible moment. This feature is well worth it, in my opinion–a bargain even if I am subsidizing the beverage service for others.

Bash Script for Editing Playlist Files

music_knowledgeOver the weekend I was working on a playlist for a personal event coming up later this week. The playlist had about 5 hours of music–around 80 songs–that had been purchased from various sources over the years. In order to have a backup of the playlist on another machine I needed to get all of the music files in one place, so I used iTunes’ “Create AAC Version” tool.

The problem with this was that many of the new files were named in the format “#{song_number} #{song_title}.m4a”. For instance, “Dustland Fairytale” by The Killers was “05 Dustland Fairlytale.m4a.” I could’ve spent my Saturday night manually clicking through and editing the filenames, but fortunately I knew that with a little bash scripting I could automate the whole process.

Rather than show the entire script right away, I want to go through the process of composing a bash script to solve this type of problem. First, we know that we can rename files using the mv command:

mv oldfilename newfilename

Next, it’s important to know that you can loop through all .m4a files (or whatever other extension) in a given directory by:

for i in *.m4a
do
  [do stuff here]
done

Within the for loop we access the filename by "${i}". Your code inside the do block could be something simple like echo "${i}" or something more complicated spanning multiple lines. We can also index the filename strings in the form "${string:startindex:endindex}". If we leave off the last index it defaults to the end of the string. (You can also index from right to left, but we omit that for simplicity here.) All of the numbers I was dealing with in the playlist file were two-digits with a space separating them from the song title. So basically I wanted to drop the first three characters of the string (indices 0, 1, and 2). We can print out the shortened filenames by:

for i in *.m4a
do
  echo "${i:3}"
done

But if you do that and some of your files don’t start with numbers, you will see that it chops off the beginnings of those filenames. To avoid this, we need to use an if then statement to check whether the files begin with a number. For this it is sufficient to check whether the first character of the filename is “0”:

for i in *.m4a
do
	if [ "${i:0:1}" == "0" ]
	then 
		echo "${i:3}"
	fi
done

We just print the modified filenames in order to check whether our script operates as intended. This is an important caveat to bash scripting–check whether your script does what you want before you run it. Bash scripts are like sharp blades: in the hands of a master they are a wonderful tool, but in the hands of an amateur they can be deadly. I’m closer to the amateur end of the spectrum so I prefer to be careful. Once we are satisfied that our little tool is only chopping off what we want it to, then we are ready to compose the whole script with that mv command:

for i in *.m4a
do
	if [ "${i:0:1}" == "0" ]
	then 
		mv "${i}" "${i:3}"
	fi
done

If you put this in a script.sh file in the same directory as your playlist then you can just run bash script.sh from your terminal.

OK, so that may not have saved me that much time but it was way more fun than clicking through all those files!

the_general_problem

Note: There are probably many other ways to accomplish the same outcome described in this post. This may include other music file managers, other export methods from iTunes, or even handy bash one-liners. The point was not to give an optimal method for organizing playlists but to show the process by which a bash script evolves to solve a simple one-off task.