Skip to main content

Benjamin Oakes

Photo of Ben Oakes

Hi, I'm Ben Oakes and this is my geek blog. Currently, I'm a Ruby/JavaScript Developer at Liaison. Previously, I was a Developer at Continuity and Hedgeye, a Research Assistant in the Early Social Cognition Lab at Yale University and a student at the University of Iowa. I also organize TechCorridor.io, ICRuby, OpenHack Iowa City, and previously organized NewHaven.rb. I have an amazing wife named Danielle Oakes.

Filtering for the Technology category. Clear

How to Save the Day with Git Remotes

by Ben

This post originally appeared on Continuity’s engineering blog. I’ve cross-posted it here for posterity.

Can’t push commits to GitHub, but need to move them to another clone? Adding another remote is a good option to get you out of a bind.

Why did this come up?

We do a lot of pair programming at Continuity. One of the great things about it is that if someone is out sick, you can usually depend on the other person to know the details of what was happening. But what if both people are out sick and they forgot to push their branch to GitHub and the deadline is today?

(That happened last week!)

The solution described in this post is a little specific to how we pair program remotely. Our team is almost 50% remote developers, and we all share access to the same EC2 instance. We use wemux and vim to pair (among other tools), and the provisioning is automated by puppet.

Back to the tale of the missing pair, one idea that came up was installing another SSH key to the missing person’s ~/.ssh/authorized_keys, but that has a number of problems:

Finally, installing keys on another user’s account just feels like a practice to avoid, if no other reason.

Instead, what we decided to do was to become their user via sudo (which is logged) and then push to a local clone of the git repository. That might sound complicated if you’ve only ever used git in combination with GitHub, but it’s actually a lot simpler than you’d think.

The Plan

What we’re going to do is push the absent user’s code to a shared directory, then pull it to your clone of the repository.

We’ll refer to the absent user as them and the user that needs access to the code as you.

How to

Just to set the stage, let’s look at the normal remotes for a clone from GitHub:

them$ git remote -v
origin  git@github.com:your-organization/your-repo.git (fetch)
origin  git@github.com:your-organization/your-repo.git (push)

What we’re going to do is make a remote on the local filesystem.

We’ll start by cloning into a shared directory (/tmp in this case):

them$ mkdir -p /tmp/git
them$ cd /tmp/git
them$ git clone git@github.com:your-organization/your-repo.git

We know that the absent user has a branch with code you need:

them$ git branch
  master
  develop
* feature/lol-i-will-be-here-tomorrow

So we’ll push it to that repo on the local filesystem:

them$ git remote add my-awesome-local-git-repo /tmp/git/your-repo/.git
them$ git remote -v
my-awesome-local-git-repo       /tmp/git/your-repo/.git (fetch)
my-awesome-local-git-repo       /tmp/git/your-repo/.git (push)
origin  git@github.com:your-organization/your-repo.git (fetch)
origin  git@github.com:your-organization/your-repo.git (push)

Then you can go back to your user account and pull it.

But first, you’ll need to make sure the /tmp/git/your-repo files are accessible. Since it’s a temporary clone, you could do something like this:

you$ sudo chown -R you:you .

And then go back your clone, add the remote, and check out the branch:

you$ git remote add my-awesome-local-git-repo /tmp/git/your-repo/.git
you$ git fetch my-awesome-local-git-repo
you$ git co feature/lol-i-will-be-here-tomorrow

And there’s the branch you needed! We’re all done in our scenario, so you could now rm -rf /tmp/git.

Summary

Git allows you to do a lot of interesting things like have a remote on the local filesystem, as described above:

$ git remote add my-awesome-local-git-repo /tmp/git/your-repo/.git

The remote on the local filesystem acts just like any other remote; it just happens to be hosted locally. There’s very little magic going on! It’s just a pile of files that git manages.

Another useful type of remote you can make yourself is a clone on another machine that’s accessible over SSH (and has the required git executables in $PATH):

$ git remote add my-awesome-remote-git-repo ssh://your-server/path/to/your-repo.git

That’s a lot like a private GitHub repo, but without any of the pretty web user interface or authorization management.

