Skip to content

Instantly share code, notes, and snippets.

@ieure
Created July 1, 2010 00:02
Show Gist options
  • Save ieure/459380 to your computer and use it in GitHub Desktop.
Save ieure/459380 to your computer and use it in GitHub Desktop.
(defvar ssh-connection-alist
'((shortname . "hostname.fqdn.com")
)
"Alist of SSH connections.
Format is ((NAME . HOSTSPEC) …)")
(defun ssh-convenience ()
"Make SSH convenience functions."
(interactive)
(mapcar (lambda (conn)
(let ((name (symbol-name (car conn)))
(host (cdr conn)))
(fset (intern name)
`(lambda nil
,(format "Connect to %s SSH preset." name)
(interactive)
(ssh ,host)))))
ssh-connection-alist))
(ssh-convenience)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment