Puttering

Man, I love computers. Always have. But it’s terribly easy, if you don’t approach one with discipline, to putter around. Do I work on getting GitLab set up as a private code repository on my server? Do I work on migrating my blog to Jekyll? Let’s read about that… oh look, the night’s over and I haven’t actually accomplished anything, just spun my wheels.

It’s another form of the Tuco’s Law for your life I mentioned before: when it’s time to act, act, don’t think. That’s not just about feeling bad about yourself, it’s also about doing your thinking beforehand, so when you sit down at the keyboard you can just get things done.

Being deliberate about it, I am in planning mode now / Okay, now I am in doing mode, makes a big difference. I need to remember that before I sit at the keyboard, though, because once every digital possibility is at my fingertips, I get swept away.


A million years ago, I was in a classroom and we were learning how to use computers. We were maybe less than ten years old, maybe a little more, but point is I was even more likely to get distracted then than I am now. And the teacher knew it, too, he knew his audience: he wanted us to stay focused on the task at hand in whatever program we were using, and I remember his choice of words because they were odd. He warned us not to “be hypnotized” by the computer. I remember resenting that exhortation, and the implied accusation that I couldn’t stay on-task, that this treasure chest of glittering possibilities, in all their 8-bit VGA glory, was too tempting to resist.

But, goddamn the man, he was right. Still is.

“You’re a raving lunatic!”
“No i’m not—”
“Yes you are!”
“No, no, i’m too trusting! I’m jealous, and i’m trusting: it’s cognitive dissonance!”

That is perhaps the maximum-magnitude Woody Allen dialog. And Midnight in Paris is one of his best movies—have you seen it? I don’t often like Owen Wilson, but he nails the Allen proxy in this film, even down to how he’s dressed (seriously, now you won’t be able to stop noticing it).

Oh, and tell me the opening theme doesn’t make you want to book a flight to Paree.

Tuco’s Law

Can’t remember where I first heard it called Tuco’s Law:

If you’re gonna shoot, shoot. Don’t talk.

It was probably on the James Bond episodes of the old Talk Show with John Gruber, because Bond villains are the canonical Tuco’s Law violators; instead of just putting two in the double-oh-dome, they tell James their whole plan and then leave him in some ridiculous, potentially-fatal scenario and hope for the best.

Anyway, I need a Tuco’s Law for my entire life.

If you’re gonna write, write. Don’t worry about how you never seem to get in the habit.

If you’re gonna work out, work out. Don’t worry about how easy it is every morning to leave the house without doing pull-ups.

If you’re gonna act, act. Don’t dwell on how little faith you have in your ability to succeed.

I need to set up a washtub in my brain and just stick ugly-ass Eli Wallach in there with his improvised revolver and remind myself. Shoot. Don’t talk.

Comfortable

When we were fortunate enough to be able to buy our own home we bought a lot of furniture, too. Granted, any sense of permanence is an illusion, but it’s just a relief to have something in your life that didn’t come from IKEA with the tacit consolation that, sure, it’s not quite as nice a thing as you’d like but why spend hundreds of dollars on something that might not go with whatever place you’re living in eighteen months from now?

So we bought a bed. It’s a nice bed, fabric-covered, with an integrated headboard and the frame lifts up on spring-loaded arms so you can store things underneath, and it’s the first real bed I’ve called my own since I moved out of my parents’ and stopped sleeping on the bed they got for me when I was six; ’til now I’ve always just had a mattress on a box spring and called it good.

We have a sheet and a blanket on our bed, as you’d be within your rights to assume, and because my wife is prone to being cold at night, we have more like two or three blankets on at any given time. The one that usually goes on top is funny, it conflicts with the new-bed philosophy described above, because it is an ancient somewhat-fluffy gold thing whose ends are fraying apart, but it is warm and comfy, so it gets the position of honour.

That old battered thing, incongruous in a place where we spend so much time and money and effort expressing that this is a new part of our lives, that we’re striding ever forward—being pulled, really, not that one likes to admit it—but there’s a utility in that old blanket, something stalwart and supportive like the arms of a parent, a feeling that a word like “utility” is really not well-suited to capture.

My parents had a cross-stitch, or whatever it’s called, something like that, on the wall of their bedroom when I was a kid. It’s on the wall of the bedroom in their new house, too, I was just there. It was a poem that for some reason has always been lodged in some dusty footlocker of my memory, like so:

Let me grow lovely growing old
So many old things do
Laces and ivory and gold
Fine silks need not be new