I hope this example helps illustrate that git is very flexible and can bend to your needs. If you’ve only ever used GitHub as a remote when using git, you’re missing out on some useful functionality! However, it’s it’s still best to have all your code in a central location, even though you could add a thousand remotes. Like any tool, know when to use it!

Apple Is Rejecting Some Apps From The App Store For Declaring Pebble Watch Support

by Ben

Apple Is Rejecting Some Apps From The App Store For Declaring Pebble Watch Support – Things Don’t Look Good For Android Wear On iOS.

Remember that report that claimed Google was preparing to make the Android Wear platform compatible with iOS? Yeah, that might not go down as smoothly as you had hoped. There’s still no official word on Wear for iOS, but the latest news out of the Apple camp has disturbing implications. According to one developer over on the official Pebble Watch forum, Apple is rejecting apps from its App Store simply for mentioning Pebble wearable support.

Yikes. That’s a scary precedent and very clearly anticompetitive.

Google seeks $1 billion expansion of Council Bluffs, Iowa datacenter

by Ben

Google seeks $1 billion expansion of Council Bluffs center | KCRG-TV9 | Cedar Rapids, Iowa News.

COUNCIL BLUFFS, Iowa (AP) — Google Inc. wants to expand its Council Bluffs data center spending an additional $1 billion and doubling the size of its staff to 70. […] Google’s total investment in Iowa will come to around $2 billion. […] Microsoft is spending about $2 billion to build two data centers in West Des Moines and Facebook has invested about $1 billion in two Altoona data centers.

It’s exciting that there’s lots of large datacenter growth in Iowa. I’d be interested in seeing a tour of these sometime.

Toy Story, 20 years later: how Pixar made its first blockbuster

by Ben

Toy Story, 20 years later: how Pixar made its first blockbuster | The Verge.

“We were always aware that we were making the first film done on computers, but I don’t think any of us really realized that it was a first, like starting a new way of doing animation in any kind of real sense,” Susman said. “Even to this day, just thinking about doing this talk, it was like, ‘Whoa, we were part of the first of something.’ And that’s pretty special.”

Pioneering in a very real way. These people made something out of just pure creativity.

Chat standards are still alive at Google

by Ben

Despite previous news to the contrary, Google is still a heavy user of XMPP, even for Google Talk. From their support site, dated late February 2015:

You can also still connect to Google Talk with compatible third-party apps, like Pidgin and Gajim.

And a longer summary from the Wikipedia page on Google Talk:

Google Talk is an instant messaging service that provides both text and voice communication. […] As of March 2015, it is not discontinued — despite reports to the contrary — and officially remains available over XMPP in third party applications.

Google Talk was also the name of the client applications previously offered by Google to use the service. […] As of February 2015, the Windows client ceased to work, with email notifications sent to users who attempt to login, recommending that they try Google Hangouts instead.

In May 2013, Google announced that it would be dropping support for XMPP federation, and it did so one year later. However, XMPP federation is separate from general XMPP support. As of March 2015, Google Talk continues to support clients using the open XMPP protocol. Such clients are available for a number of operating systems not supported by the Google Talk client.

Google retaining XMPP support is great news for chat standards; it makes me think that they’re hopefully going to keep XMPP support for chat for at least longer than I originally expected (but then again, I had low expectations). I especially welcome this news because at home and work, I could have text messages right now in SMS (cell texting), IRC, Twitter mentions, Twitter messages, Facebook, Facebook Messenger, my personal Google Hangouts/Talk, my work Google Hangouts/Talk, Sqwiggle, my personal Skype, my work Skype, Slack, and probably a few others I’m forgetting. I’d really love more services to use standards (XMPP or otherwise) just so I could have one way of checking for messages (let alone respond to them). This is notable because more chat services are becoming walled gardens than ever before; interoperability is something we’ve lost. But maybe things are looking up.

(Speaking of Slack — which I haven’t used much beyond testing — I was very happy to find out that they offer both XMPP and IRC gateways. That’s amazing for a chat service launching in 2013… which is sad statement in many ways.)

