Host myhost
Hostname example.com
User me
ProxyCommand ssh -q -x me@proxy.com -W %h:22
then connect to myhost
with SshMachine
from plumbum.cmd import aws, tee, mkfifo, rm, pigz, rg
from plumbum import BG
mkfifo['pipe1']()
mkfifo['pipe2']()
mkfifo['pipe3']()
p = ((
aws['s3', 'cp', 's3://some/huge-file', '-'] |
pigz['-dc'] |
tee['pipe1', 'pipe2', 'pipe3']
) > "/dev/null") & BG
processes = []
processes.append(((rg['microsoft'] < "pipe1") > 'microsoft') & BG)
processes.append(((rg['apple'] < "pipe2") > 'apple') & BG)
processes.append(((rg['google'] < "pipe3") > 'google') & BG)
p.wait()
for sub in processes:
sub.wait()
rm['pipe1', 'pipe2', 'pipe3']()
pip install python
.
conda install -c conda-forge plumbum
instead (only benefit there is that you get Paramiko, which is a nice ssh library). If you don’t have sudo, then pip install --user plumbum
will install it for all Pythons but only the current user, and if you are in a virtual environment… :)
local['type']
fails with CommandNotFound
. i understand that this is because type
is a bash builtin, and has no corresponding executable. so my question is: is there a way to do shell builtins with plumbum? i.e. something that'll just do the equivalent of subprocess.run(['type', ...], shell=True, ...)
without trying to locate the (non-existent) binary?