And there is healing in old trees
Old streets a glamour hold
So why not I as well as they
Grow lovely, growing old

And I remember being a kid and that seemed like a funny sentiment. Somehow made sense for my mom to have it up there; she’d be an old lady one day, right? But it always seemed like something other people would relate to, not me. And yet, unbidden, those lines are still there, in my head. I roll with Heraclitus, baby: life is a river. And a lot of the time, that’s a comforting thought, it helps me resist attachment (in the Buddhist sense of the word). But some things last. Does a blanket, though, really? Is that old thing going to still be wrapped around welcoming human bodies long after I’m in the ground? But there’s something there, a connection, to the same sort of forces I can feel when I’m up in the mountains, or walking through the desert, or staring into the sky—there’s more to the universe than just me, and thank god.

You better work on your grip strength, you want to be a writer. You need to start grabbing readers by the throat.

A sharp first line, a gleaming hook, is everything, never more so than in the Age of Eyeballs. My favourite first line since college has been—paraphrased, because I don’t have a copy to hand—from Fight Club, how predictable:

First, Tyler gets me a job as a waiter. Then, Tyler’s shoving a gun in my mouth and telling me, the first step to eternal life is you have to die.

But I was reminded of this principle just now from a different source that will probably never get made into a movie. Much to his delight, I’m certain:

For some bewildering reason that’s likely a reflection of society’s bankrupt standards for journalism, a lot of people read Business Insider.

Nailed it.

The Problem With Not Writing

John Saddington encourages us to blog, because:

Writing is introspective. It’s self-reflective. It’s humiliating and yet, at the exact same time, our way to salvation. It’s how we tell the stories and how we express the fabric of our very lives.

I have a long trail of half-began blog posts I always meant to sit down and actually flesh out, and I never have because he’s right: if you just write raw and dirty, the result might not make you happy. But if you write anyway, you’re building something. If you don’t write, you aren’t.

Here’s to doing and posting a lot more writing that isn’t up to our own standards, in the name of building pressure behind writing the stuff we spend all that time dreaming about. Feel around in your pockets—you’ve still got your chisel. And this is a project the size of your entire life.

Dev Diary: Mysterious problems downloading stuff via the Terminal

Holy fricking frick. I burned a Saturhack on this1. So,

  • I did a kpm restore on my project because I needed to include the Diagnostics package, and Microsoft.AspNet.Hosting broke
  • Looked into it, and Microsoft.AspNet.DependencyInjection must have been upgraded to 1.0.0-beta2 (looks like the whole vNext framework went to beta2 in mid-January). My project.json defined Microsoft.AspNet.Hosting as specifically -beta1, so Hosting was now referencing code that no longer existed in DependencyInjection
  • I removed the specific -beta1 tags from all dependencies, replaced with -*, so I should just get whatever’s latest in the prerelease channel
  • Now, kpm restore won’t complete. It seems to roll for a while, and then… nothing. Looks like it might be this bug
  • Anyway, then I discovered something funny: running kpm build in my Terminal (as opposed to from Sublime Text) didn’t work, kpm was no longer in my path.
  • Reminded myself that kvm upgrade, in addition to upgrading the KRE, adds it to the path, so might as well do that…
  • There is indeed a KRE -beta2, but it won’t download… it seems to run for a bit, and then… nothing
  • Googling leads to people complaining about kvm.sh breaking zsh, which isn’t my issue, but apparently there’s a new version, so let’s get it
  • brew update doesn’t work either, it hangs around for a while doing nothing, I kill it, get an error:

    Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

  • I try brew doctor, which tells me I’m out of date and should run brew update 😛

  • So, I do, again, and this time it fails out:

    fatal: unable to access ‘https://github.com/Homebrew/homebrew/': SSLRead() return error -9806
    Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

  • Searching for SSLRead error 9806 revealed this

  • That’s about PHP in particular, but following the accepted answer, I do indeed see “Secure Transport” as PHP’s SSL Version, suggesting I might be using “a version of cURL that uses Apple’s Secure Transport under Yosemite and the target of the URL request doesn’t support SSLv3 (which was probably disabled due to the POODLE vulnerability).”
  • That’s when I started writing this shit down.
  • Indeed, curl --version produces this:

    curl 7.37.1 (x86_64-apple-darwin14.0) libcurl/7.37.1 SecureTransport zlib/1.2.5
    Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
    Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz

  • Yup, there’s SecureTransport. Apparently I need OpenSSL.

  • Aha, the SO answer mentions running brew with --with-openssl, which worked
  • But because curl is a system thing, homebrew installs it keg-only, i.e. not in /usr/local/bin and warns against linking it there. So maybe I will try to see if the above is down to network issues rather than curl/SSL issues

