From mboxrd@z Thu Jan 1 00:00:00 1970 From: "darcamo@gmail.com" Subject: Re: markup text with leading, trailing spaces Date: Sat, 14 Feb 2015 17:19:24 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113306be05472a050f0f8e15 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMgNP-0004Kx-UP for emacs-orgmode@gnu.org; Sat, 14 Feb 2015 12:19:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMgNK-0003lt-2m for emacs-orgmode@gnu.org; Sat, 14 Feb 2015 12:19:31 -0500 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]:38439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMgNJ-0003lg-SS for emacs-orgmode@gnu.org; Sat, 14 Feb 2015 12:19:26 -0500 Received: by mail-ob0-f175.google.com with SMTP id va2so30286316obc.6 for ; Sat, 14 Feb 2015 09:19:25 -0800 (PST) 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: hymie! , emacs-orgmode@gnu.org --001a113306be05472a050f0f8e15 Content-Type: text/plain; charset=UTF-8 Even if you want to run commands in a different computer you can do that with "C-c C-c" thanks to the ":dir folder" header argument and tramp. As an example, suppose I have the code block below #+begin_src sh hostname #+end_src If I run it I get something like #+RESULTS: : my_computer_name However, if if I can ssh to a server called "myserver" I can change the code block to #+begin_src sh :dir /myserver:~/ hostname #+end_src Now if I run the code block the code is executed in myserver and I get #+RESULTS: : myserver_host_name Combine this with "C-c C-v b" (org-babel-execute-buffer) and you can easily run many different commands in different machines. It is really great. Em Sat Feb 14 2015 at 01:09:02, hymie! escreveu: In our last episode, the evil Dr. Lacto had captured our hero, > jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo), who said: > >hymie! writes: > > > >> I'd like to be able to have a series of commands in my raw org > >> file that I can copy-n-paste into my shell window. But I also > >> like to export my org files to HTML so that I can make ePubs and > >> keep them in my iPad. > > > >> And this > >> > >> #+BEGIN_SRC > >> command1 > >> command2 > >> command3 > >> #+END_SRC > >> > >> is just IMO ugly. > > > >It shouldn't be. Try adding the word "shell" after BEGIN_SRC, so > >that it fontifies the code correctly (the variable > >org-src-fontify-natively should be set to t, but that has been > >default for a while) > > It's not that the font is ugly. It's that > * (in the epub) the source code appears in a box > * (in the html/epub) it's impossible to tell the difference between two > different commands and a single command that was too long and word wrapped > to fit in the box > * (in the html/epub) I can't have non-monospace comments between/attached > to/within the code without drawing four or five separate boxes around my > code > * (in the org file) For whatever reason, monospace code appears as a > light-gray font, which is hard to read against a white background. I'm > sure that can be changed, but I haven't had time to figure it out yet. > > >Also, add shell to the loaded babel > >languages, so that you can execute the code and get the results > >right away in org: > > > >No need for "copy-n-paste", just do C-c C-c where you have your > >commands. > > I think you are making the incorrect assumption that the machine on > which I maintain my Org files is the same machine that I wish to execute > commands on. > > >Try copying this example into an org file, it should fontify it > >nicely, both in the org file and in the html exported. > > If my commnds were all 8 characters long or less, it would be fine. > Some of my commands look like this: > > adduser username -d /data/chroot/home/username -s /usr/bin/rssh -m -k > /dev/null -g rssh > > useradd -U -G wheel -p '$6$wcMRrkcdGeNHLT5c$0s4qezb00ISmGZSsILOyV/ > WJn3RnuZPkSEknwoSZ22HvbgkBTe4TQwCz/mpG.3zby.1Jwnmtsq1B.uCbyg5l./' username > > pssh -x '-q -t -t' -I -i --hosts hosts_linux_rhel6 'sudo -S wget > puppet/puppet/pub/system_patch.pl -O /usr/local/bin/system_patch.pl' < > hostnamefile > > While I admit that the "useradd" command is an extreme example, > this becomes horribly ambiguous: > > adduser username -d /data/chroot/home/username -s > /usr/bin/rssh -m -k /dev/null -g rssh > pssh -x '-q -t -t' -I -i --hosts hosts_linux_rhel6 > 'sudo -S wget puppet/puppet/pub/system_patch.pl -O > /usr/local/bin/system_patch.pl' < hostnamefile > > --hymie! http://lactose.homelinux.net/~hymie > hymie@lactose.homelinux.net > > > --001a113306be05472a050f0f8e15 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Even if you want to run commands in a different computer y= ou can do that with "C-c C-c" thanks to the ":dir folder&quo= t; header argument and tramp.

