Search

gems: broadcast your terminal

January 10th, 2007 edited by lucas

Entry submitted by Martín Ferrari. DPOTD needs your help, please contribute !

Gems is an unknown, little, but efficient program which enables you to broadcast what is seen in your terminal to any number of clients. It’s great for technical lectures and talks, where people often has to make an effort to see what are you typing in the projected screen. It is terminal-agnostic, communicates by any TCP port using very little bandwith and no CPU power, and obviously, it’s free software!

It is very easy to set up, there is no configuration at all, apt-get it and you’re ready to go. In the master terminal, launch the server, optionally specifying a listening port and maximum number of connections (defaults to 6666 and 25, respectively, see the man page for more information), and immediatly you will be given back a shell:

teacherhost:~$ gems-server -port 9999
gems-server initialized.
gems-server: warning: terminal size is greater than 80x25.
teacherhost:~$ cd tmp
teacherhost:~/tmp$ PS1='Hello world class:\w\$ '
Hello world class:~/tmp$
Hello world class:~/tmp$ ls
test.c
Hello world class:~/tmp$

Gems warns you if you are using a big terminal, because clients won’t be able to connect if they have smaller terminals. To connect to a server, just specify address and port:

pupil1:~$ gems-client teacherhost 9999
gems-client: Connection established -- Press 'q' to exit.

Hello world class:~/tmp$ ls
test.c
Hello world class:~/tmp$

When a client connects, he sees only what you type after the connection is made, no screen status is maintained. This is key to its simplicity and compatibility with any type of terminal, but you will have to force screen refreshes as new clients connect (usually just pressing ^L). In this example the client connected just before the ls command was issued.

gems

This is a screenshot of a gems session with clients in the same computer, the focused terminal is the server. You can have different terminal sizes for clients and server as long as the server terminal can fit in the clients.

Links:

gems is included in Debian and Ubuntu since respectively Sarge and Hoary.

Posted in Debian, Ubuntu |

9 Responses

  1. N Says:

    Very useful. Thanks.

    I remember having to do this by ‘tee’ing the output of my screen editor into the ttys of students. Not flexible but those were old days and I thought it had some hack value. :)

  2. S Says:

    Is there something to record and play a terminal session !?

  3. Spook Says:

    I believe you can do exactly the same thing with screen.

  4. Doomguy Says:

    ’script’ records your session atleast, ‘cat’ for playback? :P

  5. krassswr Says:

    There is debian package.
    http://packages.debian.org/stable/misc/ttyrec
    it do record of tty and you can play with ttyplay included in package.

  6. Tincho Says:

    S: gems include calling script as an option.

    Spook: you need to all people be logged in the same machine with the same user to use screen like this, as far as I know.

  7. yarik Says:

    Sure it is different beast but since bandwidth is cheap this days I prefer VNC - then you can run as many terminals inside as you need.

  8. Tomp Says:

    Tincho: You can have multiple users connect to a screen session, but they do need to be logged in on the same machine. However, it can be a pain to set up and setting it up incorrectly can give the other users access to your account.

  9. Adam Says:

    That is a very cool tool. In these days of bloated GUI applications this is a little gem.