TODO

  • Trying updating KRE with kvm install latest once on a reliable network
    • That worked
  • See if you can make kvm script use homebrew’s OpenSSL curl if that doesn’t work
  • Whatever kvm install does to register k and kpm in the path, add that to your bash profile if it isn’t already
  • kpm restore packages. If that’s not working, try temporarily linking the homebrew OpenSSL curl and getting kpm to use that
    • Seemed to work without messing with cURL. So this all may have been a connectivity issue after all.

The moral of this story is, verify your Internet connection before you start going nuts in your shell.


  1. And I’m back-dating this post from 15 Feb to when that took place. I hope that’s allowed. 

Dev Diary: Installing ASP.NET vNext with Sublime Text integration

Everyone else on the Internet seems to have posted an article with this title back in August. Well, colour me late to the boat.1

First Steps

  • Using the instructions found here
    • Installed Mono and KVM via Homebrew as per aspnet GitHub
    • Installed Package Control in Sublime Text
    • Installed Kulture via Package Control
    • Installed node/npm via Homebrew
    • Installed yo and generators-aspnet via node
    • Slammed into this error, left a comment asking how to get the fix since, at the time of this writing, nothing’s been committed to the yo repo.
      • Fixed in the RX.js repo a day later, so that’s all good
    • Following the rest of the directions on the Kulture and ASP.NET GitHub pages got me to a point where I can scaffold, build and run a new project with Intellisense!

And Then

  • Turned on error reporting via this SO answer which references one of the vNext sample projects, worth a closer look.
  • Need to learn more of the Razor view conventions: it’s weird that you declare a model’s type with @model but then you apparently must refer to it as Model with a capital M…
  • Used display templates as described here to define an output fragment for a custom type… very cool. I could put a working project together pretty easily with ASP.NET MVC, I think…

TODOs

  • I had to kill kestrel, rebuild the project and restart kestrel to see changes. I seem to recall reading something (maybe in the MSDN blogs about ASP.NET vNext?) about getting livereload-like behaviour…
    • Indeed, there’s a command-line switch, but a bug in mono prevents it from working on non-Windows hosts
  • Explore inline errors and refactorings in OmniSharp
  • Build a simple MVC view with a hard-coded repository layer

Other Links


  1. Protip: Never mix eggnog with metaphors 

Now Would Be a Good Time to Update Git

The latest version of Git, 2.2.1, patches what sounds like a pretty severe vulnerability. If you’re using a GUI Git client like GitHub’s or SourceTree, hopefully they’ll have updates you can install soon (at the time of this writing, SourceTree does not). While I do use SourceTree, I most often use git from the command line, so I wanted to update that client as well.

I’m running OS X 10.10, and when I check my git version in Terminal:

git --version
git version 1.9.3 (Apple Git-50)

I most likely installed that version via Xcode’s build tools. I decided to leave it alone and, since I’ve become a Homebrew fan, grab the latest git with that, instead.

brew install git

Now the first funny thing: which git returned /usr/local/bin/git, as expected (that’s where Homebrew installs packages, which is controversial to some. The Xcode version was at /usr/bin/git), but git --version was still returning the old Apple version. On a hunch, I closed my Terminal session and opened a new one: now git --version returned git 2.1.3. Doing a little searching, you can also check for this caching behaviour and correct it like so.

Now, there’s a further issue: 2.1.3 is not the new version of git I wanted to install! This suggests my Homebrew recipes were out of date. I did this:

brew update

And got permission errors. So, as usual, the hammer:

sudo brew update

Now that spewed a list of Homebrew’s script files, claiming I had made changes to them that would be overwritten by merging the latest version of the recipes. That was odd—I had no recollection of ever editing Homebrew’s files myself. brew doctor suggested I stash and clear the changes, so I did that…

cd /usr/local/Library && git stash && git clear -d -f
brew update

…Oh, right, there’s that permission error again.

sudo brew update

…! I got the same error regarding merging files! But I definitely hadn’t changed anything this ti-

Then it dawned on me: the failing brew update must have changed those files, leaving Homebrew in a half-updated state. I cleared the changes again, and did sudo brew update this time, and boom. Now, running brew upgrade git installed version 2.2.1, as intended.

Hope that helps if you ever trip over this particular crack in the sidewalk. At least it’ll help the next time I do.