Twisted BoF at PyCon

The attendance list seems a bit anemic so far, so I thought I'd point it out:


Twisted Birds of a Feather session at PyCon 2007


I'll be there.

I Got the Black One

As I predicted, I purchased the black MacBook.

After every other laptop I've purchased, I experienced some form of buyer's remorse.  In this case, I didn't.  The overall experience has been positive.  I really don't have time to do a complete review (especially after spending all that time trying to remember how the heck bluetooth modems work - ugh!), but I'll offer the highlights, from an outline I was working on to do a fuller review:
  • It's very fast.  It runs the unit tests even faster than my work machine, a beefy Opteron.
  • More than any other Apple computer or appliance I've owned, its design is a work of art.  There are no special function keys (unless you count "eject"), no latches, no status indicator lights, clips or plug covers or anything.  The only moving parts are the keys and the disc drive.  It's also almost completely silent.  This can be slightly creepy: there's hard disk light, no sound from the disk, no network activity light, no external indicators to show that the machine is doing something.  I might have to get some blinkenlights panel applets just to make myself feel comfortable!
    • MagSafe is a really, really good idea.  It's not just about not knocking your laptop off of the table - it makes every other laptop plug you've ever used feel like utter crap.  The Vaio still holds a strong second in my book, because it allows for a fair amount of play on the plug before anything starts to bend or break, but... this is really in a class by itself.
  • The keyboard is delicious.  For some reason I had the impression that macbook keyboards were bad, probably because of the silly placement of the 'ctrl' key if you don't re-map it.
    • Old school powerbook/linux and powerbook/emacs people, you'll know what I mean when I say this: capslock-as-ctrl doesn't stick.  In either OS.
  • It works well with Ubuntu, with a few minor caveats:
    • The bad news:
      • The 'fn' key is in software, which means I don't get pgup/pgdn/home/end or volume control keys in linux.  Also, the 'fn' key shows up in 'showkey' but not in 'xev' - it's not accessible to X for some reason. I don't know why this is, but it isn't really enough of an annoyance for me to bother with fixing yet.
      • Suspend has some issues around restoring the display properly when waking up.  I really don't care, so I'm unlikely to figure out how to fix this - I prefer the machine to hibernate when I close the lid anyway.
    • In general, however, lots of things worked out of the box or with minimal tweaking in linux:
    • sound
    • video (with accelerated 3D)
    • bluetooth
    • USB
    • firewire
    • wired ethernet
    • hibernate
    • CD/DVD burning
    • 3-button mouse emulation (using right-apple and enter keys as middle and right click)
