News for hackers. Stuff that matters.
Re:Jqjq: Jq Implementation of Jq by ilyt on Friday November 25, 2022 @10:24AM (#33743175)
Joking aside

    ssh badly-managed-server cat file | jq .
Problem solved !

I actually made a wrapper that just guesses (based on which parser returns error basically) type of serializing and then displays it nicely.

Re:Jqjq: Jq Implementation of Jq by eurasiantiger on Friday November 25, 2022 @05:38PM (#33747604)
Thanks for this. The pattern is useful for much more and sure beats pushing ad-hoc 3rd-party-relinked binaries to production containers.

Then again, why not scp the file to local? Bandwidth usage isn’t good for the environment.

Re:Jqjq: Jq Implementation of Jq by TheReveller on Friday November 25, 2022 @09:24PM (#33749240)
Why stop at one file, is it possible to locally mount a remote folder over ssh?
Re:Jqjq: Jq Implementation of Jq by Too on Saturday November 26, 2022 @01:07AM (#33750402)
Yep, it's called sshfs, very easy to use.
Re:Jqjq: Jq Implementation of Jq by ilyt on Saturday November 26, 2022 @03:57PM (#33756652)
here is function I use

    sshmount () {
     SSHFS_SERVER_DIR='/home/user' 
     if [ "z$1" = "z" ]
     then
      echo "specify server [server_dir]"
      return
     fi
     SSHFS_SERVER=$1 
     if [ "z$2" != "z" ]
     then
      SSHFS_SERVER_DIR=$2 
     fi
     SSHFS_TARGET_DIR="/home/user/mnt/$SSHFS_SERVER" 
     echo "Mounting $SSHFS_SERVER:$SSHFS_SERVER_DIR into $SSHFS_TARGET_DIR"
     mkdir -p $SSHFS_TARGET_DIR
     sshfs -o idmap=user -o allow_other -o kernel_cache $SSHFS_SERVER:$SSHFS_SERVER_DIR $SSHFS_TARGET_DIR && cd $SSHFS_TARGET_DIR
    }
    
    sshmount servername
will mount server's home in directory /home/user/mnt/servername, second parameter changes the server dir to specified one