unofficial python audiobox.fm uploader

tl;dr audiobox-uploader-0.01.tar.gzgit repository

Some time ago I was being frustrated by my inability to access the music stored on my personal fileserver while at work — something about Apple having locked iTunes sharing to the local subnet, the lack of decent DAAP clients for Mac, and so on and so forth. Moving all the many gigabytes of music I have to my work laptop over work’s network connection is slow and anti-social, and at any rate then I have two places in which I need to manage my music and propagate new albums I buy. (Yes, if this were a Twitter post it would get the #firstworldproblems hashtag.) “Wouldn’t it be great, in this much-ballyhooed age of Cloud Computing,” says I to myself, “if my music could live in the cloud.”

Some friends of mine have a startup, MixApp, which lets me (legally!) publish the music on my fileserver and listen to it and chat about it with friends online, which was sort of like what I wanted. It’s actually a really neat service, and I like it and use it a decent bit, but I don’t always want to listen to music with other people, and the interface is tuned to the social music listening model and not so much to being like iTunes. Additionally, at the time they were having server problems (since resolved!) so that avenue wasn’t available to me.

I started looking around online, and the first service I ran across that seemed to fit the bill was AudioBox.fm. For a mere $10 a month, they’ll host up to 151GB of music, and they’ve got a nice Flash-based, iTunes-like player, last.fm scrobble support, decent library management capability, and most of the other features I expect out of modern music player software. They’ve got support for a bunch of formats besides MP3 (FLAC, OGG, and M4A being the ones I care most about), though all the music gets transcoded to MP3 for streaming, so I’ve been mostly converting to MP3 locally before I upload, since there’s no sense taking up the storage space for FLAC if I don’t get any benefit from it. Since it’s all my music, I can also get it back any time I want, so it’s a convenient backup of my music collection.

The only problem was getting all my music into the service. There’s currently a fairly nice Flash uploader, but it only takes 999 tracks at once and only MP3s, and there’s now also a Java WebStart-based uploader (which there wasn’t when I started), but most of my music lives on my Linux fileserver, not any of the client computers I use, so neither of those was going to do it. There’s also a nice RESTful API, and so I set out to write a Linux upload script.

Along the way, I discovered that none of Python’s built-in HTTP libraries deal with submitting multipart forms. I ended up stealing the multipart processing logic from Gabriel Falcao’s bolacha library, of which portions were in turn borrowed from Django’s test client, but I was disappointed that the support wasn’t built into something more comprehensive. Claudio Poli at AudioBox pointed me towards bolacha, and has been excellent to work with on this script — I’m pleased with AudioBox’s attentiveness to developers. (Careful observers will note that AudioBox offers both an OAuth authentication API for web services and HTTP Basic authentication for desktop applications, and Claudio promises that they aren’t going to pull a Twitter on desktop and open-source application developers.)

None of Python’s built-in or commonly-used HTTP libraries support bandwidth throttling, either, which turns out to be important when you’re uploading tens of gigabytes of music. I thought about building native support into the upload script, but I wanted to get a release out, and the trickle utility turns out to work marvellously on Python to limit its upload bandwidth use, so I punted on that. Seriously, if you don’t know about trickle already, you should make a note of it — I can’t remember the number of times I’ve wanted to throttle a program that didn’t provide the option, so its existence falls into the “I wish I’d known about this years ago” category.

At any rate, the result of my labors is audiobox-uploader-0.01.tar.gz, released here for the first time. Source can be found on Github, and users should please feel free to contact me with any questions, comments, or patches you might have. 🙂

my travel loadout, part 3: computers and cell phones

As promised in my last post on this subject and at long last, the computing and communication devices (increasingly the same thing) I rely on when traveling.

  • My personal laptop is an Asus EeePC 901, now sadly discontinued. Or at least it began life that way — I’ve now replaced the screen (due to the original cracking) and the original stupid-slow 20GB SSD with a nice fast Intel 60GB SSD. It’s got a 1.6GHz Intel Atom processor, so it’s no speed demon, but it’s fine for web surfing, e-mail, and SSH, which is most of what I used it for. (And in fact I did all my schoolwork on it last year, mostly using it as a terminal for faster machines located elsewhere.) It’s a wonderful travel machine, 2.5 pounds and easy to toss in a messenger bag with a couple days’ worth of clothes for short trips. It’s also got decent battery life — fourish hours with my usual use (and the modern web is not CPU-light), which is about what I expect, and better than my Macbook Pro, though apparently more modern netbooks can get something like eight or twelve. I’ve considered getting one of the extended batteries for it, but that ups the weight significantly and I don’t care that much day-to-day, so I haven’t bothered for now.

    I absolutely don’t mind the small form-factor for the keyboard, and in fact anyone who knows me well knows that I prefer small keyboards, and will bring one of my several Happy Hacking Lite 2 keyboards to wherever I work when I am forced to work on a desktop machine. I’m sad that nobody sells 9″ formfactor netbooks any more. They all seem supplanted by 10″ and larger netbooks, though I understand that most people don’t have my small-computer fetish. When I’m traveling, I care about every extra pound, and the 901 is an excellent machine for that. (I do wish it had some kind of minimal graphics chipset in it, because there are a lot of games of a certain age I’d like to play that should run fine on it, but then again most of what I play when I’m traveling is Crawl, so I don’t actually need it.)

  • My work laptop is a 13″ unibody Macbook Pro (which, ironically, I use a lot in the same way as a terminal for other systems elsewhere). It’s kind of becoming my primary machine, just because I do appreciate the larger screen (and my, is it a beautiful screen). The unibody has possibly the best build quality of any laptop I’ve encountered ever, which I appreciate a lot — it just feels sturdy. It’s about 5 pounds, and I’m lucky to get three hours of battery life out of it (I think average is more like two or two and a half), so it’s much more a machine which wanders between outlets than a true portable. Most of the things I don’t like about it are impedence mismatches between the software and me, not problems with the hardware, and if I had one of my own I’d definitely try installing Linux on it. (Last I asked around, I think wireless had issues, but these things change fairly fast?) Mostly I like laptops way better with a tiling windowmanager, Linux has a way better handle on multiple desktops than any other OS, and Steve’s Way is otherwise only about 75% congruent with the way I want to use my computer. But it’s being an effecive work machine, so that’s the most important bit right now.
  • My old G1 died a quiet death early this summer, and conveniently T-Mobile had just released the myTouch 3G Slide, which has a hardware keyboard (a requirement for me in a smartphone, since, in what you are no doubt beginning to recognize as a trend, one of my prime uses of it is a SSH terminal). I miss the G1 keyboard, which was about as close to a real, full QWERTY keyboard as I’ve seen anyone do on a phone (a full 5 rows), but I’ve found the Slide’s 4-row keyboard to be acceptable enough that I’m not considering upgrading to one of the newer phones with a physical keyboard. Android 2 is wonderful, and the ability to pull in phone numbers from Facebook is something I didn’t expect to find useful but I like a lot. I am annoyed that T-Mobile discontinued the 300 text message plan I was on, so I’m now paying $60 instead of $50 for the same service, since I never use more than 300 text messages a month anyway. (I’m still on the no-longer open Google Friends and Family plan, thankfully, so I save ~$10/month over what you’d see just starting out new now. I can’t quite see paying iPhone-level prices for the Slide, no matter how much I like it.)

So that’s basically my current travel loadout. Things that I’m still looking for, and would happily accept suggestions for:

  • Rollerboard luggage, at least the stuff I’ve got, is heavy. Really freaking heavy. Also, after this much travel, getting rather beat up, though I do kind of expect that. (Like, do they make rollerboards with aluminum frames that are any good at all? Because that would be nice.) I’m looking for a sturdy, lightweight, carry-on sized rollerboard.
  • I got a crappy cheap Bluetooth headset with my G1 for something like $10, which was worthwhile to prove the utility of the concept to myself, but not so great for long-term use. Does anyone have a Bluetooth headset they recommend? (I’m tempted by the headsets made by Etymotic Research, and I like their earphones, a pair of which I just got.)

Next time I’ll be posting some of the tips and tricks I’ve learned about international travel. (These are supremely unlikely to be news to my friends who travel a bunch, but I hadn’t known them beforehand, and I pay pretty close attention to you guys’ expriences, so maybe they aren’t well-enough known yet and could use a little publicizing.)

oct/nov asimov’s

"back to youth I so well lost / I left it on another world" –"Roadside Stand", by Mark Rich

In a slight break from travel gear, here follows my review of the Oct/Nov 2010 issue of Asimov's.

  • Becoming One With the Ghosts, by Kristine Kathryn Rusch (novella) — Didn't grab me in the first couple pages, so I didn't read it.
  • "Names for Water", by Kij Johnson (short story) — An odd little story, and one I can't do justice in description. The main character is an engineering student, so I identify with her on that. It's one of the best stories in this issue, and it's so small it's easy to miss.
  • "The Incarceration of Captain Nebula", by Mike Resnick (short story) — The main character is the eponymous Captain Nebula, and he's in an insane asylum. The "treatment report" format for stories is one I don't like, and this one didn't seem to be doing anything novel, so I punted it after the first few pages. (The typography on this one was also questionable, since it made significant use of typewriter font, and I find Asimov's typewriter font almost unreadable. Further discouragement if I'm already unsure on the merits of the story.)
  • "Torhec the Sculptor", by Tanith Lee (novelette) — A sculptor who destroys his pieces at the end of every show, and the very rich man who endeavors to posess a piece of the sculptor's art. I'm actually kind of surprised there isn't an artist with this schtick already, though I'd imagine the schtick would make it hard to make money. It's a cute enough story, if not entirely unpredictable, it's philosophical about the ephemeral nature of art, and it's certainly one of the better stories in this issue.
  • "No Distance Too Great", by Don D'Ammassa (short story) — Postulates a weird form of hyperspace travel which looks to the travelers like overland travel through a fantastic landscape. Said landscape is influenced by the emotional state of the travelers — the more frought, the less passable — and the main character, whose wife just died, finds himself, perhaps not coincidentally, on one of the trips which gets iredeemably stuck. It's cute in its way, but the emotional core of the story never grabbed me. (Perhaps it didn't grab me because there is — thankfully — no comparable event in my life to provoke my empathy, and I found the details of the mode of transport off-putting and implausible enough that my sensawunda wasn't engaged to compensate.)
  • "The Termite Queen of Tallulah County", by Felicity Shoulders (short story) — Despite finding the premise of the story wildly implausible — using time travel to prevent termite infestations before they happen? really? — there was enough interesting and genuine character interaction that I enjoyed the story.
  • "Dummy Tricks", by R. Neube (short story) — The main character was interestingly unlikeable, and, though the environmental event he's fighting seemed implausible, I found it an interesting enough story.
  • "Frankenstein, Frankenstein", by Will McIntosh (novella) — What if Phineas Gage had, after his accident, gone on to a life as a sideshow performer playing the role of Frankenstein's monster? And what if that sideshow act had met with another, also purporting to be Frankenstein's monster? While I was somewhat annoyed that the story didn't go too far beyond the Frankenstein complex which has grown up around Shelley's original and adaptations thereof, the relationship — the friendship and mutual respect and humanity — between the two "monsters" rescued the story for me. Another one of the best stories in this issue, the last of my top three.
  • "Changing the World", by Kate Wilhelm (short story) — This story about a hoax that goes a bit too far has obvious parallels to current events, and, well, that's about all it has going for it. I was underwhelmed.
  • "Under the Thumb of the Brain Patrol", by Ferret Steinmetz (short story) — This story inverts the usual high schoo jock-nerd dynamic, but it lays its subversion of the norm on so thick that even as a former disenfranchised high school geek I found it well past cloying, and only skimmed it after the first couple pages.
  • Several Items of Interest, by Rick Wilber (novella) — Didn't grab me within the first couple pages, so I didn't bother.
  • Dishonorable mention to Norman Spinrad's book review column, which looked from its first paragraph to be more of the same nonsense he was peddling back in April, and which I skipped.
  • Honorable mention to "Roadside Stand", by Mark Rich, one of the poems in this issue — not for its poesy, as it has none, but for its idea (buying tomatoes on Mars) and in particular the line I used as a pull-quote above, which grabbed me enough to… use it as the pull-quote on my blog post. 🙂

(As an aside, this list of things Prof. Malcolm Macmillan is looking for to document the life of Phineas Gage is fascinating — a real-life Mystery Hunt.)

Also a few quick reviews of stuff published for free! Online! And in a variety of ebook formats! By Tor.com! Which I mostly read on my phone on the way to and from work. (I think the ones published in 2009 aren't eligible for Hugos next year, so there's less drive for me to index them as comprehsensively as the Asimov's stories.)

  • "Overtime", by Charlie Stross (2009; length unknown) — A Christmas-time Laundry story. Features a Dr. Kringle from Forecasting Ops, the precognitive arm of the Laundry, and has about as much treacly Christmas cheer as one expects from Stross or the Laundry, making it a fine and amusing read at any time of year.
  • "First Flight", by Mary Robinette Kowal (2009; length unknown) — Time travel and the Wright brothers. A personable older protagonist and her competent younger foil.
  • "The Fermi Paradox is Our Business Model", by Charlie Jane Anders (2010; length unknown) — The Fermi Paradox basically asks, "if aliens exist, where are they?", and the answer in this story is that they're waiting for us to kill ourselves off in the inevitable nuclear holocaust so they can come in, collect, and sell all the precious materials we have helpfully mined out of the Earth's crust. Amusing; delivers well on its premise.
  • "A Memory of Wind", by Rachel Swirsky (2009; novelette) — When Helen fled to Troy with Paris, the Grecian kings assembled an army to follow her and take her back, but found themselves becalmed. King Agamemnon sacrificed his eldest daughter, Iphigenia, to the goddess Artemis that she might stir up the winds and send their warships to Troy. This is Iphigenia's story, and it is beautiful and haunting. Go read this. Now. (This was apparently a Nebula award finalist.)
  • "Eros, Philia, Agape", by Rachel Swirsky (2009; novelette) — An android leaves his human lover, and thereafter is told in retrospect the story of their relationship. Gorgeous and haunting and different than "A Memory of Wind", and that description fails to capture the least bit of what I liked about the story. So much truth about humans and human relationships and the worlds we build for and with each other. Go read this, now, too. (This was both a Hugo and a Locus award finalist for Best Novelette, apparently.)

Rachel Swirsky has a new story on Tor.com, "The Monster's Million Faces", which I haven't read yet, but which I look forward to. (It's now loaded on my phone to read on the T tomorrow.) An awesome, awesome writer. She has a bunch of her stories online linked at her web site, and I'm really tempted to go through and read them all, but I need to go to bed. Whoops.

my travel loadout, part 2: shoes and wallets

As promised in my last post, another post about travel gear! This week, shoes and wallets.

  • Given that we seem doomed to walk through the metal detector at the airport in stocking feet for the forseeable future, slip-on shoes are a must to make the process as painless as possible. Slip-ons mean no struggling to pull the shoes off my feet as the rest of the security line makes impatient noises, no fiddling with tiny dress-shoe laces as the agent at my gate on the other side of the terminal announces last call for boarding, no running with shoelaces flapping trying to make my flight — a just plain more pleasant travel experience. For business travel, nice slip-on shoes are a must, so I can go straight from the plane to a meeting if I have to. I ordered a pair of Bostonian Bolton shoes in brown and wore them to Iceland, and they’re quickly becoming my everyday shoes. (I in fact liked them so much that I bought another pair in black — I think of the as latter as “going to dance clubs in foreign countries” shoes.) They’re light, they look great, they fit well, and they’re comfortable to walk long distances in, as I did in Reykjavik — in fact they’re possibly the most comfortable shoes I own. I’m extremely happy with them. (If you expect to walk a lot with them and you like the fit out of the box, do treat them with some kind of waterproofing compound, wax, shine, whatever. I got caught in an unexpected rainstorm and my brown pair got soaked, and they relaxed more than I wanted.)
  • I happened upon BigSkinny, who are Boston-local, at about the same time as my old black leather trifold wallet, a gift my senior year of high school, had started to seriously lose its structural integrity, so I jumped at the chance to replace it. My friends had mentioned struggling to fit (larger) foreign currency in wallets designed for (smaller) US currency, so I bought BigSkinny’s World Bifold Wallet in black leather. The currency wasn’t much of a problem in Iceland, where the bills are about the same size as US bills, but hopefully it will be useful for other travel in the future. It’s big enough for the stuff I need to carry but still encourages me to keep that set to a minimum, it’s solidly made, and it is in fact pretty damn skinny (about a half inch thick, closed).
  • Speaking of wallets, I’ve been appreciating AwardWallet as a service for managing frequent flyer accounts, gift cards, hotel chain points, credit card points, and other loyalty programs. It’s very nice to have a complete list of programs I’m in all in one place, with the balances and expiration dates visible at a glance (especially since, given where I work, I seem doomed to collect the complete set of frequent flyer programs :-). It also acts as a password wallet for the award program web sites, letting me log into any of them with a single click. It’s also under active development, unlike some of the similar sites I looked at. I found and reported a bug, and the developer fixed it in a week or so, though they never said anything to me about it — I had to check back. (But it got fixed! That’s more than I can say for a lot of the bugs I report.) I like their pay-what-you-will Pro account model — basically donating any amount gets you an upgraded account which checks when your points or miles expire — so after the bug I mentioned got fixed, I upgraded to a pro account in thanks. It will also pull your travel plans in from airlines which expose this information and let you associate hotel information with flights and so on, creating a nice itinerary that you can then print or access on the go. As a friend of mine said, it’s way better than a spreadsheet for tracking these things.

Up next week, computers and cell phones!

my travel loadout

My Travel Loadout, or, a Road Warrior in Training

I now have the free time to travel for pleasure, my job has me traveling some, and there’s the potential for more travel in my future, so I’m starting to explore what equipment I need in order to do so comfortably. I kind of hate the term “road warrior” — as though it’s such a burden to travel, or some Mad Max thing. At least, it doesn’t describe my mindset yet, though I can see how people who are on the road a significant fraction of their working lives might start to identify with it, so I am at best a road warrior in training. On the other hand, reading Scott Eblin’s Business Travel Diva’s Rules for Family Vacations, I realized that I was doing most of the things he describes already, so maybe I’ve adopted the mindset more than I think I have.

Over the next few weeks, I’ll be talking about my current travel loadout, including tweaks I tested on my recent Iceland trip.

The core of any loadout, it seems to me, is the bag or bags — the fewer the better. For a long time my Yak Pak Medium Flapdoozy Tech was my everyday bag for school and also my go-to travel bag, and I’d cram in my laptop, toiletries, and a couple changes of clothes and be set for up to four days. (Yes, that’s a MegaTokyo link. Shh, we were all sixteen once, and Piro has good taste in bags.) It was even nice-enough looking that I was comfortable wearing it with my suit and tie to job interviews and using it like a briefcase, and I liked that versatility. (Mine obviously didn’t have a MegaTokyo logo on it.) However it was starting to wear around the edges, and when the rubber lining on the inside started to come out, I knew it was time to find a replacement. Sadly Yak Pak doesn’t make the Flapdoozy any more — their current line is way too gaudy to double as a briefcase in my world — and I couldn’t find any extra stock online, just a lot of other people looking for the same thing, so I set off in search of a new bag.

What I ended up with was the Tom Bihn ID bag in black and steel, with a soft-shelled laptop case for my work laptop, a 13″ unibody Macbook Pro. In that color combination, it’s totally conservative enough to double as a briefcase for work, and it works well in that capacity. I like that the ID isn’t a Laptop Bag(tm), so it doesn’t scream “I CONTAIN A VALUABLE LAPTOP PLEASE STEAL ME,” and the soft-shell case is protective but transparent to X-rays so I can take it out with my laptop inside and run them through security unopened. I bought this bag for a business trip in early August, but it showed up the day I left, so I first tested it in Iceland. (I need to remember that “second-day shipping” doesn’t mean “you’ll get this in two days,” it means “you’ll get this in two business days, assuming someone is home to receive it”. Obviously for business travel I should have had it sent to work, but for general packages it’s just completely impractical for me to be home to receive stuff all the time, and I’m usually more busy before a trip than less.)

The bag is extremely well-made — the fabric is thick and tough, the zippers are the sturdiest I’ve ever encountered, all the seams are well-finished, and the buckle is rugged without being too stiff. There’s just a ton of attention to detail. I’m not wild about all the pockets — the front flap pocket is too small, though I like the document pocket on the back, and I’m still not sure about having my laptop behind another zipper after the flap is out of the way, but I’m adjusting, and I do appreciate the dividers for pens and so on, which I didn’t expect to like. It comfortably fits the stuff I was carrying in the Flapdoozy, though it seems less capable of overloading so I’m not sure how much stuff I’ll be able to fit in for longer-term travel. When I switch out my work laptop for my personal laptop, a 9″ Eee, as I did for Iceland, the bag can comfortably fit toiletries and a fleece jacket as well, so it’s not impossible, though I also had a checked bag along for that trip. I was specifically looking for a bag that wasn’t too large, since my tendency is to let cruft just accumulate in strata at the bottom of the bag, so a smaller bag forces me to think harder about everything I carry. The strap on my Flapdoozy was really nice, basically seatbelt material, and so I was dubious about Tom Bihn’s nylon webbing straps with adjustable pads, but it’s very comfortable. (I just went with the default, though Tom Bihn does offer several levels of strap up to “Awesome” — they’re all the webbing-plus-pad form-factor.) For someone with my… aggressive collarbone, the strap fit is really important. There’s also a waist strap, which I detached almost immediately, since I don’t expect to be biking with it much right now. The ID is a little big, width-wise, and not as wieldy on a crowded T car as I would like, but it’s extremely comfortable and well-made, and ultimately I’m happy with it as a replacement for my Flapdoozy.

Up next week: shoes and wallets.