Of course, email is a different story — it’s been standardized for a long time, for better or worse — so longer messages tend to go there, whether it’s from an email client, or a service that emails me, like LinkedIn. (I don’t really think it counts if you can’t respond via email, though. GitHub does that really well, but Facebook doesn’t.) Sure, email is the lowest common denominator, but that’s because everyone has an email address. To understand the state of chat in 2015, imagine if you could only email other Gmail users if you had a Gmail account, or Yahoo Mail users if you had a Yahoo account. If that sounds crazy, replace “mail” with “chat” and realize that’s what we’re doing.

Anyway, the above is just a long, drawn out way of saying: it’s not that I don’t like shiny new things like Kik, SnapChat, Viber, WhatsApp, or whatever comes next… it’s just that I have enough ways for people to send me a short message and they all seem pretty much the same, besides who I happen to need to talk to. Honestly, I’m more likely to close accounts than open new ones.

MPW, Carbon and building Classic Mac OS apps in OS X

by Ben

High Caffeine Content — MPW, Carbon and building Classic Mac OS apps in OS X (via OSNews).

mpw_system1_to_yosemite

There has never been a good way to compile Classic Mac OS apps on modern OS X – for the most part, you were stuck using ancient tools, either Apple’s MPW or CodeWarrior, running in a VM of some sort. CodeWarrior, of course, is not free, and MPW only runs on Classic Mac OS, which is unstable at the best of times and downright nightmarish when trying to use it for development in an emulator like SheepShaver.

Enter ‘mpw’ (which I will refer to in lowercase throughout as something distinct from Apple’s MPW toolset).

[…]

With the same source file, and only a handful of #ifdefs, I could build the same app for 1984’s System 1.0 all the way up to the current release of OS X, Yosemite.

I really can’t think of a good reason to use this… except “because you can.” That said, it’s amazing that this works.

Dropbox Dropping Tiger and Leopard Support in May

by Ben

Dropbox Dropping Tiger and Leopard Support in May | Low End Mac.

It’s far from surprising that Dropbox is dropping support for these old versions of OSX. However, it does remind me of how surprised I was when Dropbox stopped making new versions for iOS 6 soon after iOS 7 was released, while still shipping new releases for OSX 10.4 on PowerPC. Who would expect better software support for an old iMac than a much newer iPhone?

I only occasionally use PowerPC Macs at this point — I mostly just have one to play with since it was offered to me for free, to be honest — but it does make me a bit sad to know that some very powerful PowerMac G5s are just that much less useful when May rolls around. I don’t expect hardware to be supported forever, but a G5 Mac has to be about the worst deal ever in terms of official support. (My mom still has no idea what a bullet she dodged after Apple replaced her failing iMac G5 with an Intel one for free. A $1000+ investment in a computer is expensive, but it’s nothing short of amazing that she hasn’t had to buy something new since 2005, given what the computer industry tends to expect as an upgrade cycle. Or you could consider AppleCare to have been a great choice in her case.)

In the end, I hope this drop of support doesn’t send too many old computers to the landfill. Always remember to recycle your electronics responsibly when upgrading, through resale or a recycling program at Best Buy, an Apple store, etc.

Meet KeySweeper, the $10 USB charger that steals MS keyboard strokes

by Ben

Meet KeySweeper, the $10 USB charger that steals MS keyboard strokes | Ars Technica.

I’m not a fan of wireless keyboards because of the number of batteries many people seem to go through, but if you really want to avoid wires, go for Bluetooth.

Obama in Cedar Falls, Municipal broadband in Iowa

by Ben

Big Cable, Obama spar over government-run broadband networks | Ars Technica.

We should have this available in Iowa City. It doesn’t need to be owned by the government; a cooperative or private organization would be fine too.

Obama spoke at Cedar Falls Utilities in Iowa, one day after calling for an end to laws in 19 states that make it difficult for cities and towns to create their own broadband networks. Cedar Falls, which is not in one of those states, offers 1Gbps fiber Internet service for $135 a month. Comcast’s fastest residential service tops out at 505Mbps and costs $400 a month.

Native Skype for Chromebooks Just Got a Step Closer

by Ben

Native Skype for Chromebooks Just Got a Step Closer – OMG! Chrome!.

With the Chrome runtime for Android and a possible ORTC implementation of Skype, it seems that Skype on Chrome OS is inevitable.