About
RSS

u9cpu


One nice feature of drawterm and Plan9's cpu and ncpu is that parts of the local filesystem appear on the remote machine as /mnt/term.

So instead of

  1. ssh hostname
  2. dang, forgot that file
  3. open local shell in new tmux/xterm/screen
  4. scp file hostname:
  5. back to the shell with ssh hostname
  6. do stuff on hostname
  7. dang another file not there
  8. back to the shell with the scp
  9. scp anotherfile hostname:
one can simply do
  1. drawterm hostname
  2. cp /mnt/term/file .
  3. do stuff on hostname
  4. cp /mnt/term/anotherfile .

Can we do that over ssh, too?
One could try diverse trickery with sftp through FUSE, or NFS/CIFS/WhateverFS exports.

I explored the following path closer to the Plan9 original:
Unix-like systems can run u9fs to export directories over 9p, and 9pfs to mount them. Forwarding u9fs's in/output through ssh caused strange errors. Using socat to bind the filedescriptors to a TCP socket on localhost and forwarding that through ssh works.
The result is u9cpu.sh, which mounts a given directory (default $HOME/tmp) as /mnt/term on the remote machine and then opens a shell there.

UPDATE Ron Minnich of Plan9 fame has implemented something similiar in Go: u-root/cpu.

Tue, 15 Feb 2022
[/plan9] permanent link