From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: Executing org shell blocks on remote machine over ssh Date: Mon, 17 Nov 2014 22:50:54 +0000 Message-ID: <87egt1xwkl.fsf@gmail.com> References: <874mtxx18q.fsf@duke.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqVGw-0004Bh-87 for emacs-orgmode@gnu.org; Mon, 17 Nov 2014 17:59:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqVGq-0003tW-4e for emacs-orgmode@gnu.org; Mon, 17 Nov 2014 17:59:50 -0500 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:59864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqVGp-0003sL-Rg for emacs-orgmode@gnu.org; Mon, 17 Nov 2014 17:59:44 -0500 Received: by mail-wg0-f44.google.com with SMTP id x12so26140510wgg.17 for ; Mon, 17 Nov 2014 14:59:42 -0800 (PST) In-reply-to: <874mtxx18q.fsf@duke.edu> 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: David Bjergaard Cc: emacs-orgmode@gnu.org 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.. Myles