[IPython-User] Gate One - web-based terminal emulator

riskable riskable@youknowwhat....
Wed Apr 25 14:55:06 CDT 2012


Hey there...  I'm the author of Gate One (the mysterious, "they" =).  I
thought I'd pop in and confirm that it is indeed IPython being shown in
those screenshots (and the video).  In fact, I use IPython every day! 
Especially when I'm working on Gate One.

Also, your description of how inline images work is spot-on:  Gate One
detects/captures JPEG and PNG images printed to stdout, resizes them to fit
within the terminal (if necessary), and converts them to data::URIs before
sending them to the browser.  It also adds newlines and moves the cursor to
an appropriate location to ensure that everything lines up properly.

If you're curious the code that handles all of this is here:

https://github.com/liftoff/GateOne/blob/master/gateone/terminal.py#L1207
(also take a look at the capture_image() function and the _spanify_screen()
function to see the complete cycle of 'cat <image>' -> captured -> converted
to HTML).

If you have any questions or feedback regarding Gate One just reply to this
post.

One last thing...  Since you seemed to like the inline image capability I
just posted a video demonstrating something equally as cool:  The new
widget() function showing off a real-time load graph of the server I was
connected to.  Here's the link:

http://www.youtube.com/watch?v=7M_9I9ofFLU

Here's how that load graph works:  By default Gate One will detect the
presence of an existing SSH tunnel and will re-use it (multiplex) for
outbound connections to the same server.  This means you can spawn a shell
at the other end of an SSH tunnel with very little overhead/latency.  The
SSH plugin includes a execRemoteCmd() function (JavaScript) that will run
whatever command you want on such a multiplexed shell (in the background)
and call a given callback with the result.

The Example plugin (load graph widget) shown in the video just calls the
'uptime' command (via execRemoteCmd()), parses the result, and adds the
resulting data points to the graph.  It repeats this every three seconds to
keep the graph up-to-date.  Another important thing to note is that
subsequent calls to execRemoteCmd() will re-use the existing
connection/shell and said connection/shell will automatically terminate
itself after a period of inactivity.  So there's no need to worry about
dozens of idle/leftover connections.

I look forward to the feedback!

--
View this message in context: http://python.6.n6.nabble.com/IPython-User-Gate-One-web-based-terminal-emulator-tp4831552p4917839.html
Sent from the IPython - User mailing list archive at Nabble.com.


More information about the IPython-User mailing list