From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Executing org shell blocks on remote machine over ssh Date: Tue, 18 Nov 2014 15:55:52 +0000 Message-ID: References: <874mtxx18q.fsf@duke.edu> <87egt1xwkl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xql8X-0001NO-5E for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 10:56:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xql8M-0006Yf-KY for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 10:56:13 -0500 Received: from plane.gmane.org ([80.91.229.3]:44174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xql8M-0006W4-Ej for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 10:56:02 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xql8J-000075-Kl for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 16:55:59 +0100 Received: from 193.63.220.190 ([193.63.220.190]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Nov 2014 16:55:59 +0100 Received: from andreas.leha by 193.63.220.190 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Nov 2014 16:55:59 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Myles, Myles English writes: > Hi Dave, > > David Bjergaard writes: > >> Hi All, >> >> I'm sorry if this has been covered before, I've been searching for a >> while and haven't found anything. >> >> I use org mode as a lab notebook. I write org-src blocks to keep track >> of tasks I do at the command line, and then I copy paste them into the >> terminal. I would really like to hit "C-c C-c" on the source block and >> have it executed on the remote machine. I know that you can specify >> the remote machine according to [1], however the software I use requires >> a fairly complicated setup to get going. >> >> Ideally what I would have is my org-src blocks and another window with >> the ssh terminal open. Then hitting "C-c C-c" would execute the block >> over a shared ssh connection and I could see the results in the other >> window (quasi-interactively). Is that possible? >> >> Thanks for your time! >> >> Dave >> >> Footnotes: >> [1] http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html#sec-16 > > I had a quick go at this but get tramp errors. I think you need a > terminal multiplexer e.g. tmux or screen. > > In a terminal, connect using ssh (or mosh) then type 'tmux' to start a > new session or 'tmux attach' to attach to an existing one. > > I would have thought that this should have worked, i.e. that the output > would have showed up in the terminal and in the buffer: > > #+BEGIN_SRC sh :prologue "tmux attach" :dir /myles@myhost.biz > echo $PWD > echo $HOSTNAME > #+END_SRC > > Hope this is on the right track.. I hope so, too, because I would be very interested in that, i.e. running stuff from orgmode within a (remote or not remote) tmux session. I do not have time to play with this right now, but I think, the prologue should not be 'tmux attach' but rather something along 'tmux paste-buffer' Best, Andreas