title: What is the best way of running shell commands from a web based interface?
body: <p>Imagine a web application that allows a logged in user to run a shell command on the web server at the press of a button. This is relatively simple in most languages via some standard library os tools.</p>
  
  <p>But if that command is long running you don't want your UI to hang. Again this is relatively easy to deal with using some sort of background process or putting the command to be executed onto a message queue (and maybe saving the output and status somewhere for later consumption). Just return quickly saving we'll run that and get back to you.</p>
  
  <p>What I'd like to do is show the output of said web ui triggered shell command <em>as it happens</em>. So vertically scrolling text like when running in a terminal.</p>
  
  <p>I have a vague idea of how I might approach this, streaming the output to a websocket perhaps and simply printing the output to screen.</p>
  
  <p>What I'd like to ask is:</p>
  
  <p><strong>Are their any plugins, libraries or applications that already do this. Something I can either use or read the source of. Ideally an open source python/django or ruby/rails tool, but other stacks would be interesting too.</strong></p>