[go-nuts] Re: How to capture the bytes of stdin

2021-08-19 Thread hyogy hyogy
Thanks for your suggestin!(: Can you make an example here? https://play.golang.org/ Just to make the big picture more clear, this is what I'm trying to achieve: shell sends bytes on stdout, stderr —> Go tool does rot13 encode —> socat does rot13 decode --> ncat server // this part is fine nc

Re: [go-nuts] Re: Why do I get multiple times the same data?

2021-08-18 Thread hyogy hyogy
29, 2021 at 11:41 AM hyogy hyogy wrote: > >> I am more and more convinced that *io.Copy(&fub, &q)* is the problem >> >> Il giorno mercoledì 28 luglio 2021 alle 17:11:40 UTC+2 hyogy hyogy ha >> scritto: >> >>> I have recently added a ROT13 logic t

[go-nuts] How to capture the bytes of stdin

2021-08-18 Thread hyogy hyogy
The goal: I want to capture all the bytes of *cmd.Stdin* and process them with this rot13 function: https://play.golang.org/p/VX2pwaIqhmT The story: I'm coding a small tool which will be cross compiled for both win/ linux, so I'm trying to make it as simple as possible. This tool connects to

[go-nuts] Re: Why do I get multiple times the same data?

2021-07-29 Thread hyogy hyogy
I am more and more convinced that *io.Copy(&fub, &q)* is the problem Il giorno mercoledì 28 luglio 2021 alle 17:11:40 UTC+2 hyogy hyogy ha scritto: > I have recently added a ROT13 logic to a tool of mine. > This tool connects to a server, from which I run commands on the client. &

[go-nuts] Why do I get multiple times the same data?

2021-07-28 Thread hyogy hyogy
I have recently added a ROT13 logic to a tool of mine. This tool connects to a server, from which I run commands on the client. Here is the code PRE-ROT13: https://play.golang.org/p/DAE4cLq3RSx Everything works like a charm. Here is the code POST-ROR13. The difference between them is underlined h

[go-nuts] How to pick a random number every time from a list

2021-07-27 Thread hyogy hyogy
The goal: pick a random number from a list every time a chunk is generated Python code example to make it more clear. I have this list: ``` listbytes = [87, 88, 89, 90] ``` And this function which splits the data: ``` def chunks(lst, n): "Yield successive chunks from lst, where n is a list of