I use this in emacs to connect and execute commands remotely:
#+BEGIN_SRC sh :dir /ssh:app_user@34.143.149.84:/tmp
pwd
#+END_SRC
#+RESULTS:
: /tmp
Recently, people have gone "cloud scaling" so the IP address 34.143.149.84 changes often.
The IP address can be determined by this bash:
sentinel list staging | grep InService | ruby -ne '$_=~/\A (.*?) /; puts $1' | tail -n 1
How can I modify the header
+BEGIN_SRC sh :dir /ssh:app_user@34.143.149.84:/tmp
to dynamically determine the IP address.