Things I did today

Among other things, in the past 24 hours, I've:

  • set up an RDS MySQL instance
  • made an RDS instance a replication slave of our database hosted with Linode
  • fiddled with my bash prompt and other .bash_profile goodies
  • made breakfasts and lunches for my 2 little kids
  • made myself a lovely salad for lunch
  • dropped my kids at school (bigger task than it sounds like)
  • gone to work, where I
    • held scrum
    • reviewed and merged pull requests
    • reviewed and rejected pull requests
    • finished a bug fix
    • reverted a major feature deployment
    • communicated a plan to migrate our database off of Linode and into RDS
    • debugged and tested our database migration plan
  • went to a meetup
  • fixed my home printer not printing
  • plunged a toilet
  • cleaned a toilet
  • written this blog post

Still to do:Update: Also Done

  • review and script our migration plan
  • migrate our database off of Linode and into RDS

What is it about Twitter?

I like people. I swear I do. It's just that personal interactions tend to be extremely tiring. They take a lot out of me. And the larger the group of people, the more severe the energy drain. Same with familiarity: the less familiar I am with people, the more draining it is to interact with them. So, most of the time, I avoid large gatherings and being with people I don't know very well.

One thing I've noticed, though, is that most interactions I have with people online are not at all draining. Twitter, IRC, IM, GitHub, email -- I thrive in these communities and get energized when I can interact with people online. Twitter and GitHub are my favorite ways to communicate with people.

Twitter is great because it's a really light lift. You don't even know who's listening. A lot of the time, it feels like making wise-cracks from the back of the classroom. But there's also information sharing. I like to tweet links to blog posts I've seen. Often, there are common threads that tie my Twitter timeline to in-person conversations I've been having. But I think the key is that no response is expected. Okay, sometimes I look forward to replies and favorites and retweets. If I post a funny tweet, I hope someone faves it -- it's the same as going for a laugh in conversation, but without the awkwardness when I flop.

GitHub is completely different than Twitter. By definition, on GitHub I am interacting with people on a specific programming project, and we are discussing code. At my company, we also do this in Pivotal Tracker, but the interaction there is terrible. On GitHub, it's incredibly easy to translate my thoughts into a new issue or comment on an existing issue. And when we get a good conversation going on GitHub, that same ease of communication can morph into something more than a debate over the merits of one approach to a problem over another. Specifically, it's really easy to post images and add emojis. The humor and fun that enables can turn an otherwise boring or contentious comment thread into experiences that I remember with the kind of fondness that I imagine other people have for great parties.

These tools enable me to experience the positives without the negatives. I get all the joys of interpersonal interaction without draining my energy.

And I realized tonight that that enablement -- providing that bridge from my personality island to the mainland of other people -- makes these tools dear to me in an intensely personal way. It's like they augment my personality. Or give me superpowers. Or something.

I haven't quite put my finger on it. But I'm pretty sure that that's why I get raging mad when Twitter shoves shitty advertising in my face or GitHub refuses to enable notifications for gist comments. They're fucking with my shit when they do that. These tools -- they're not a trifle to me. They've become a part of me because of the deep interactions they've enabled me to achieve. It's like I've integrated them with my own personality. So when you fuck with them, you're fucking with me.

And I don't like when you fuck with me.

Yosemite Upgrade Changes Open File Limit

OSX has a ridiculously low limit on the maximum number of open files. If you use OSX to develop Node applications -- or even if you just use Node tools like grunt or gulp -- you've no doubt run into this issue.

To address this, I have this line in my $HOME/.bash_profile:

ulimit -n 1000000 unlimited

And a corresponding entry in /etc/launchd.conf:

limit maxfiles 1000000

That solved the problem until I upgraded to OSX Yosemite, after which I began seeing the following error every time I opened a terminal window:

bash: ulimit: open files: cannot modify limit: Invalid argument

Oy.

Luckily, I a little Google foo yielded this Superuser post (and answer).

So it was a quick fix:

$ echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
$ echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -w kern.maxfiles=65536
$ sudo sysctl -w kern.maxfilesperproc=65536
$ ulimit -n 65536 65536    

