hundreds-crowd-93261
06/23/2022, 5:55 PMssh $lima_vm
works directly? I’ve got an ssh alias, which calls my ssh binary that handles setting TERMINFO on the remote end (for Kitty terminal) and id like to have that functionality, but it’s cumbersome to eval "$(limactl show-ssh my-vm-name)"
fast-garage-66093
06/23/2022, 5:58 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 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 found
fast-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) "$@"
ssh
, 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.kubectl
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) "$@"
PATH
. 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/kubectl
hundreds-crowd-93261
06/23/2022, 6:27 PMhost docker
ProxyCommand sh -c "$(limactl show-ssh %h) nc 127.0.0.1 22"
fast-garage-66093
06/23/2022, 6:30 PMhundreds-crowd-93261
06/23/2022, 6:31 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 22
# 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