Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Steve Simon


i wrote a cpu like client/server for windows (called dos). 

my code and test environment lived on a microsoft smb server. i ran cifs(1) to 
get access to this from plan9 and sam.

dos(1) allowed me to start an rc(1) running on win32 in the same directory as 
my current directory on plan9. it also kept my local /dev/wdir up to date with 
that on windows - massaging paths as needed.

all this allowed me to bounce between windows and plan9 fairly transparently 
like cpu(1) would on plan9. i could also plumb files i saw and plan9 would do 
the right thing.

it should use the cpu(1) protocol but i never got round to it - what i have 
just works.

my current employer uses Macs rather than windows so this has fallen into 
disuse.

i am happy to share if anyone has a use for it.

-Steve


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M90430f1d0d3a94dcd370712f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread hiro
if you don't already use drawterm anyway for other reasons, and you
only would like to set up ssh, and you already have a working 9p
server for linux (like u9fs), i don't think there's an immediate
benefit in switching to drawterm.

otoh if you already do use drawterm interactively for different
reasons, it is probably nice to know that you can abuse ssh to get the
same environment as exported by drawterm even when you happen to sit
on the wrong side of the pipe sometimes.

it's a bunch of inversions of directions, and it sounds complicated.
but i already have scripts ready for the use of drawterm, so it came
naturally.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-Mf8a2a371ccfd7948c69ca6e3
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread hiro
it's still equivalent, obviously you can start drawterm in the
background or in some persistent virtual terminal emulator.

and yes, both drawterm and ssh will use TCP below, the only difference
in the stack for the actual data would be that instead of SSH you
would have TLS for encryption.

On 7/21/21, Dan Cross  wrote:
> On Wed, Jul 21, 2021 at 1:32 PM Xiao-Yong Jin  wrote:
>
>> > On Jul 21, 2021, at 12:16 PM, Dan Cross  wrote:
>> >
>> > Nothing prevents you from invoking u9fs over an SSH connection; one
>> needn't run it from inetd, and I doubt anyone has in 20 years.
>>
>> You are right.  In that case, the only difference is just that,
>> citing hiro,
>>
>> yes it's a lot of back and forth, but ssh only is needed for
>> running
>> the process, the data afterwards can use 9p directly.
> 
> 
> It's unclear what that's supposed to mean. There's obviously still a
> transport involved; in one case, that's over (I presume) TLS over a TCP
> connection owned by drawterm, in the other, it's a bitstream running over
> the SSH protocol over TCP. In the former case, if the drawterm process on
> the Linux side dies for whatever reason, your imported resources disappear.
> In the latter, if the sshd or u9fs die, same.
> 
> Overall, this seems like abusing drawterm to do what u9fs (or other,
> similar userspace 9P servers) was (were) intended to do.
> 
> - Dan C.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-Me7a96cf8efb8514500af667a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Dan Cross
On Wed, Jul 21, 2021 at 1:32 PM Xiao-Yong Jin  wrote:

> > On Jul 21, 2021, at 12:16 PM, Dan Cross  wrote:
> >
> > Nothing prevents you from invoking u9fs over an SSH connection; one
> needn't run it from inetd, and I doubt anyone has in 20 years.
>
> You are right.  In that case, the only difference is just that,
> citing hiro,
>
> yes it's a lot of back and forth, but ssh only is needed for
> running
> the process, the data afterwards can use 9p directly.


It's unclear what that's supposed to mean. There's obviously still a
transport involved; in one case, that's over (I presume) TLS over a TCP
connection owned by drawterm, in the other, it's a bitstream running over
the SSH protocol over TCP. In the former case, if the drawterm process on
the Linux side dies for whatever reason, your imported resources disappear.
In the latter, if the sshd or u9fs die, same.

Overall, this seems like abusing drawterm to do what u9fs (or other,
similar userspace 9P servers) was (were) intended to do.

- Dan C.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-Mbefc0794ea49365431f10fc4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread hiro
> This is using ssh to attach to the Linux machine to import it's filesystem
> into the plan9 namespace? Wouldn't authenticating from plan9 to Linux over
> SSH be independent of drawterm vs u9fs?