Then I updated my $HOME/.bash_profile to change the ulimit directive to match that last command, above, and I was back in business.

Easily prune your ssh known_hosts file

At some point, you've probably seen this message when you try to log in to one of your servers:

ssh failure message

This is really common when you have Amazon EC2 instances behind Elastic IPs because the IP address stays the same (and probably the hostname, too), but as new instances replace old instances, the new instances' ssh keys are probably different.

But if you look carefully, you'll see that the failure message tells you how to resolve this problem:

Offending RSA key in /Users/[username]/.ssh/known_hosts:5

That means that line no. 5 of the known_hosts file contains the problematic key. So, assuming that you are sure this is NOT in fact a security breach, you can remove that line.

It's a bit of a pain-in-the-butt to manually edit this file, though. You can use sed to do it easily, but if you're like me and you don't use sed all the time, you need to look at the man pages every time you want to use it. That's why I wrote this quick bash script to do it automatically.

Drop that in your PATH and make it executable. Then you can simply type ssh-purge-host 5 to remove line 5 from your known_hosts file.

Hope that's useful!

Could JXCore Be An Awesome Deployment Tool?

JXCore allows you to turn Node.JS applications into stand-alone executables. One possible use case would be to package up your entire application in an executable and deploy it to production servers, skipping the usual dance with git and npm. If performance is good, this could make for an interesting deployment tool. Deploy by Dropbox? Yup, you could! It's on my list of things to try with a hobby project.

New git alias: git last

I made a new git alias I'm loving. Maybe you have something similar.

I've added this to my .gitconfig:

[alias]
    last = rev-parse --abbrev-ref @{-1}

This gets the name of the branch you had checked out prior to the current branch. It's like git checkout -, but you can use it all over, such as:

$ git merge `git last`

I'm Adopting an Open Source Project. Now What?

On June 11, Twitter retired version 1.0 of their REST API. It was announced well in advance, but I had other things to do; checking to see if my Twitter tools would still work was too low a priority. Until they broke.

When I refer to my "Twitter tools," I mean a Python command-line script that I use to post to Twitter from bash scripts, PHP programs, Node.js programs, etc. That Python script is little more than a wrapper around an abandoned open source library that broke when Twitter turned off API v1.0 -- twitter-oauth. The repository seems to have been emptied, too. Luckily, the library is still available in the Python Package Index: http://pypi.python.org/simple/twitter_oauth/

So, I grabbed the library, updated it so that it works again, and put it up on GitHub: danmactough/twitter-oauth.

Now what?

Is there a protocol for taking over an abandoned project?

Fargo as a Fluid App

I thought it would be cool to have Fargo as a separate Fluid App. For those who don't know, Fluid let's you make a web app into what feels like a regular desktop app (for Mac OS X only). For me at least, this will make it easier to find Fargo among my many open windows and browser tabs -- now it's got it's own icon in my Dock and it's own spot in the Cmd-Tab switcher. It makes Fargo feel like the first-class Mac App that it is.

Here my switcher now -- there's our beloved dino!
enter image description here

If you want to set this up too, know that I had to jump through a few hoops to get it to work. The difficulty appeared to be a by-product of Fargo needing to get my authorization to connect to my Dropbox account (in technical terms, OAuth is a pain in the ass). The workaround was to get this authorization before creating the Fluid App.

  1. Open Safari
  2. Go to http://fargo.io to launch Fargo
  3. Follow the prompts to authorize Fargo to connect to your Dropbox account
  4. Close Safari (optional)
  5. Create your Fargo Fluid App (follow the instructions on http://fluidapp.com/)
  6. Launch your new Fargo Fluid App

Why did that work?!

I'm using a free version of Fluid (for now -- still kicking the tires). The free version doesn't have separate cookie storage -- it shares it with Safari (Fluid is built on Apple's WebKit, like Safari). So, by setting everything up in Safari first, Fluid was able to piggyback on that setup when it created the Fargo app. Neat trick -- but not a long term solution. For example, I want to pay for the full version of Fluid (to support the developer), but I suspect this trick won't work in the full version.