George Will on the FISA violations

slaniel | Uncategorized | Thursday, February 23rd, 2006

George Will has finally gotten around to being a conservative, making some small stink about the FISA violations and how they’re all of a piece with the administration’s view of governance generally. Again, I think the degree of his moral outrage is much less intense than it ought to be, but one takes what one can get from a GOP water-carrier.

In any case, I think he pretty much negates all the force of the article in the last paragraph:

But 53 months later, Congress should make all necessary actions lawful by authorizing the president to take those actions, with suitable supervision. It should do so with language that does not stigmatize what he has been doing, but that implicitly refutes the doctrine that the authorization is superfluous.

This turns his entire piece into a rather lame broadside against certain procedural violations, rather than against the actual actions that the president has been carrying out in our name. That is, go ahead and gut FISA, so long as a secret court and closed-door hearings in the Senate Intelligence Committee are watching over it.

Shouldn’t a man who professes a love of conservative principles have more respect for transparency in government?

P.S.: While we’re at it, I really have no problem with opposing earmarks, if they’re such as Will describes. Though it’s easy to attack “pork”; how much does pork really add up to? Let’s see Will attack defense spending, or farm subsidies. For that matter, let’s see him attack a Republican. Or let’s see him hold up a Democrat as an paragon of fiscal virtue. I’m curious whether he ever praised Warren Rudman.

Relational databases

slaniel | Uncategorized | Sunday, February 19th, 2006

I know squat-all about relational databases. I’m looking at various Wikipedia articles on the subject — including, e.g., the one on database normalization — and they don’t make sense. They all seem to assume that I know more than I do.

I have some mathematical background. I think I could understand databases quite deeply at several levels, including the level of how to actually put databases together, and the level of the underlying math. Could someone point me to good books on these subjects?

P.S.: With a little more reading, the article makes a little more sense. But it still was clearly written by a team of people with different styles and assumptions, as one would expect from the Wikipedia. They need better editing.

P.S.: There’s a further-reading section at the bottom of that article, including an AWL book in its eighth edition (An Introduction to Database Systems by C.J. Dale). Friend Seth has previously recommended Mastering Data Modeling: A User-Driven Approach by John Carlis and Joseph Maguire.

P.P.S. (24 Feb 2006): Friend Bijoyini recommends Database: Principles, Programming, and Performance, Second Edition by O’Neil and O’Neil.

Planning for the worst

slaniel | Uncategorized | Sunday, February 19th, 2006

I’ve been a little paranoid recently about doing various tasks at work. Even on little things: we’re changing domain-name registrars, and in the changeover from one registrar from another we lost some domain-name records. So for a short time, some of our domains were down, and I had to scramble to recreate the DNS records on the new registrar. It took a (mercifully) short time for the DNS changes to propagate, so the total downtime was probably only an hour. And thankfully we were switching registrars only for our relatively low-traffic domains, as a test for the big registrar switches that we’ll be doing sometime later. At least we now know what to worry about the next time we make a switch. In particular, we’re going to want the registrar switch to go into effect at around 4:00 in the morning on a Sunday, if such a thing is possible, so that one of us can wake up and change the DNS entries when no one is visiting the sites.

It’s a new experience for me to be working with highly mission-critical services that a lot of people are using. I’ve helped switch clients over from one mail service to another, or one host to another, and that involves a fair bit of stress. But the stuff I’ve had to do for work has been of an entirely different order.

Example #2 of this comes from a little script I wrote with my boss a couple weeks ago. The goal is to get log rotation for our Apache logs, à la logrotate. Logrotate is nice, but for various reasons (none of which I can remember now) we couldn’t use it. (I wish I could remember. It would make the story somewhat more interesting.)

So we had to roll our own script. The main goal was to lose absolutely no log entries from our high-volume websites. First of all, this means running the script at 4:30 a.m. Sunday morning, when the amount of traffic is at its lowest. The first useful approach we considered was to cut the oldest website hits — those that were two weeks old or older — out of the current access log and paste them into a new file, then delete them from the current access log. Since we’d be cutting the oldest entries, we wouldn’t (so the thought went) interrupt Apache: Apache writes new entries to the end of the file, while we’d be cutting from the beginning. In outline form, we’d be doing this:

head -n $NUMLINES currentlog > oldlog sed -i ‘1,${NUMLINES}d’ currentlog 

