Skip to content

Commit

Permalink
add ssh-mosh wrapper for gcloud compute ssh
Browse files Browse the repository at this point in the history
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
  • Loading branch information
john-peterson committed Feb 3, 2025
1 parent 1105d48 commit 180520a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/ssh-mosh
Original file line number Diff line number Diff line change
@@ -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 --no-init --ssh "ssh ${val[*]}" -- ${pos[*]}

0 comments on commit 180520a

Please sign in to comment.