From e451437557c66e3ac163c665008abfccbe2ab564 Mon Sep 17 00:00:00 2001 From: John Sebastian Peterson Date: Tue, 4 Feb 2025 08:58:33 +1100 Subject: [PATCH] add ssh-mosh wrapper for gcloud compute ssh google-cloud-sdk/lib/googlecloudsdk/command_lib/util/ssh/ssh.py I have changed it from ssh to ssh-mosh invoke itnwith gcloud compute ssh a@u -- -XC I have a twenty four hours layover in Shanghai Pudong and need to connect to a Microsoft server in Korea IPsec server is a night mare to configure literally was disconnected a hundred times before I did this in desperation still doesn't work a complete side note you have to get Reddit to unblock Microsoft because Chinese people desperately need Reddit and Microsoft is the only thing their government has not blocked because they use it themselves thanks --- scripts/ssh-mosh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/ssh-mosh diff --git a/scripts/ssh-mosh b/scripts/ssh-mosh new file mode 100755 index 000000000..e20f4d8d8 --- /dev/null +++ b/scripts/ssh-mosh @@ -0,0 +1,28 @@ +#!/bin/env bash +# echo ssh-mosh $* + +val=() +pos=() +while [[ $# -gt 0 ]]; do + case $1 in + -*|--*) + val+=("$1") + shift + case $1 in + -*|--*) + continue;; + *) + val+=("$1") + shift;; + esac + ;; + *) + pos+=("$1") + shift;; + esac +done +# echo val ${val[*]} +# echo pos ${pos[*]} + +# echo mosh --ssh "ssh ${val[*]}" -- ${pos[*]} +mosh --ssh "ssh ${val[*]}" -- ${pos[*]}