author | viric@mandarina |
Mon, 28 Apr 2008 21:39:46 +0200 | |
changeset 91 | af6b072bb025 |
parent 81 | baf70c6a4116 |
child 93 | 7d9b7a6da507 |
permissions | -rw-r--r-- |
53 | 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
2 |
<html lang="en"> |
|
3 |
<head> |
|
4 |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
|
5 |
<title>Terminal Mixer</title> |
|
6 |
</head> |
|
7 |
||
8 |
<body> |
|
9 |
||
10 |
<h1>Terminal Mixer</h1> |
|
11 |
||
12 |
<p>This program can start processes inside a pseudo-terminal, which can be |
|
13 |
accessed through a Unix socket, TCP or even raw ethernet (using the ethernet |
|
14 |
protocol 0xCACA). The programs can be linked to the current terminal, or |
|
77
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
15 |
they can be unlinked like in <em>nohup</em>. But even in this latter case you |
53 | 16 |
can connect to them using the mentioned protocols.</p> |
17 |
||
18 |
<p><em>tm</em> can also start programs as if they communicate through pipes |
|
19 |
instead of terminals, and this can be quite useful for remote-controlling |
|
20 |
applications.</p> |
|
21 |
||
22 |
<p>More than one client can connect to the served pseudo-terminal, either using |
|
23 |
<em>tm</em> as a client or <em>telnet</em> for TCP. You can choose if they |
|
24 |
are only allowed to read, or they can also contribute on input.</p> |
|
25 |
||
26 |
<h2>Download</h2> |
|
27 |
||
54 | 28 |
<p>Download the latest version (GPL 1.2+ licensed): |
91 | 29 |
<a href="tm-0.4.1.tar.gz">tm-0.4.1.tar.gz</a> - v0.4.1 - <a |
30 |
href="ChangeLog">ChangeLog</a></p> |
|
53 | 31 |
|
32 |
<p>Look at the |
|
54 | 33 |
<a href="/~viric/cgi-bin/hgwebdir.cgi/tm">version repository</a> if you are |
53 | 34 |
interested in its development. If you can send any bug report, please |
35 |
do that at the mail address at the bottom of the page. I'd like this |
|
36 |
program to have as few bugs as possible, sure!</p> |
|
37 |
||
38 |
<h2>What can you do with it? Examples of use</h2> |
|
39 |
||
91 | 40 |
<ul> |
41 |
<li><a href="#share">Share a terminal remotely</a> |
|
42 |
<li><a href="#ether">Have an assured way of accessing a host, even if it has no IP address</a> |
|
43 |
<li><a href="#mplayer">Remote control for mplayer</a> |
|
44 |
<li><a href="#telnet">Transfer files through telnet</a> |
|
45 |
<li><a href="#log">Access to a part of an execution log, on demand</a> |
|
46 |
</ul> |
|
47 |
||
48 |
<h3><a name="share"></a>Share a terminal remotely</h3> |
|
53 | 49 |
Start <em>vim</em> cooperatively, using: |
50 |
<pre> |
|
77
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
51 |
tm -N 2 -p 3000 -t -x -w vim |
53 | 52 |
</pre> |
77
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
53 |
<p>Two [-N 2] users will be able to telnet to the port 3000 [-p 3000], and get |
53 | 54 |
the same <em>vim</em> terminal [-t] interface as you. They will be able |
55 |
to use vim [-w], not only look at it. |
|
56 |
The size of their xterms [-x] will be set accordingly to the size of your |
|
57 |
terminal. A nice feature of xterm!</p> |
|
91 | 58 |
|
59 |
<blockquote>Attention! <em>vim</em> programs the vt100/xterm input/output codes at start. |
|
60 |
If the clients don't receive those codes, they won't be able to use the Cursor |
|
61 |
Keys effectively, for example. In that case, you may start a bash in tm, and |
|
62 |
when the clients are connected, start vim.</blockquote> |
|
63 |
<h3><a name="ether"></a>Have an assured way of accessing a host, even if it has no IP address</h3> |
|
53 | 64 |
<p>Start a remote <em>bash</em> putting this in your start scripts:</p> |
65 |
<pre> |
|
66 |
ifconfig eth0 up |
|
67 |
tm -e eth0 -n -w bash & |
|
68 |
</pre> |
|
69 |
<p>Then you can connect to it using another computer (as root), typing |
|
70 |
the MAC address of the serving host:</p> |
|
71 |
<pre> |
|
72 |
tm -e eth0 -c 00:14:85:16:B2:32 |
|
73 |
</pre> |
|
74 |
<p>And you will have a non-terminal bash answering your requests. Don't |
|
75 |
<em>exit</em> from it, because the <em>tm</em> server will end.</p> |
|
91 | 76 |
<h3><a name="mplayer"></a>Remote control for mplayer</h3> |
53 | 77 |
<p>Start a <a href="http://www.mplayerhq.hu/">mplayer</a> allowing remote |
78 |
commands with:</p> |
|
79 |
<pre> |
|
80 |
tm -w mplayer -slave voice_recording.mp3 |
|
81 |
</pre> |
|
82 |
<p>Then you can send orders as simple as these:</p> |
|
83 |
<pre> |
|
84 |
echo pause | tm |
|
85 |
</pre> |
|
86 |
<p>Make your xbindkeys to map to these commands, and you can have a good |
|
87 |
control of your music playing. |
|
88 |
In fact I mapped <em>pause</em> to F1, and <em>go backwards 5 seconds</em> |
|
89 |
to F2, and I use this for transcription of voice recordings.</p> |
|
91 | 90 |
<h3><a name="telnet"></a>Transfer files through telnet</h3> |
77
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
91 |
<p>If you run a telnet client inside <em>tm</em>, you can use a <em>tm</em> client |
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
92 |
to send uuencoded streams. You can look at a |
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
93 |
<a href="http://www.youterm.com/?view=Player&video=tools/tm-telnetfile">Youterm |
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
94 |
podcast</a> for that.</p> |
91 | 95 |
<h3><a name="log"></a>Access to a part of an execution log, on demand</h3> |
96 |
<p>Imagine you want to run the program XXX, which does a lot of debug |
|
97 |
output in stdout. Even without running it through tm, |
|
98 |
you will be able to access the logs <strong>only</strong> when |
|
99 |
you connect to it.</p> |
|
100 |
<pre> |
|
101 |
XXX | tm cat > /tmp/total_log.txt |
|
102 |
</pre> |
|
103 |
<p>You can redirect to /dev/null or use <em>tm</em>'s -n [nohup] if you |
|
104 |
don't want |
|
105 |
to store all the debug info. In any case, you can run a simple |
|
106 |
<kbd>tm</kbd> command with no parameters, and you will be seeing |
|
107 |
the debug info since the connection. Close <em>tm</em> (Control-C) and |
|
108 |
you will not see the info until a new connection is made.</p> |
|
109 |
||
53 | 110 |
|
111 |
<h2>Manual</h2> |
|
77
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
112 |
<p>Here you have a copy of the help for v0.4:</p> |
53 | 113 |
<pre> |
77
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
114 |
tm v0.4 - terminal mixer, Copyright (C) 2007 Lluis Batlle i Rossell |
53 | 115 |
usage: ./tm [opts] [appcommand] [param1] [param2] ... |
116 |
If you give _appcommand_, it starts the application and |
|
117 |
serves it through a Unix socket on $TM_SOCKET or /tmp/tm-socket.UID, |
|
118 |
unless '-p' is used. |
|
119 |
Without _appcomand_, starts a the Unix socket client. |
|
120 |
options: |
|
121 |
-h Show help. |
|
122 |
-P Run the child as connected to a pipe (default). |
|
123 |
-t Run the child as connected to a terminal (raw mode in client). |
|
124 |
-n Unlink the program from the terminal (as 'nohup'). |
|
125 |
-N MAX Serve at most MAX sockets for each transport (1 default). |
|
126 |
-w The remote clients can write to the application. |
|
127 |
-C The remote clients end will close app's stdin. |
|
128 |
-p NUM Listen to tcp port NUM for 'telnet', and not listen to any |
|
129 |
Unix socket. |
|
130 |
-E Echo remote input to the server terminal. |
|
131 |
-e dev Also serve/connect using raw ethernet, device 'dev'. |
|
132 |
-c adr Connect to address (MAC if eth). |
|
133 |
-x Send xterm's resize control string to clients. |
|
134 |
</pre> |
|
135 |
||
136 |
<h2>Thanks</h2> |
|
137 |
<ul> |
|
138 |
<li>To Pancake, who gave a spark for the general idea of this program, |
|
139 |
based on an initial <a href="../stdinmix">stdinmix</a> |
|
140 |
<li>To Raúl Salinas, for its support. |
|
141 |
<li>To the useful, although sometimes uncomfortable, UNIX interface. |
|
142 |
<li>To GNU, an ugly but working and helpful ol' UNIX implementation. |
|
143 |
<li>I took some bits from |
|
77
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
144 |
<a href="http://freshmeat.net/projects/cec/">Coraid Ethernet Console</a> |
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
145 |
(BSD license). <a |
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
146 |
href="http://plan9.bell-labs.com/plan9/">Plan 9</a> version at |
24b0568ba017
Moving to 0.4. Updated web page, added Changelog.
viric@llimona
parents:
55
diff
changeset
|
147 |
<kbd>/n/sources/contrib/quanstro/src/cec/</kbd> - Thanks to Erik Quanstrom. |
53 | 148 |
</ul> |
149 |
||
150 |
<address>Author: |
|
81 | 151 |
<a href="http://vicerveza.homeunix.net/~viric/index.html.en">Lluís |
152 |
Batlle i Rossell</a>, |
|
53 | 153 |
viric_at_vicerveza_dot_homeunix_dot_net</address> |
154 |
</body> |