The real litmus test for this laptop was that, immediately after purchasing it, I ended up having to drive all over Quincy for some reason, while also trying to catch up on several days of work.  The laptop performed like a charm; I connected to seven or eight different wifi networks, wrote several hundred lines of code, hibernated and resumed half a dozen times, sometimes just snapping it shut and tossing it in my bag without worrying about heat issues (the vents are along the top of this machine, where the bag is open, instead of along the side where they'll be instantly blocked).

This experience was actually quite pleasant, devoid of the usual "new laptop that doesn't quite have all the drivers installed" experiences I've come to expect.  Edgy can take some of the credit for this, of course, but the macbook itself is fast, light, comfortable to use, and has good battery life.

A Graphical Guide to Getting your God Damned Bluetooth Modem to Work Again in Linux (Ubuntu Edgy)

Much to the chagrin of my cell phone company, I use Bluetooth tethering to provide myself with always-on internet connectivity so that I can always be connected, even when traveling unexpectedly.  It's shocking how often I end up in areas without wifi coverage of any kind, but such is the world we live in.

For the fifth time now, I have managed to convince myself that configuring this in Linux is really easy, and not bothered to back up the one or two critical tidbits which allow it to work.  Also for the fifth time I have found myself in a situation where I needed to use my phone as a modem through my laptop and have been in an awkward situation because I could not.  For myself as much as for anyone else, I'm going to post the instructions for getting a bluetooth tethered modem up and running quickly under Linux, using GUI tools as much as possible.  Other tutorials that I've found for setting this up are rambling monstrosities that cover everything from a threat analysis of bluetooth security to a 1000-line-long configuration for command-line ppp dialer, so I am aiming to just provide a brief overview of how to get the phone up and running.  These instructions are fairly generic, but in my particular case, they apply to Cingular, the Nokia 9300 smartphone, and Ubuntu Edgy.
WARNING: BE AWARE OF THE BILLING IMPLICATIONS OF TETHERING BEFORE YOU FOLLOW ANY OF THESE STEPS, EVEN IF THEY SOUND NEAT.  CELL PHONE COMPANIES HATE TETHERING LIKE RED SOX FANS HATE YANKEES FANS.  THEY WOULD MUCH RATHER SELL YOU A MUCH FASTER AND BETTER DATA CONNECTION THAN ALLOW YOU TO USE YOUR PHONE IN THIS CAPACITY.  TETHERING DATA IS NOT BILLED THE SAME AS DATA ON YOUR DEVICE, YOU MAY INCUR EXTRA CHARGES EVEN IF YOU HAVE A VERY GOOD DATA PLAN FOR YOUR SMART PHONE.  TETHERING ON A DEVICE IS NOT THE SAME AS USING A DATA CARD EVEN IF BOTH ARE ON THE SAME ACCOUNT, AND YOU WILL INCUR EXTRA CHARGES FOR THAT.  IF YOU DO NOT HAVE A PREVIOUS AGREEMENT WHICH YOU ARE VERY SURE GRANTS YOU A LARGE AMOUNT OF TETHERING BANDWIDTH, DOING THIS MAY RESULT IN THOUSANDS OF DOLLARS IN DATA CHARGES.  I AM NOT LIABLE IF THIS HAPPENS TO YOU.  YOU HAVE BEEN WARNED.
Ahem.  Now that that's out of the way, let's move on to the main event.

Step One: make sure your bluetooth device is up and running.  This should happen automatically in edgy, so if you don't see output like this, it is unfortunately likely that your device is entirely unsupported.  You might try restarting your bluetooth device if it isn't visible here.



Step Two: Once you know your device is there, you'll need Linux to talk to your phone.  Scan the area for your phone, and then discover what channel your phone provides Dial-Up Networking (DUN) on.



Step Three: As root, edit /etc/bluetooth/hcid.conf and change the 'security' to 'auto'.  I've found that other methods for communicating the PIN are less reliable.  If you want to change your PIN, edit the "passkey" here.



Step Four: as root, edit /etc/bluetooth/rfcomm.conf to bind "rfcomm0" to your device's modem functionality.  Make sure to set both the "device" and the "channel". from Step Two.



Step Five: install the "gnome-ppp" package.  This is a nice graphical dialer that integrates well into the desktop.



Step Six: Run gnome-ppp.



Step Seven: In the initial window that comes up, enter any username and password that you like.  These are usually ignored by your provider, but they must be present.  I use 'user' and 'pass'.



Step Eight: Click the "Setup" button, and configure:
  • your Device to be "/dev/rfcomm0"
  • your Type to be "USB Modem"
  • your Speed to be something nice and high


Step Nine: Click "Init Strings" and type in the obvious strings that come to mind:
  • ATZ
  • AT+CGDCONT=1,"IP","isp.cingular"


Step Ten: Completely stop and then start your bluetooth services to make sure your phone is available.



Step Eleven: Click "connect" in gnome-ppp.  You will have to enter a PIN on your phone.  Hopefully, this will happen:



Then, the dialog will disappear and an icon will appear in your notification area telling you about the PPP connection.  There you have it!  Cellular internet connectivity, as easy as AT+CGDCONT=1,"IP","isp.cingular"!

I have absolutely no idea how, or why, any of this stuff works.  If the above steps don't work for you, unfortunately, I will not be of much help; I don't know how to diagnose problems other than googling around and running long bluetooth command lines that I don't really understand.  Still, I've been lucky enough to get it working every time after only a little banging my head against a wall.  Good luck!

Thoughts on Thoughts

I am in the market for a new computer, and it will almost certainly be a Mac.

Last week, I discovered that, with Vista, Microsoft has finally crossed the line between "pragmatic compromise" and "dangerous decision".  I have never been really comfortable with having a Windows machine that required "activation", but it's been worth it mainly for access to certain bits of software which are hard to get elsewhere.  I generally buy new computers with Windows installed to get the discount and avoid the hassles.  (Sure, Linux seems like a pain compared to Windows when setting up new hardware, but have you ever tried to get Windows bootstrapped?  From scratch?)  The new "premium content protection" garbage in Vista is such a terrible disaster waiting to happen that both the moral and practical ramifications of buying new Windows hardware have finally become overriding.

The first option I considered was System 76.  I desperately want to sing their praises, but the only experiences I've heard of with their laptops so far were decidedly ... lackluster.  Their service is apparently excellent though, and I will continue to consider them for future hardware purchases (the idea of not having to screw around with that one last fiddly device driver in my Linux setup is certainly appealing).

While I use, and will indefinitely continue to use, Linux for my day-to-day computing and development needs, having more than one major OS around is extremely handy to run the occasional bit of proprietary software.  Going over the pros and cons of Mac vs. Generic Windows hardware...

PRO CON
  1. I already know a few people who use Macs.
  2. Apple has already done right by me in the recent past, as the only company to contribute both software and hardware to the Twisted project.
  3. The MacBook is actually a fairly cost-effective way to get a reasonable Core 2 Duo setup.
  1. No Half Life games.
  2. Only one button on the trackpad.
As you can probably tell, I was already leaning in the "Get a mac" direction.  I still lacked a sense of real urgency or desire to get the new machine.

Then, today, I saw the latest from Jobs: Thoughts on Music.  In it, he lucidly declares the emperor naked and asks if maybe he would like to put on some clothes.  In a nutshell, he says DRM is obnoxious, ineffective, and extremely expensive.  Most importantly, he claims that Apple would prefer to support a DRM-free music store.

I could, of course, interpret this cynically as a publicity stunt, since there seems to be about zero chance that the big four music publishers will get their heads out of their asses before they're all bankrupt, but it wasn't offered as a sound byte or a press release.  It's in a sort of essay format and I get the impression that he is really trying to convince the reader that this is what he thinks is best, and he hopes it will happen.  Heck, if there anyone who can make it happen it's probably Jobs.

(I think I'll get the black one.)

Five More Things

Almost a month ago, I was tagged by my father in the "five things" game which threatens to destroy everyone's privacy forever.  This can be a tricky proposition even in when one is tagged by a stranger, but to be tagged by a member of one's own family makes it almost impossible.  I hope that these are all news to him, but this is the best I can do.  They'll certainly be news to somebody...
  1. I've never taken any illegal drugs.  While most people would take this as a point of pride (especially while responding to their parents), I actually feel obscurely guilty about it - as if there's an entire avenue of human experience I've been cut off from.  I don't have any plans to partake of the wacky weed any time soon, though, since I feel like it's hard enough for me to maintain a "normal" mental state with the assistance of caffeine.
  2. I have read and listened to dozens of books and lectures by Christian apologists, most notably Ravi Zacharias and Lee Strobel in an attempt to better understand and have dialog with my Christian friends.  Unfortunately this attempt has been an almost complete failure.  I still don't even understand most of the arguments being made, let alone found them convincing, but I now have an encyclopedic knowledge of the various shibboleths that Christians use when discussing both their own faith and the "liberal secular humanist" threat that I represent.
  3. In high school, I was an illegal "ringer" for Math League.  Despite poor performance in class, I had done lots of computer-art projects on my own which had resulted in an extremely good understanding of geometry.  I hadn't paid dues for Math League and therefore not technically allowed to participate, but the teacher in charge was highly competitive and plied me with free food to get me to fill a gap in the team at a few competitions.  I'm still not really sure why this was, since as far as I could tell I wasn't really improving the team's performance.  My guess is that geometry was a badly neglected subject in the school's curriculum.
  4. When I lived in Austin, I participated semi-regularly in a Vampire: the Masquerade live-action role-playing game.  I didn't have any "LARP" experience at the time, so the game master's advice was to "play what you know".  Naturally my vampire character's particular curse gave him something that I am very familiar with: a fear of blood.  It made his life pretty hard.
  5. When I was at Ninjaneering, our first project was a game called "Exodus", a 4X galactic conquest game with some very interesting resource-management.  Much of the gameplay was actually a sort of glorified stoichiometry since players had to keep the "pipe full" at each facility which took in resources and emitted products.  It saddens me that almost nobody knows this about me, because the game was quite cool and it is unfortunate that it died on the vine.
To fulfill the dark pact of the chain letter, I will tag Christopher, Jonathan, Travis, Raffi, and Jason.