As an example, suppose= I have the code block below

#+begin_src sh
=C2=A0 hostname
#+end_src

If I = run it I get something like

#+RESULTS:
:= my_computer_name

However, if if I can ssh t= o a server called "myserver" I can change the code block to
=

#+begin_src sh :dir /myserver:~/
=C2=A0 = hostname
#+end_src

Now if I run th= e code block the code is executed in myserver and I get

#+RESULTS:
: myserver_host_name

Combine this with "C-c C-v b" (org-babel-execute-buffer)= and you can easily run many different commands in different machines. It i= s really great.

Em Sat Feb 14 2015 at 0= 1:09:02, hymie! <hymie@lactose.homelinux.net> escreveu:

In our last episode, th= e evil Dr. Lacto had captured our hero,
=C2=A0 j= orge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo), who said:
>hymie! writes:
>
>> I'd like to be able to have a series of commands in my raw org=
>> file that I can copy-n-paste into my shell window.=C2=A0 But I als= o
>> like to export my org files to HTML so that I can make ePubs and >> keep them in my iPad.
>
>> And this
>>
>> #+BEGIN_SRC
>>=C2=A0 =C2=A0command1
>>=C2=A0 =C2=A0command2
>>=C2=A0 =C2=A0command3
>> #+END_SRC
>>
>> is just IMO ugly.
>
>It shouldn't be. Try adding the word "shell" after BEGIN_= SRC, so
>that it fontifies the code correctly (the variable
>org-src-fontify-natively should be set to t, but that has been
>default for a while)

It's not that the font is ugly.=C2=A0 It's that
* (in the epub) the source code appears in a box
* (in the html/epub) it's impossible to tell the difference between two=
different commands and a single command that was too long and word wrapped<= br> to fit in the box
* (in the html/epub) I can't have non-monospace comments between/attach= ed
to/within the code without drawing four or five separate boxes around my co= de
* (in the org file) For whatever reason, monospace code appears as a
light-gray font, which is hard to read against a white background.=C2=A0 I&= #39;m
sure that can be changed, but I haven't had time to figure it out yet.<= br>
>Also, add shell to the loaded babel
>languages, so that you can execute the code and get the results
>right away in org:
>
>No need for "copy-n-paste", just do C-c C-c where you have yo= ur
>commands.

I think you are making the incorrect assumption that the machine on
which I maintain my Org files is the same machine that I wish to execute commands on.

>Try copying this example into an org file, it should fontify it
>nicely, both in the org file and in the html exported.

If my commnds were all 8 characters long or less, it would be fine.
Some of my commands look like this:

adduser username -d /data/chroot/home/username -s /usr/bin/rssh -m -k /dev/= null -g rssh

useradd -U -G wheel -p '$6$wcMRrkcdGeNHLT5c$0s4qezb00ISmG= ZSsILOyV/WJn3RnuZPkSEknwoSZ22HvbgkBTe4TQwCz/mpG.3zby.<= u>1Jwnmtsq1B.uCbyg5l./' username

pssh -x '-q -t -t' -I -i --hosts hosts_linux_rhel6 'sudo -S wge= t puppet/puppet/pub/sy= stem_patch.pl -O /usr/local/bin/system_patch.pl' < hos= tnamefile

While I admit that the "useradd" command is an extreme example, this becomes horribly ambiguous:

adduser username -d /data/chroot/home/username -s
/usr/bin/rssh -m -k /dev/null -g rssh
pssh -x '-q -t -t' -I -i --hosts hosts_linux_rhel6
'sudo -S wget puppet/puppet/pub/system_patch.pl -O
/usr/local/bin/system_= patch.pl' < hostnamefile

--hymie!=C2=A0 =C2=A0 http://lactose.homelinux.net/~hymie=C2=A0 = =C2=A0 hym= ie@lactose.homelinux.net


--001a113306be05472a050f0f8e15--