summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2017-01-12 14:04:20 -0800
committerFranck Cuny <franck.cuny@gmail.com>2017-01-12 14:04:20 -0800
commiteee08eb7b3c7cfade840c24a16377cf71e654c00 (patch)
treebecaba7817053df806a99852e897684bf5a5d4d9
parent[bin] Add a few more targets for my twitter tools. (diff)
downloademacs.d-eee08eb7b3c7cfade840c24a16377cf71e654c00.tar.gz
[Emacs] Add a few more functions to work with 'nest' hosts.
Add a function to open a dired buffer on a remote host, and a function
to do that for nest.

Also add a few functions to (un-)monitor hosts from Emacs.
-rw-r--r--emacs.d/lib/funcs.el25
1 files changed, 24 insertions, 1 deletions
diff --git a/emacs.d/lib/funcs.el b/emacs.d/lib/funcs.el
index 0714888..bb7d211 100644
--- a/emacs.d/lib/funcs.el
+++ b/emacs.d/lib/funcs.el
@@ -90,6 +90,29 @@ Visit the file after creation."
 (defun fc/start-nest-tmp-file (file-name)
   "Create a file in ~/tmp on nest for the give file name."
   (interactive "sName of the temporary file: ")
-  (fc/start--file (expand-file-name (format "/nest:~/tmp/%s" file-name))))
+  (fc/start--file (expand-file-name (format "/nest.smfc.twitter.com:~/tmp/%s" file-name))))
+
+;; open dired buffer with tramp on remote host
+(defun fc/remote--dired (host)
+  "Open dired on a remote host."
+  (dired (concat "/" host ":")))
+
+(defun fc/remote-nest-dired ()
+  "Open dired on nest."
+  (interactive)
+  (fc/remote--dired "nest.smfc.twitter.com"))
+
+;; un/monitor hosts by running mth remotely
+(defun fc/silence-host (host)
+  (interactive "sHostname: ")
+  (let ((default-directory "/ssh:nest.smfc.twitter.com:"))
+    (start-file-process "mth" (get-buffer-create "*mth*")
+                        "/usr/local/bin/mth" "silence" host "99 years")))
+
+(defun fc/unsilence-host (host)
+  (interactive "sHostname: ")
+  (let ((default-directory "/ssh:nest.smfc.twitter.com:"))
+    (start-file-process "mth" (get-buffer-create "*mth*")
+                        "/usr/local/bin/mth" "unsilence" host)))
 
 (provide 'funcs)