That didn’t work, however. When sed is invoked with the ‘-i’ (“edit in place”) argument, it opens the file for both reading and writing. Since Apache also has the file open for writing, it freaks out: it needs to have exclusive write access to the file. After it fails to get a lock on the file, it stops writing to that file. That is, from the moment we invoke sed -i, Apache can’t write to the current access log; we would need to restart Apache (via apachectl graceful). So this approach doesn’t work. (As a sidebar: I wish there were some way to get finer-grained read-write access to a file. By all rights, Apache shouldn’t freak out about someone else trying to write to the same file; I know that I’ll be writing to different lines than Apache will be, but Apache doesn’t know that. And in a flat text file, there is no way to specify record locking; one can only lock entire files. For record locking, we’d want to use something like a database, and for a lot of reasons it occurs to me now that maybe a database would be the best way to structure large log files. Huh. Maybe I’ll propose this at work.)

Fortunately I was paranoid about getting this to work right, so I was very careful about testing this approach on a non-production logfile before deploying it on our server. I used a test server, created a test HTML file, and used ApacheBench to hammer the server with a large number of hits. Then I deployed a trial version of the script on the test server, which cut any hits out of the access log that were 5 minutes old or older. When I ran this test script, I noticed that the access log stopped writing. So that was safe, and I fixed the problem before deploying it to the new server.

Approach number 2, in response to the exclusive-lock problem, was to

  1. Copy the oldest lines from the current access log to a new file (this step doesn’t require us to get a lock on the current access log);
  2. Copy the current access log to a temporary file;
  3. Delete the oldest lines from that temporary file; and finally
  4. Copy that temporary file back over the current logfile.

We’ll lose some Apache hits between steps 3 and 4. In particular, we’ll lose whatever hits may have come into the current access log between the deletion and the copy. But with any luck, if we run this early in the morning on Sunday, we won’t lose terribly many hits. And this seemed to be the best we could do.

We tried this out on a low-volume website, and got a series of little bugs that I ironed out throughout the week. By the end of the workweek, we felt comfortable going ahead and doing the log rotation on our main website’s files. It ran today at 4:30 a.m.

 . . . And so I just discovered an additional problem that comes with scale: since the logfile for our main website is gigantic, all the temp files and so forth take up a large amount of space. Our current log is somewhere on the order of 2 gigs, and even since the beginning of today it’s added something like 50 megs. When the script created temp files, it rapidly consumed all the disk space on that partition. Had the sed -i worked, I don’t believe we would have had this problem, since the file would have been edited in place and would only have consumed a little bit of scratch space. But alas, we did consume all the disk space, and the script failed. Schematically, here’s how the script looked overall:

for each LOGFILE in SETOF_LOGFILES; do TMPFILE = file with some unique name NEWFILE = file with a unique name based on LOGFILE’s name copy oldest lines from LOGFILE to NEWFILE copy LOGFILE to TMPFILE delete oldest lines from TMPFILE copy TMPFILE over LOGFILE done once above loop has finished, compress all old-log-entry files using gzip move all gzipped files into ARCHIVE directory for future post-processing 

I think part of the problem is that while the loop is running, we’ve got a lot of temp files laying around, taking up a great deal of space. What we need to do is gzip each of them as they appear, then move them elsewhere immediately.

The lesson in all of this is that it’s really hard to think of all the problems that will arise when scaling from a test environment to a production one. Time for me to go off and fix this up.

A walk and a couple shouts out

slaniel | Uncategorized | Sunday, February 19th, 2006

Just a quick note: I got pizza tonight with a few friends at Pizzeria Paradiso, a pizza shop that somehow only ends up at item 5 in a Google search for "Pizzeria Paradiso"+d.c. What is the deal.

Anyway, their pizza is amazing. I meant to mention this after the first time I ate there — at the Paradiso near Dupont Circle. The one in Georgetown is just as good, and has Belgian beers on tap downstairs. Have mercy. Good lovin’. Certainly the best pizza I’ve had in my limited time in D.C., and among the best pizza I’ve ever had: delicate crust, perfectly chosen toppings, and very little grease.

While I’m at it, I should note that I’ve found a very nice bookstore around here: Olsson’s, also just outside Dupont. Its ratio of awesome books to total inventory is alarmingly high, and they have an entire wall (amounting to perhaps 15% of the store’s inventory) devoted to staff recommendations. It may have fewer books than Kramer’s, but what it has is better.

And finally, I’m in a great mood after a really good walk back from Paradiso tonight. It was cold out, but after I got walking it was just brisk. I don’t breathe deeply enough, normally, so tonight I made it a point to take in a lot of air. It made me feel great. Maybe I’ll feel even better after my first yoga class on Tuesday morning.

The Cheney shooting thing

