Tuesday, April 26, 2011

Alive Enough

On Being has once again come through with a fascinating interview, this one with Sherry Turkle, an MIT professor and current director of the MIT Initiative on Technology and Self. I haven't listened to the produced version of the interview, just the unedited version; after discovering these raw interviews with the Scott Atran episode, I often don't bother with the produced version at all.

I found the show interesting enough that I inflicted a portion of it (from 26:53 to 37:00) on my kids as we ate dinner together a few nights ago (thereby allowing technology to invade the sanctity of the dinner table...) so we could discuss it. There was a description of someone walking the dunes on Cape Code listening to an iPod and texting, a discussion of a child texting in the car (and therefor not engaging with the parent), and a family where the father texted through fantastic family dinners prepared by his gourmet chef spouse, ignoring his family. The segment included a couple of wonderful quotes:

  • An uncredited psychology bromide: "If you don't teach your children to be alone, they'll only always know how to be lonely."
  • From Jill Ker Conway, former president of Smith College: "A child has to live in her generation."
In the ensuing discussion, my kids really took issue with the notion that simply having a soundtrack going in their earbuds inherently cuts them off from their surroundings. Several years ago the kids took a summer-long road trip out west together; they would often stop and walk through the stunning scenery with the iPod going and each with an earbud, so they were sharing the scenery to the same music. They did feel that the dinnertime texting was pretty terrible, and in-the-car texting had to be judged on the basis of the situation. I can't say that we agreed on all points, but their positions were at least comprehensible to me. As noted: they have to live in their generation, and since they've grown up with technology in a way that even their geeky dad did not, we're bound to have differing outlooks. We did get a good solid hour of discussion out of the segment.

Later on in the interview, Turkle worries about the replacement of physical artifacts - books, printed photographs, paper letters - with intangible, potentially ephemeral and less readily accessed digital artifacts. I worry about this, too, and I have a background project cooking away to produce printed picture books from some of my vast digital photo collection.

At the same time, I'm embracing digital media as an alternative approach to preserving my memories. This blog is a case in point. As I noted two years ago, "I want touchstones to help me recall who I am." This blog has become, at least in part, the journal I never seemed to be able to keep on paper. I'm sure not writing for my vast audience; according to Google Analytics, I've had not a single hit in the past month.

I've downloaded samples of some of Turkle's books to my Kindle; if anything really grabs me, I'll update this entry.

Thursday, April 21, 2011

Getting the Subversion server version

I recently needed to know what version of Subversion we are running, and this turned out to be harder to determine than I would have guessed.

Getting the version of the client is easy:

bash-4.1$ svn --version
svn, version 1.6.15 (r1038135)
compiled Nov 29 2010, 14:09:28
[... other stuff ...]

But the client doesn't provide an option for getting the server version. Using The Google, I found a Python script at Apache that does the trick:

bash-4.1$ python server-version.py https://svnserver/repos/root_of_repository

Here's a copy of that script (as of 7/9/2013) in case the link dies:

#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#   http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
# server-version.py: print a Subversion server's version number
# USAGE: server-version.py URL
# The URL can contain any path on the server, as we are simply looking
# for Apache's response to OPTIONS, and its Server: header.
#   $ ./server-version.py http://svn.collab.net/
#                   or
#   $ ./server-version.py https://svn.collab.net/

import sys
  # Python >=3.0
  from http.client import HTTPConnection as http_client_HTTPConnection
  from http.client import HTTPSConnection as http_client_HTTPSConnection
  from urllib.parse import urlparse as urllib_parse_urlparse
except ImportError:
  # Python <3.0
  from httplib import HTTPConnection as http_client_HTTPConnection
  from httplib import HTTPSConnection as http_client_HTTPSConnection
  from urlparse import urlparse as urllib_parse_urlparse

def print_version(url):
  scheme, netloc, path, params, query, fragment = urllib_parse_urlparse(url)
  if scheme == 'http':
    conn = http_client_HTTPConnection(netloc)
  elif scheme == 'https':
    conn = http_client_HTTPSConnection(netloc)
    print('ERROR: this script only supports "http" and "https" URLs')
  conn.putrequest('OPTIONS', path)
  conn.putheader('Host', netloc)
  resp = conn.getresponse()
  status, msg, server = (resp.status, resp.msg, resp.getheader('Server'))

  # 1) Handle "OK" (200)
  # 2) Handle redirect requests (302), if requested resource
  #    resides temporarily under a different URL
  # 3) Handle authorization (401), if server requests for authorization
  #    ignore it, since we are interested in server version only
  if status != 200 and status != 302 and status != 401:
    print('ERROR: bad status response: %s %s' % (status, msg))
  if not server:
    # a missing Server: header. Bad, bad server! Go sit in the corner!
    print('WARNING: missing header')
    for part in server.split(' '):
      if part[:4] == 'SVN/':
      # the server might be configured to hide this information, or it
      # might not have mod_dav_svn loaded into it.
      print('NOTICE: version unknown')

if __name__ == '__main__':
  if len(sys.argv) != 2:
    print('USAGE: %s URL' % sys.argv[0])