Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Eduardo Ochs <eduardoochs-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: manpages from remote machines
Newsgroups: gmane.emacs.eev.devel
Date: Saturday 12th April 2008 11:00:41 UTC (over 9 years ago)
Hi Xavier,

> Is there an easy way to the equivalent (find-man "blah") remotely
> instead of the current machine ?
>
> For the e-script needs I mentionned earlier, I typed my commands
> through eepitch-shell on a HP-UX commands which had different
> commands than the one I am using here.
>
> For example, (find-man "newfs") could not work on my notebook
> whereas it could have been on the remote host.

You can use something like this...

  (defun find-netbsdman (manpage &rest rest)
    (let ((buffername (format "*netbsdman: %s*" manpage))
          (format-string "ssh [email protected] \"sh -c 'PAGER=cat man %s'\"")
          (command (format format-string manpage)))
      (apply 'find-eoutput-reuse
             buffername
             `(progn (insert (find-sh0 ,command))
                     (Man-fontify-manpage))
             rest)))

Note that the name of the remote machine is fixed ("caramelo"),
and that you will need to be able to run commands on the remote
mahine using ssh without it asking for a password... this is what
I use to make ssh copy the adequate authorization keys:

  # (find-man "1 ssh-copy-id")
  # (find-man "1 ssh")
  # (find-fline "~/.ssh/")
  # (find-sh "locate ssh-copy-id")
  # (find-fline "/usr/bin/ssh-copy-id")
  ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
  ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

And here are some definitions to make it easier to access files on
remote machines (here for dekooning, not for caramelo):

  ;; (find-dekooningfile "")
  (code-c-d "dekooning" "/scp:[email protected]:/home/edrx/")

  (defun eepitch-dekooning () (interactive)
    (eepitch '(find-comintprocess "dekooning" "ssh [email protected]")))
  (defun eexterm-dekooning ()
    (eexterm "dekooning" "ssh [email protected]"))

  ;; (find-node "(tramp)Password caching" "`password-cache-expiry'")
  (setq password-cache-expiry nil)

A subtlety: tramp doesn't like my default zsh prompt, so I
created a second login ("edrxbash") on dekooning with the same
uid and gid as "edrx"...

  Cheers,
    Edrx
 
CD: 3ms