slaniel | Uncategorized | Friday, February 17th, 2006

I don’t care much at all about the Cheney shooting incident. People have been making a tremendously big deal out of it; I think I would find it absurd even normally, but as it stands I’ve really reduced my intake of blogs. Standing just slightly on the outside of this, it seems like exactly the kind of thing that gives liberals a terrible name.

Anyway, the thing I want to point out is that I’m tired of seeing headlines saying “Cheney Takes The Blame.” Of course he took the blame: he shot the guy. What choice did he have?

Only in a political climate as fucked up as the one we’re in would it be considered news that someone in the Bush administration took responsibility for a mistake.

udev in Dapper

slaniel | Uncategorized | Thursday, February 16th, 2006

The version of Ubuntu now in development, known as Dapper Drake, seems to be focusing mostly on udev. I think this ultimately feeds into improvements for Linux on laptops. In the meantime, it sucks. I have had no end of networking problems caused by what look like weird timings in the way that udev recognizes network cards, names them, starts the appropriate daemons (notably wpa_supplicant), and so forth.

My sense is that someday soon, udev will make the world much, much better for Linux laptop users. In the meantime it is the badness.

Shalimar the Clown

slaniel | Uncategorized | Tuesday, February 14th, 2006

 . . . is a perfectly fine book, not at all up to the level of Midnight’s Children or (more sublimely still) The Moor’s Last Sigh. At points Shalimar is a political polemic about the end of Kashmir; at points it’s a personal attack on the Islamic fundamentalists who kept Rushide on the run for so long; quite often it returns to the theme that the ancient stories of lust and betrayal and faith and death and birth return again and again whether we want them to or not. More often than feels comfortable, it is a Love in the Time of Cholera-style tree-structured wandering through the lives of its characters, done without the grace of Cholera and with rather more heavyhandedness than feels right. Sad to say, it is not an especially captivating book — not bad, but nothing that would have drawn much attention had a lesser author written it.

And then in the last 50 pages it just kind of gives up, believing that it needs a certain kind of closure. In the final two pages it crystallizes that closure in a really awful way. When the book is over, my belief is that you’re supposed to either sit there in stunned silence for a few minutes, taking in the amassed profundity that has gathered near the end; or just feel sad that your new life with this book is over. The story that I’ve heard says that the last chapter is supposed to be more profound than the rest of the book before it, that the last page is supposed to be more profound still, and that the last sentence should be the most profound part of the whole work. Shalimar doesn’t get profound; it just gives up.

Blink

slaniel | Uncategorized | Tuesday, February 14th, 2006

I got in a conversation today with a friend whose taste in books I trust quite strongly, and he asked me with a dejected tone of voice whether I’d read Malcolm Gladwell’s book Blink. He’d read it, I think in part because he wanted to avoid being the last person in the world to read it, and he was underimpressed.

Everyone I’ve spoken with about Blink has told me that it’s about our natural ability to make snap, instinctive decisions about whether someone else is our friend or our foe, helpful to us or harmful, a suitable lover, etc., etc. Gladwell covered some of the same ground in a 2000 New Yorker article, which seems to be all I really need to read of the larger work.

Unless someone reads it and tells me otherwise — and thus far all the people I’ve spoken with about the book have not contradicted this — it seems to me that the book leaves out a vital bit of information: if it’s true that people have evolved a sixth sense about other people (which seems to me beyond dispute), they have also developed a seventh sense for pretending to be what they aren’t. That is, just as we develop a finer and finer nose for whether someone’s lying, we develop better and better skills at lying. As men develop a finer intuition for whether a woman makes a suitable mate, women develop means of pretending they’re something other than they are: makeup, clothing, liposuction, etc. (And of course the same is true of men: shoulder padding for suits makes us look burlier than we are; cologne covers up the foul odor of death and decay that lurks beneath us all; and so on.)

So while it’s perfectly clear that humans are exquisitely tuned machines for reading other humans, it is likewise clear that we’re great liars. And the net effect of this is  . . .  possibly zero. Read The Red Queen: Sex And The Evolution of Human Nature for a good examination of all the issues here.

However, I’m still willing to be convinced that Blink contains some novel bits. If anyone wants to sell me on the book, go right ahead.

Queries

slaniel | Uncategorized | Friday, February 10th, 2006

It is a great and lovely thing to scan through the search strings that people use on your site. It is quite funny to do it through the Google referrers in your logfiles, but I submit it is humorous on a different plane — sublimely so — to look through the Blosxom logs for the searches people have done using the blog’s own search tool.

