by olooney · 4y ago · 0 comments
exodus jq | ssh my-server
locally, and then immediately have access to jq on the server. I personally find it very useful when working with servers or containers that have limited package repositories or where I don't have root access.That's really neat.
Exodus – relocation of Linux binaries–and all of their deps–without containers
https://news.ycombinator.com/item?id=29446297
(307 points, 65 comments)
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.
Then again, why not scp the file to local? Bandwidth usage isn’t good for the environment.
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 cat big.json | python3 -m json.tool
or python3 -m json.tool big.jsonI am confused by this sentence. Wasn't the entire premise that js is NOT installed?
https://stackoverflow.com/a/70614580/1507124
it's not full pretty, rather just newline delimits arrays. Incidentally, it's much faster than jq. Probably wouldn't use it for anything serious