“Everything is a file” is what made me start understanding linux few years ago and from there it got easier to use with each new concept.

Still this was really revolutionary to me when I first heard it. Made a bunch of things just click.

  • Janet@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    13
    ·
    1 day ago

    it’s all fun and games until you want to use your mouse and keyboard inputs on another machine and also view the other machines screen contents. then all of a sudden stuff stops being a file. quaint.

    if only there was a way to share resources over a network…

    • FauxLiving@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      23 hours ago

      I’ve figured out how to control computers remotely and I’ll share the script:

      Client:

      #!/bin/bash
      PASSWORD="your_password_here"
      sshpass -p "$PASSWORD" scp /dev/stdin user@server:/path/to/cmd.txt <<< "$1"
      

      Server:

      #!/bin/bash
      while true; do
          while IFS= read -r line; do
              eval "$line"
          done < "cmd.txt"
          > "cmd.txt"
      done
      

      Just chmod 777 both files and run as root, ez.

      • mumblerfish@lemmy.world
        link
        fedilink
        arrow-up
        25
        ·
        1 day ago

        What do you mean? This

        remoteuser@server$ nc -l -p 4444 > /dev/input/event0
        
        
        localuser@laptop$ cat /dev/input/event0 | nc server 4444
        

        doesn’t work?

      • Janet@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        3
        ·
        1 day ago

        eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeew scoots faaaar away from you actually when writing the prior comment, i was thinking about the ease that is doing what i described on plan9, there everything is in fact a file, which you can simply mount via the 9p protocol

        what mumblerfish suggests looks interesting and i would have to read some the man page of “nc”, i suppose…