Without further ado, here are the most recent few:

  • apopathic
  • hot dog volume
  • rsync
  • Stevie Waltien
  • blow job
  • If you roll two standard dice, what is the probability that the sum of their spot values will be a prime number?
  • Probability of a prime number from two dice
  • Dice
  • abbey
  • abby
  • rsync

In some sense, those 11 queries may be said to contain the entirety of this blog, in koan or haiku form. The sixth evinces a tragic misunderstanding of  . . .  I want to say “the web,” but I think it goes much deeper than that (cue Jimi Hendrix).

Thank you, Blosxom search tool. Thank you.

Checking my math

slaniel | Uncategorized | Thursday, February 9th, 2006

I was trying to work out the other day how much money one should deposit in a retirement fund every year to attain a fixed retirement goal. I worked it out, and now I wonder if people could check my math.

(Also I hope the formula will be helpful in some way.)

“Missed Opportunities”

slaniel | Uncategorized | Thursday, February 9th, 2006

A headline on the front page of the New York Times right now says “Some Democrats Are Sensing Missed Opportunities”.

I refuse to even read that article. If they are just realizing this, we are fucked.

P.S.: Looks like Jason got there way before me. He had the intestinal fortitude to read the article. Bravo, Jason.

My niece

slaniel | Uncategorized | Wednesday, February 8th, 2006

 . . . rules. She is also a superhero. Jasmine Nova Laniel, Supergirl

James Taylor

slaniel | Uncategorized | Wednesday, February 8th, 2006

A friend pointed out to me the other day that he’s now at a point in his life where he can appreciate James Taylor. I confess that Taylor has always been a guilty pleasure for me, but it’s become less guilty over time. And listening just now to “Shower The People,” I’m reminded of how fantastic and lovely a song it is. It wouldn’t be possible, I don’t think, to write a song like that nowadays and release it on any label other than Windham Hill. But it’s just a really good song, and it’s always made me cry.

Incidentally, the oft-heard story about “Fire and Rain” being about Taylor’s fiancée dying in a plane crash appears to be an urban legend. It’s a damned good urban legend, though. If I were to construct a legend from the text of a song, I probably couldn’t construct as good a story that hews as closely to the song. I’m glad to see that our urban legendists are gainfully employed.

Gonzales not sworn?

slaniel | Uncategorized | Tuesday, February 7th, 2006

Wait a second: did Alberto Gonzales not testify under oath today?

Superbowl commercials

slaniel | Uncategorized | Monday, February 6th, 2006

Sign #2,384 that I am growing old: I no longer can watch the Superbowl for the commercials. Indeed, I can no longer watch the commercials at all. In general, I just can’t watch commercials: starting a couple years ago, my tastes turned to movies with very long shots, and I found that watching TV shows or commercials with brief (typically two- or even one-second) shots physically nauseated me; I had to turn away from the screen when they were on. I’m still that way, and watching commercials is just something that I can’t do.

