Fork me on GitHub
#off-topic
<
2022-02-06
>
Benjamin09:02:54

Did somebody ever ssh tunnel into a windows host and make port forwarding work so they could connect to a nrepl server? (the -L option for ssh)

Benjamin09:02:24

debug1: Connection to port 7001 forwarding to 192.168.178.22 port 7001 requested.
debug2: fd 9 setting TCP_NODELAY
debug2: fd 9 setting O_NONBLOCK
debug3: fd 9 is O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
debug3: send packet: type 90
debug3: receive packet: type 91
debug2: channel 3: open confirm rwindow 2097152 rmax 32768
debug3: receive packet: type 96
debug2: channel 3: rcvd eof
debug2: channel 3: output open -> drain
debug2: channel 3: obuf empty
debug2: chan_shutdown_write: channel 3: (i0 o1 sock 9 wfd 9 efd -1 [closed])
debug2: channel 3: output drain -> closed
debug3: receive packet: type 97
debug2: channel 3: rcvd close
debug2: chan_shutdown_read: channel 3: (i0 o3 sock 9 wfd 9 efd -1 [closed])
debug2: channel 3: input open -> closed
debug3: channel 3: will not send data after close
debug2: channel 3: send close
debug3: send packet: type 97
debug2: channel 3: is dead
debug2: channel 3: garbage collecting
debug1: channel 3: free: direct-tcpip: listening port 7001 for 192.168.178.22 port 7001, connect from 127.0.0.1 port 44710 to 127.0.0.1 port 7001, nchannels 4
debug3: channel 3: status: The following connections are open:
  #2 client-session (t4 r0 i0/0 o0/0 e[write]/0 fd 6/7/8 sock -1 cc -1)
  #3 direct-tcpip: listening port 7001 for 192.168.178.22 port 7001, connect from 127.0.0.1 port 44710 to 127.0.0.1 port 7001 (t4 r1 i3/0 o3/0 e[closed]/0 fd 9/9/-1 sock 9 cc -1)
On the windows host I have sshd_config:
AllowStreamLocalForwarding yes
AllowTcpForwarding local
that's all basically. ssh already works just when it tries to forward the port or something there is something missing.

borkdude09:02:46

I am doing this via WSL2. I run the ssh daemon in there and then open the ports in the Windows firewall

borkdude09:02:11

If I need Windows access, then I simply open cmd.exe or powershell in the WSL2 session

Benjamin10:02:49

ah that sounds a little bit more pain free thanks bro bork

Dumch20:06:46

Is it true that with WSL you will not be able to use Windows-related APIs (like Microsoft Active Accessibility and UI Automation)? I also attempted to connect to a nrepl that runs in powershell but was unsuccessful.

Dumch14:06:27

I just found out that if you forward port this way:

ssh -L7777:localhost:7777 ...
it doesnt work, but if you do it this way, it works:
ssh -L7777:127.0.0.1:7777 ...

Ben Sless10:02:18

I haven't seen this shared here yet, pretty incredible https://github.com/Kindelia/HVM

p-himik11:02:05

I understand pretty much nothing in the relevant domains, but this section mentions something curious: https://github.com/Kindelia/HVM#composition-optimal > In general, if the composition of a function `f` has a constant-size normal form, then `f^(2^N)(x)` is linear-time (`O(N)`) on HVM, and exponential-time (`O(2^N)`) on GHC. Assuming I read it correctly - why is a composition of 2^N functions takes just O(N) time on HVM? The words "function f has a constant-size normal form" are probably important. Is there an ELI5 possible here? Cursory googling suggests I have to know 15 other things in order to understand that.

p-himik11:02:13

Alright, the very first image at https://github.com/Kindelia/HVM/blob/master/HOW.md explains everything. XD

Ben Sless11:02:36

I tried to go read the literature behind it

Ben Sless12:02:47

I think it has to do with f having a constant size normal form, but we'll have to go through the reduction rules to see what turns out

p-himik12:02:30

Sorry, couldn't resist. :) Yeah, I'll write off this loss, for now. Despite that quote that's commonly attributed to Einstein, I don't think that all areas can be explained simply or to six year olds.

😆 5
Ben Sless12:02:05

It's between Hieroglyphs and zodiac code

p-himik12:02:10

Right, I was thinking of attempting to read that document in order, skipping parts that I can't understand right now. Thanks!

Ben Sless12:02:31

I've been eyeing it for the past few days since it popped up on HN, and I mostly feel like a protagonist in a Lovecraft story

p-himik12:02:33

Ah, I was under the impression you have already grasped it all. :D Right, the potential implications do make even me want to finish that story.

Ben Sless12:02:03

you'll know I got it when I set my pfp to

p-himik12:02:47

:D Looking forward!