yes, if you only need files from the filesystem ssh might be
sufficient protection.
also, with additional use of sshnet you're not missing out against
drawterm's /net either.
so yes, for many things it can be equivalent.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M08fc0896d2d3b3889375ab02
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Xiao-Yong Jin
> On Jul 21, 2021, at 12:16 PM, Dan Cross  wrote:
> 
> Nothing prevents you from invoking u9fs over an SSH connection; one needn't 
> run it from inetd, and I doubt anyone has in 20 years.

You are right.  In that case, the only difference is just that,
citing hiro,

yes it's a lot of back and forth, but ssh only is needed for running
the process, the data afterwards can use 9p directly.


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M0420f6421e0b56116336edff
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Dan Cross
On Wed, Jul 21, 2021 at 1:09 PM Xiao-Yong Jin  wrote:

> > On Jul 21, 2021, at 11:42 AM, Dan Cross  wrote:
> >
> > On Wed, Jul 21, 2021 at 12:17 PM Xiao-Yong Jin 
> wrote:
> > > On Jul 21, 2021, at 11:08 AM, Dan Cross  wrote:
> > > > ssh linuxpc drawterm -c srvdev.rc
> > > >
> > > > yes it's a lot of back and forth, but ssh only is needed for running
> > > > the process, the data afterwards can use 9p directly.
> > >
> > > What's the difference between that and using something like u9fs?
> >
> > auth?
> >
> > This is using ssh to attach to the Linux machine to import it's
> filesystem into the plan9 namespace? Wouldn't authenticating from plan9 to
> Linux over SSH be independent of drawterm vs u9fs?
>
> Drawterm does the proper auth and connect to the plan9 system.
> U9fs needs plan9 srv to auth and connect to it.
>
> If you are running a plan9 system, you probably have your auth
> setup.  If you have access to a posix system, you probably have ssh
> setup and you have access as a normal user, and that enables you
> to do ssh and drawterm back.  No additional setup required.
>
> U9fs, on the contrary, states
>
>   It is typically invoked on a Unix machine by
>   inetd with its standard input and output connected to a net-
>   work connection, typically TCP on an Ethernet.  It typically
>   runs as user root and multiplexes access to multiple Plan 9
>   clients over the single wire.  It assumes Plan 9 uids match
>   Unix login names, and changes to the corresponding Unix
>   effective uid when processing requests.
>
> I'm not going to run this and listen on a public interface even if
> it does not run as root.
>
> There are issues with the auth method that u9fs uses, which I'm not
> going to discuss here.


Nothing prevents you from invoking u9fs over an SSH connection; one needn't
run it from inetd, and I doubt anyone has in 20 years.

- Dan C.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M19bbcae898047761677de240
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Xiao-Yong Jin
> On Jul 21, 2021, at 11:42 AM, Dan Cross  wrote:
> 
> On Wed, Jul 21, 2021 at 12:17 PM Xiao-Yong Jin  wrote:
> > On Jul 21, 2021, at 11:08 AM, Dan Cross  wrote:
> > > ssh linuxpc drawterm -c srvdev.rc
> > >
> > > yes it's a lot of back and forth, but ssh only is needed for running
> > > the process, the data afterwards can use 9p directly.
> > 
> > What's the difference between that and using something like u9fs?
> 
> auth?
> 
> This is using ssh to attach to the Linux machine to import it's filesystem 
> into the plan9 namespace? Wouldn't authenticating from plan9 to Linux over 
> SSH be independent of drawterm vs u9fs?

Drawterm does the proper auth and connect to the plan9 system.
U9fs needs plan9 srv to auth and connect to it.

If you are running a plan9 system, you probably have your auth
setup.  If you have access to a posix system, you probably have ssh
setup and you have access as a normal user, and that enables you
to do ssh and drawterm back.  No additional setup required.

U9fs, on the contrary, states

  It is typically invoked on a Unix machine by
  inetd with its standard input and output connected to a net-
  work connection, typically TCP on an Ethernet.  It typically
  runs as user root and multiplexes access to multiple Plan 9
  clients over the single wire.  It assumes Plan 9 uids match
  Unix login names, and changes to the corresponding Unix
  effective uid when processing requests.

