Copy ssh key in one command

This is absolutely brilliant

cat .ssh/id_rsa.pub | ssh remoteserver.example.com 'cat >> .ssh/authorized_keys'

All credit to Matt Might

Working more efficiently with rails migrations

I've been working on a major schema refactor on a rails application recently, and time and again I've had to reset my database because of some syntax error or another in my migrations. I'm changing schemas and moving data between columns, which makes the migrations really fragile.

It's also been fun learning about the rake tools that allow you to manage database migrations. In particular, three rails commands have come in handy:

HSTS and git

I've been in China for two months now, and I enjoy programming so I've checked probably 5-6 projects out of github at this point.

During this time, I've had troubles accessing https://gist.github.com. This always struck me as weird, but I didn't think too much of it.

In praise of the spreadsheet

Spreadsheets are amazing. They are arguably a Turing-complete programming language (only stretching the definition slightly). There are definitely as many spreadsheets as people in the world, and I'd even guess there are over a trillion actively used spreadsheets out there somewhere.

Simple touch-friendly HTML menus (using javascript)

I have a website with a two-level dropdown menu (it's not this one!). I want it to be slick, so I used CSS to only show the submenus when the user was hovering on the relevant parent menu item. This was great, until I realized people liked to access my website from their phones. The only way to reveal the submenus using a touch screen is to click the top menu item, but that will activate the link and change the page before you can find the link you want.

Convert ovpn file to inline format (all in one ovpn client config file)

Whenever I use openvpn I'm stuck carting around 5 files, sending them over Bluetooth and cluttering up my phone's downloads directory or confusing people I'm setting up with openvpn

I decided finally to figure out inline openvpn client config files (note: all-in-one files don't work on the Securepoint SSL windows client). I made this sed script/command that will automate the process. Imagine that the following five correctly configured openvpn files are in my current directory, with the openvpn file referencing the others:

Chinese software development and computer terms

I scoured the internet for a cheat sheet list of Chinese vocabulary related to computers/tech work, but I couldn't find one. So here goes nothing!

Short link to this list: www.devinhoward.ca/chinese

SSH port forwards

Here are the commands I use for ssh port forwards. If you add the -N flag it *won't* open an ssh session, but that's almost aesthetic. Imagine I'm running all of these from my laptop.

Interdependence in a capitalist model?

I have a thought, but I'm not well equipped to model the economics of it. I want to investigate it further.

When your cell phone can't be trusted - maybe the NSA has put on a virus, or another app - then you're in trouble. How can you be sure your data is not being modified? One way that Google and Apple accomplish this is through cloud sync. If your data is synced to the cloud, it can be modified, but it goes via Google or Apple, with logging included.

Implementing cgroups on Ubuntu or Debian

I just tried to implement cgroups on an Ubuntu machine. It was the most horrendous experience. In the hope of helping others, or myself in the future, here is some of what I've learned. A lot of Googling around and trial and error was needed. The most valuable resource on the web (which is still not fully helpful...) is at https://wiki.archlinux.org/index.php/cgroups.

Pages