Categories
Blog

Setting up an iPad Pro with Coda and Amazon Lightsail for Coding

Some time ago I tried to set up my iPad Pro for coding. I ended up using  Coda and Amazon Lightsail. If you want to know what I was thinking, you should read: Coding on an iPad Pro.

I figured that article did a great job of explaining why I’d ever want to do something as silly as setting up an iPad Pro for Coding, but it never explained how would would go about setting up an iPad Pro with Coda or Amazon Lightsail for coding or any other reason.

Yeah, so here’s that.

Set up Lightsail. Duh.

This is assuming you’ve already got AWS set up, but not Lightsail. If you want to know how to set up AWS, click here: http://lmgtfy.com/?q=set+up+aws

Getting to Lightsail is pretty easy. It should come up under all your services, right under EC2.

On your first attempt, you probably won’t have anything set up, so I’m going to assume you need to create an instance. If you already have an instance and just need to know how to do the actual set up, you can skip ahead. However, I’d appreciate you scrolling up an down a few times to help me build up my site’s engagement numbers. ^_^

Choose and Image

I ended up going for Node.js for reasons, but you can choose whatever you want for what you need. If you’re just doing this to putz around, I’d suggest just going for an OS only instance.

The biggest gotcha is your SSH Key Pair. By default you’re going to see something that says: You are using the default SSH key pair for connecting to your instance.

This should be left alone unless you have a specific need for custom SSH keys, or again, if you already have this set up and just need to get it onto your iPad. More on that in a bit.

The rest just requires you choosing a payment plan, because this will cost you money. I’m sure you can get everything set up for pennies on the dollar just using straight up EC2, but if you knew how to do that, chances are, you already know what you’re doing. I didn’t. I’m a total hack and have no idea what I’m doing. Just don’t tell my manager or whoever cuts my pay check.

Keys. The pain after the easy part.

If you’ve skipped the set up from before, this is where you should start reading.

This is the part that caused me the biggest grief, because I started the whole process on my iPad. However, getting the keys set up on your iPad requires a file system, and Apple says you can’t be trusted with that sort of thing. We know what a coder can do with a file system, so don’t act all innocent.

Chances are you’ve gotten to this point, and clicked on the little terminal icon to ssh via your browser. But that’s not what we’re here for. You need to set up your iPad.

What Coda needs to connect is an actual public key file. In this case, a .pem file. This is something you can easily download via a desktop browser, but is annoying to transfer over to your iPad.

But we’re hackers. We eat annoying problems and crap solutions!

First things first, on your desktop, download your .pem file. You’ll find it in your accounts page, under SSH Keys.

Going Old School. Transfer via iTunes

This was the annoying bit. I tried using iCloud, AirDrop, even Dropbox. Completely forgot that in the beforefore times, we’d transfer files through a friggin’ wire!

When your iPad is connected through iTunes, look for File Sharing, as of iTunes version 12.7.2, and look for Coda in the list of apps.

You just need to drag the .pem file from your computer’s file system (assuming you’re using a Mac to do this. I suppose Windows also lets you drag and drop, but I haven’t used iTunes on Windows in forever),

It may not seem obvious, but click “Done” when you’re done.

Set up keys in Coda

If you’re with me to this point, your keys should now be on Coda. I’m going to assume you’re setting up a new site in Coda, but if not, it shouldn’t be different to add new keys to an existing site.

From the Settings (little gear thing on top of the main screen of Coda), click Keys.

You’re gonna click the + Icon near the top, and you’ll see a list of ways of importing your key. You should click on Import from Itunes.

If you successfully transferred over the key through iTunes, it should pop up like the image below. If it doesn’t show up, try transferring the file again.

Add Keys to your Site in Coda

I’m going to continue assuming you don’t have an actual site set up in Coda. If you already do, the steps aren’t much different. Just edit the site instead of adding a new one.

Whether it’s a new site, or an existing one, you can click on the little terminal icon to get to your site’s terminal set up.

Click on the little Key icon next to password. The password field is just for passwords, but loading in a key will make it use those credentials and not bug you for a password.

You’ll get a menu that lets you choose your keys. The key you imported before should show up here.

Connect to Lightsale. On an iPad.

We’re in the home stretch now. When you’re in your site, you should now see an option for getting to the terminal.

Assuming your credentials are all set, you’ll get a prompt to add the host to your keys. Obviously you should accept this.

If everything works out, you’ll see a lovely prompt on your iPad.

Keep on hacking!