I'm not going to run this and listen on a public interface even if
it does not run as root.

There are issues with the auth method that u9fs uses, which I'm not
going to discuss here.
--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-Me0fbfb51e9d00650796490b0
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Dan Cross
On Wed, Jul 21, 2021 at 12:17 PM Xiao-Yong Jin  wrote:

> > On Jul 21, 2021, at 11:08 AM, Dan Cross  wrote:
> > > ssh linuxpc drawterm -c srvdev.rc
> > >
> > > yes it's a lot of back and forth, but ssh only is needed for running
> > > the process, the data afterwards can use 9p directly.
> >
> > What's the difference between that and using something like u9fs?
>
> auth?
>

This is using ssh to attach to the Linux machine to import it's filesystem
into the plan9 namespace? Wouldn't authenticating from plan9 to Linux over
SSH be independent of drawterm vs u9fs?

- Dan C.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M2452ff590f92aee3d7e33dfb
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Xiao-Yong Jin
> On Jul 21, 2021, at 11:08 AM, Dan Cross  wrote:
> 
> ssh linuxpc drawterm -c srvdev.rc
> 
> yes it's a lot of back and forth, but ssh only is needed for running
> the process, the data afterwards can use 9p directly.
> 
> What's the difference between that and using something like u9fs?

auth?

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M0b41c5534d3ffc52dae6bce7
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Dan Cross
On Wed, Jul 21, 2021 at 11:12 AM hiro <23h...@gmail.com> wrote:

> if i want to serve files from a linux, i sometimes run drawterm on the
> linux, export stuff to an /srv and then access that from the other
> side.
>
> theoretically you can automate that also from the other side, make
> some script for the /srv stuff, and run it from 9front via ssh via
> drawterm:
>
> ssh linuxpc drawterm -c srvdev.rc
>
> yes it's a lot of back and forth, but ssh only is needed for running
> the process, the data afterwards can use 9p directly.
>

What's the difference between that and using something like u9fs?

- Dan C.

On 7/21/21, Xiao-Yong Jin  wrote:
> >> On Jul 20, 2021, at 10:52 PM, Lucio De Re  wrote:
> >>
> >> what would
> >> it take to serve 9P on Posix (in P9P, in other words) over the
> >> network? Fontsrv and gitsrv would be immediate beneficiaries.
> >
> > Just run it like,
> >
> > fontsrv -s 'tcp!192.168.9.2!1500'
> >
> > and I've no idea what gitsrv is.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M0fca6f2faa67aa5a68dafebd
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread hiro
if i want to serve files from a linux, i sometimes run drawterm on the
linux, export stuff to an /srv and then access that from the other
side.

theoretically you can automate that also from the other side, make
some script for the /srv stuff, and run it from 9front via ssh via
drawterm:

ssh linuxpc drawterm -c srvdev.rc

yes it's a lot of back and forth, but ssh only is needed for running
the process, the data afterwards can use 9p directly.

On 7/21/21, Xiao-Yong Jin  wrote:
>> On Jul 20, 2021, at 10:52 PM, Lucio De Re  wrote:
>>
>> what would
>> it take to serve 9P on Posix (in P9P, in other words) over the
>> network? Fontsrv and gitsrv would be immediate beneficiaries.
> 
> Just run it like,
> 
> fontsrv -s 'tcp!192.168.9.2!1500'
> 
> and I've no idea what gitsrv is.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-Mdb88673fa85a760087940e5e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-21 Thread Xiao-Yong Jin
> On Jul 20, 2021, at 10:52 PM, Lucio De Re  wrote:
> 
> what would
> it take to serve 9P on Posix (in P9P, in other words) over the
> network? Fontsrv and gitsrv would be immediate beneficiaries.

Just run it like,

fontsrv -s 'tcp!192.168.9.2!1500'

and I've no idea what gitsrv is.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M58a85fbab67058af61f54848
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-20 Thread Lucio De Re
On 7/19/21, Steve Simon  wrote:
>
> my cpu for windows was always incomplete, but good enough that i never
> finished it properly.
>
It's on contrib, is it not? I'll take a peek, if my haphazard priority
list allows it :-)

