In the past I have not been a huge fan of "the cloud" for all of the work that I need to do. I still prefer native over web apps but I also like the convenience of having my data accessible everywhere. However, over the past few months I have been doing more work in web apps and doing development over ssh on my own server. This post will go over some of the necessary tools that is needed to make remote development awesome.

Cloud9

I used cloud9 ide for over a week. I was able to get the app running on my server with a lot of pain and dependencies. All of the nodejs app that I have tried to setup have 100's of dependencies and any one of them can fail on install. Anyways, I was able to get the app running and was able to do small development tasks on it. It is mostly geared towards web development but has syntax support for many other languages. It ran fine for a while but it would always throw a few errors and I had an issue with data loss when I encountered an error on save. After that I felt like I was tying a paper for college where I was paranoid about data loss and saving the Word doc ever few minutes.

I wanted to install cloud9 on a LXC container so that it is properly sandboxed but the dependencies kept failing to install until I gave up. I think a web ide is still premature for the type of development that I need to do and the responsivneness that I am used to.

Remote Stack

So if I am not using a web ide what am I using? I am running an Ubuntu 12.04 64bit server that I ssh into. Ssh is secure, fast, and just works. It provides the exact same shell that is on my local machine via my .dotfiles. Here is a quick list of my setup:

With these tools I have a consistent and persistent development environment from any location. The one thing that I do not like to do on the cmd prompt is managing sql databases. I like to have a gui when working with a sql db.

Shell
Zsh plus oh-my-zsh is very powerful and fast. It provides everything that I need and works the same on linux and osx. The plugins for many of the apps that I already use and tab completion make my workflow very efficient.

Editor
An ssh workflow is not going to work if you use a heavy ide to write code. Working as a .NET dev by day I couldn't imaging working with C# and .NET without Visual Studio because the framework is so large and the namespaces and inheritance chains can be very deep. Being able to remember not only the large, OO and pattern heavy applications that are written in .NET along with the entire .NET frameworks (+ ASP stack) it is nearly impossible to navigate the projects without Visual Studio doing it for you. However, the code that I write for open source, freelancing, and myself is Python, Go, and your standard web shit (html, css, js) I prefer a text editor over an ide.

My editor of choice is vim. I have used vim for a long time. I took a small six month break from vim and used Sublime Text 2 but it started to slow down after a while and I will still using vim when I ssh'd into a server. So my editing skills were split between two editors and it was just time for me to come back home to hjkl. Plus Sublime Text 2 does not work over ssh. It has good code completion for the languages that I work in so with my setup it is basically a very lightweight ide.

Tmux
When working over ssh the biggest issue is persisting your state when you need to logout. It is no fun when you have a few vim tabs, splits, and other processes running while coding then after you logout, then log back in you have to recreate everything to get back where you were. I used to use screen for this but I have recently switched to tmux because of the added features. Tmux allows you to persist your sessions, have multiple windows ( ssh sessions) and terminal splits to provide an entire workspace on one ssh connection. You can logout and back in and start coding right away.

You can even have an irc client running in your terminal while working and easily switch back and forth with a keystroke. Tmux (or screen) is a must have when working over ssh, it is what makes a productive workflow possible.

Virtualization
Installing dependencies on your development boxes is not a wise idea when virtualization is so easy. I use both vagrant with puppet and docker for running additional boxes on my machine. This allows me to install and run postgres, redis, etc and take these resources down when not in use without having to junk my box up with all the dependencies that are required for modern development.

Backup
Even though you are "developing in the cloud" that does not mean you do not need to backup your workspace. Backups are really simple with rdiff-backup. It does incremental backups and is fast and efficient. I do daily backups of my development folder to another hard drive via a cron job to fire rdiff-backup and a weekly backup to S3 of the files.

That's about it. Any computer with a terminal allows me to securely connect to my workspace and resume on whatever I was working on. This setup also allows me to have a smaller and more portable computer because all the processing is done on my server that has fast cpus, ssd, and lots of ram. It has taken me a while to get used to working on the server and not on my local file system. I had to delete my development folder on my laptop (initially) so that I wouldn't be tempted to change files locally.

I do run the risk of not having internet access and not being able to access my files so I sill sync my development folder to my laptop. Hopefully more people will be able to look at hardware as a keyboard and a screen to connect to an always online workspace that is where ever you are.

Other articles

Working with the SecureString class in .NET is fairly easy. This class allows you to keep string data encrypted in memory. Maybe you load connection strings, passwords, or financial data into memory when your application starts or loads an object so the least you can do is use the SecureString ...

Servers

Running your own infrastructure is awesome, if your a hacker like me. If your a square and you don't want to mess with your own hardware you have two choices if you are going to host your website or services online. If you don't feel like spending ...

Python is my favorite language to work with. It is so versatile. I can automate tasks, write quick scripts, process data, and even run a web application. It is very portable and I love the syntax. For a web framework I use web.py because it stays out of your ...

I have been working on two iOS applications over the past few days and have been longing for a LINQ like syntax in Objective-C. LINQ is an amazing way to work with collections and it really adds a productivity boost to your coding. Since Objective C does not have LINQ ...

Design patterns can help you solve complex coding problems with proven solutions. This will be a mini series about different design pattern implementations in Objective - C. I will be using a simple console app and updating the code on github with each new pattern.

Factory Pattern

CodeAssistant is a simple tool to test code snippets in virtually any language on Windows. It has been in development for four months and has been a great learning experience for domain driven development and .NET's WPF.

From my point of view the reason why we create multithreaded applications is so the user experience does not suffer. We have operations that need completed but running these on the main thread will block the UI and piss off our users.

I just puked up some old code for a little app that displays your iCal events in the terminal. I have it as one of my startup scripts so when I start a new bash session I see my events for the next 7 days. It's a very simple ...

If you use Terminal on your Mac like I do. It is the first application that is run at starup and the last to close. When you start Terminal in a new window or tab that is a great time to review your computer stats, iCal events, and disk sizes ...

The Problem

So this is much easier if you have a static site that is generated using pelican or jerkyll. Both of these apps are great for generating blogs out of markdown or other simple text markup language. I use pelican because it is built with python and that is what I ...

The thing about dvsc that makes me nervous is that all the code and revision history is on your local computer. This makes it very fast when committing, branching, and merging but what if you have a drive failure or worse? All your code is gone if you don't ...

Everyone needs a fast instance in a datacenter to work with. Amazon's EC2 or any other VPS provider will give you access. Sometimes you need to transfer files around fast or do some data processing. Having a fast instance will help you get your job done faster.