(Sign #2,383 was that I could no longer watch bad movies to laugh at the badness — unless I have my CMU friends near me, all of whom make such movies much, much more enjoyable.)

The Divine Comedy

slaniel | Uncategorized | Monday, February 6th, 2006

Can anyone suggest for me a translation of Paradiso and Purgatorio? The default translation of Inferno that everyone suggests is Robert Pinsky’s, and indeed it’s a lovely book (I have no basis of comparison, so I can’t say whether it’s the best, but I have no complaints about it) with lovely typesetting and design. No one seems to have anything to say about the other two volumes, however. Any suggestions?

Master of the Senate, almost done

slaniel | Vol 3: Master of the Senate | Saturday, February 4th, 2006

My only complaint about Master of the Senate — and indeed, about the entire 2,000-odd pages of the first three volumes in The Years of Lyndon Johnson — is that it doesn’t really give a convincing explanation of whether Johnson, at heart, cared about black people. Caro explains quite clearly why Johnson suddenly shifted toward the cause of civil rights — namely, that black people were gaining political and economic power, and were moving to northern industrial cities in droves. Without support from blacks, the Democratic party would be in the thrall of its racist southern faction, and would lose the many electoral votes that Illinois, New York, Michigan, and Pennsylvania had to offer.

So the best explanation seems to be that Johnson was looking out for his own electoral chances in 1960. What’s not clear is whether he actually had any feelings for his fellow-men. Caro spends three volumes carefully mapping out Johnson’s ambition, and only really spends a chapter laying out a weak case for Johnson’s compassion. It’s largely built on his years teaching in a school for poor kids in Texas on the border of Mexico when he was quite young, and helping the people in his Congressional district get electricity during his early years in Congress. And it seems largely contradicted by the rest of the books.

My basic problem with Caro’s analysis here is that it reduces to the following: whenever it was good for Lyndon Johnson, Johnson helped other people. But this doesn’t prove that the man was moral; in fact, it suggests that he’s entirely amoral. If you never do anything that sacrifices your own well-being for someone else’s, you can’t be said to have an ounce of altruism in you. The only way out of this that I can see is if Johnson had a very long term plan that involved his assuming the presidency and then helping people; in the meantime maybe he felt that he could be a ruthless politician, on the road to greater ultimate goods. The morality of this road is debatable, but in any case Caro gives no sense that Johnson had it in mind.

I’m as confused as ever about the two major political parties. For one, I don’t understand what beliefs held 1950’s- and 60’s-era Democrats together. The story seems to be that the South stuck with the Democrats because they never forgave the Republicans for Reconstruction. Northern Democrats throughout the ‘50’s and ‘60’s — people like Hubert Humphrey — agitated for civil rights, and the Southern Caucus continually fought them off using clever parliamentary maneuvering (particularly the filibuster). Is it really only hatred of Reconstruction that kept the party together?

As for the Republicans, my sense as I near the end of this book is that they were looking to be the first party to move on civil rights, as a way to undermine the Democrats and draw more blacks into the fold. This is around 1956. So what happens between 1956 and 1964 that forces the Democrats to be the champions of civil rights, forces the south to break off from the Democrats, and leaves the Republicans as the party of “states’ rights”? If anything, it looks as though the Republicans are in a better position by 1956 to reap the benefits of desegregation and voting rights. Did Nixon (presiding over the Senate as vice president in 1956) really have the Southern Strategy mapped out that far ahead of time? Were Republican moves toward civil rights really meant as a cynical move to destroy the Democrats? If so, then I have to give Dick Nixon a lot of credit as a brilliant political strategist. If he could foresee that Lyndon Johnson would be running for president in 1960 (not hard to guess, from what I can tell), and that Johnson would need to get the Southern monkey off his back if he was to stand any chance at the presidency, and if Nixon moved appropriately to force the Democrats to do something self-destructive then  . . .  I’m actually kind of in awe.

My next book, or one soon thereafter, will have to be The Politics of Rage, about George Wallace and, presumably, the period between the 1950’s and Nixon’s presidency. It certainly makes today’s politics a little easier to understand.

P.S. (12:15 a.m., 5 Feb): I just finished it. I might add on another word of warning, which is that I think Caro really enjoys hearing himself talk. The final 300-odd pages of Master of the Senate could probably have been compressed to 150 pages without losing terribly much. That said, those 300 pages are also a very tightly described journal of the passage of the 1957 Civil Rights Act, down to insanely minute particulars. If you’re into that, cool. If you think that the larger story arc would have come through the muck a bit more clearly had there been less muck, then you might be inclined to scream for an editor.

But these books — all three volumes of them — are such masterpieces that any such comments seem like senseless griping. Caro is a master, and I will gladly buy anything else that he writes. Once I’ve had a little time away from him, I intend to read his bio of Robert Moses.

Oh, I should also note the conditions under which I finished this book. I went cold turkey on coffee on Thursday and today (Saturday), and will do the same on Sunday. (I’ve not decided yet whether I’ll make this a permanent habit. I do love the taste of coffee, but it’s also an addiction that’s getting stronger as the years go by.) My brain was not happy with me for the abstinence, and refused to turn on for hours and hours. Around noon I fell asleep for two solid hours, and really didn’t have a brain to speak of until I took a little pre-emptive Advil to dilate some capillaries and get things moving up there. I probably could have finished Caro’s opus a few hours earlier, had my head coöperated.

A searchable video archive

slaniel | Uncategorized | Saturday, February 4th, 2006

I’m looking forward to the day when large quantities of video are available online, indexed by their closed-captioning feeds. Lots of people would tag these videos with what they consider appropriate tags — say, they’d indicate that President Bush appears in the video — and then others could search for, say, all videos starring George Bush whose closed-captioning feeds contain the phrases “wiretap” and (“court order” or “warrant”). They’d find videos like the one Crooks and Liars archived, in which President Bush insisted that nothing had changed after the Patriot Act — that the government still had to get a court order to wiretap those suspected of terrorism. Videos obviously have much more of an effect than do words, and I think our side gets a tremendous boost when it shows lies in living color.

Bad Behavior has blocked 845 access attempts in the last 7 days.