adamant-kite-43734
06/23/2022, 5:55 PMfast-garage-66093
06/23/2022, 5:58 PMhundreds-crowd-93261
06/23/2022, 6:00 PMhundreds-crowd-93261
06/23/2022, 6:00 PMfast-garage-66093
06/23/2022, 6:01 PMlima.yaml file and then copy the arguments for show-ssh into your proxy command?hundreds-crowd-93261
06/23/2022, 6:11 PMhundreds-crowd-93261
06/23/2022, 6:12 PMsh -c "$(/opt/homebrew/bin/limactl show-ssh docker)"
works in my shell, but this doesn’t: `~/.ssh/config`:
host docker
ProxyCommand sh -c "$(/opt/homebrew/bin/limactl show-ssh %h)"
ssh -v docker
Pseudo-terminal will not be allocated because stdin is not a terminal.
-bash: line 1: $'SSH-2.0-OpenSSH_8.6\r': command not foundfast-garage-66093
06/23/2022, 6:19 PMbin/wrapper directory at the very front of my PATH that modifies existing commands. A trivial example is always adding --mmap to the ag command:
#!/bin/bash
set - --mmap "$@"
exec $(type -a -P $(basename $BASH_SOURCE) | grep -v $BASH_SOURCE | head -1) "$@"fast-garage-66093
06/23/2022, 6:20 PMssh, add some heuristics to determine the host name your are connecting to, and if it matches your lima VM name, modify $@ as necessary, or set additional environment variables or whatever.fast-garage-66093
06/23/2022, 6:21 PMkubectl wrapper that adds AWS secrets to the environment when the kubeconfig includes aws commands:
$ cat kubectl
#!/bin/bash
kubeconfig="${KUBECONFIG}"
if [ -z "${kubeconfig}" ]; then
kubeconfig=$HOME/.kube/config
fi
if [ -r "${kubeconfig}" ]; then
if grep -q "command: aws" "${kubeconfig}"; then
export AWS_ACCESS_KEY_ID=$(kc-env get AWS_ACCESS_KEY_SPLATFORM)
export AWS_SECRET_ACCESS_KEY=$(kc-env get AWS_SECRET_KEY_SPLATFORM)
fi
fi
exec $(type -a -p $(basename $BASH_SOURCE) | grep -v $BASH_SOURCE | head -1) "$@"fast-garage-66093
06/23/2022, 6:22 PMfast-garage-66093
06/23/2022, 6:26 PMPATH. I should have used the "Manual" config option. 😄
$ type -a -p kubectl
/Users/jan/.rd/bin/kubectl
/Users/jan/Dropbox/bin/wrapper/kubectl
/usr/local/bin/kubectlhundreds-crowd-93261
06/23/2022, 6:27 PMhundreds-crowd-93261
06/23/2022, 6:27 PMhost docker
ProxyCommand sh -c "$(limactl show-ssh %h) nc 127.0.0.1 22"hundreds-crowd-93261
06/23/2022, 6:29 PMfast-garage-66093
06/23/2022, 6:30 PMhundreds-crowd-93261
06/23/2022, 6:31 PMhundreds-crowd-93261
06/23/2022, 6:32 PMfast-garage-66093
06/23/2022, 6:33 PMsudo is the root cause 😄hundreds-crowd-93261
06/23/2022, 8:57 PMHost docker
ProxyCommand limactl shell %h nc 127.0.0.1 22hundreds-crowd-93261
06/23/2022, 9:04 PM# match lima VM names and use limactl to ssh to them
Match exec "limactl list -q | grep -q '%h'"
ProxyCommand limactl shell %h nc 127.0.0.1 22