> for posix i just use sftpfs or now cinap’s sshftp to import the filesystem
> from the posix box as /n/fred and run sam locally (i am a samista rather
> than an acmeite)
>
I am aware. Acme is addictive, warts and all.

> i cannot run stuff remotely but i can edit in a nice environment. is this
> not enough?
>
Well, what I have taken to do is to run acme on the remote Posix
server (no Windows, I am no masochist, and I can't waste time on the
Apple bandwagon) across X forwarding, which is quite a bit on the good
side of tolerable. And win is OK for quite a bit of remote command
line interaction. I don't think it would pay to build ncurses into
that :-).

But from my Plan 9 workstation that is absurdly not possible. Or, I
have missed a step and I need somebody to rattle me some: what would
it take to serve 9P on Posix (in P9P, in other words) over the
network? Fontsrv and gitsrv would be immediate beneficiaries.

Lucio.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-Mcbfff74b90e907db565b2890
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-19 Thread Steve Simon


my cpu for windows was always incomplete, but good enough that i never finished 
it properly.

for posix i just use sftpfs or now cinap’s sshftp to import the filesystem from 
the posix box as /n/fred and run sam locally (i am a samista rather than an 
acmeite)

i cannot run stuff remotely but i can edit in a nice environment. is this not 
enough?

-Steve



--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M1d424bd90cc86bc378222ce4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-18 Thread Michael Misch
I’ve started toying with that very idea Lucio, but I haven’t had much time to 
really vet the ideas. My work has been specifically for 9front and rcpu

> On Jul 18, 2021, at 9:53 PM, Lucio De Re  wrote:
> 
> On 7/19/21, adr via 9fans <9fans@9fans.net> wrote:
>> [ ...].  Running samterm locally is way more efficient than
>> using X forwarding.
>> 
> I have adopted on my Linux (Mint) workstations - plural - the paradigm:
> 
> ssh -fX remote acme -l lib/task.acme # for different tasks
> 
> and it works even remotely pretty adequately. The remotes tend to be
> pretty slick Debian servers, but even locally that is a  boon (NetBSD
> rules the Posix roost in my office).
> 
> What I can't do is to do the same from the Plan 9 workstation that I
> still prefer for development. I was bemoaning this in some notes to
> myself just before reading the exchange.
> 
> Now, it is very common, even after all these years of Plan 9 use, for
> me to miss the wood for the trees. I think, not very deeply, that P9P
> "cpu" running on the remote Posix server might be what I need - Plan 9
> SSH and I seem to be sworn enemies and X-fdorwarding is not even a
> twinkle in SSH's eye - and here I note that Steve Simon's cpu server
> for Windows has not been included in P9P (I heard Steve bring that up,
> but I have never explored it as I don't own a Windows platform).
> 
> In short, is it out of the question to cpu into a Posix server to
> initiate an acme session, rather than using SSH to forward X?
> 
> Lucio.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M6851a6eec7243162cd9dc1d7
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-18 Thread Lucio De Re
On 7/19/21, adr via 9fans <9fans@9fans.net> wrote:
> [ ...].  Running samterm locally is way more efficient than
> using X forwarding.
>
I have adopted on my Linux (Mint) workstations - plural - the paradigm:

ssh -fX remote acme -l lib/task.acme # for different tasks

and it works even remotely pretty adequately. The remotes tend to be
pretty slick Debian servers, but even locally that is a  boon (NetBSD
rules the Posix roost in my office).

What I can't do is to do the same from the Plan 9 workstation that I
still prefer for development. I was bemoaning this in some notes to
myself just before reading the exchange.

Now, it is very common, even after all these years of Plan 9 use, for
me to miss the wood for the trees. I think, not very deeply, that P9P
"cpu" running on the remote Posix server might be what I need - Plan 9
SSH and I seem to be sworn enemies and X-fdorwarding is not even a
twinkle in SSH's eye - and here I note that Steve Simon's cpu server
for Windows has not been included in P9P (I heard Steve bring that up,
but I have never explored it as I don't own a Windows platform).

In short, is it out of the question to cpu into a Posix server to
initiate an acme session, rather than using SSH to forward X?

Lucio.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M980f0728c312f6f6ca5623f2
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription