From a1adb92d79b24cd3351fb3ade01fd70986c988b1 Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Wed, 25 Nov 2020 17:36:08 -0500 Subject: ox-ssh: add more examples, fix some typos --- content/posts/WIP-org-ssh-export/index.org | 84 +++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 20 deletions(-) (limited to 'content') diff --git a/content/posts/WIP-org-ssh-export/index.org b/content/posts/WIP-org-ssh-export/index.org index 719fab0..f08e47f 100644 --- a/content/posts/WIP-org-ssh-export/index.org +++ b/content/posts/WIP-org-ssh-export/index.org @@ -9,22 +9,22 @@ I manage a lot of servers. Some are serving static content like this blog, with others running services like [[https://nextcloud.com/][Nextcloud]], [[https://wiki.znc.in/ZNC][ZNC]], [[https://shadowsocks.org/en/index.html][Shadowsocks]], -or [[https://www.mumble.info/][Mumble]]. I have one or two game servers to play with my family and -friends. These are spread across two providers because for cost and +or [[https://www.mumble.info/][Mumble]]. I also have one or two game servers to play with my family +and friends. These are spread across two providers for cost and geographic reasons. -I also have several machines running in my house, one running FreeNAS -with some jails, another running Proxmox with several VMs and +In addition, I have several machines running in my house, one running +[[https://www.freenas.org/][FreeNAS]] with some jails, another running [[https://www.proxmox.com/en/][Proxmox]] with several VMs and containers. I also have a couple smaller single board PCs like Raspberry Pis scattered around. Needless to say, I've got a lot to keep track of. I tried using a -couple methods of keeping track of what I had running where, the user -names, IP addresses, and links. I also had to worry about making sure -my =~/.ssh/config= file was always up to date with VMs and containers -I create. +couple methods of keeping inventory of what I had running where, the +user names, IP addresses, and links. I also had to worry about making +sure my =~/.ssh/config= file was always up to date with VMs and +containers I create. -I'd already been playing with the idea of using an org-mode file to +I'd already been playing with the idea of using an [[https://orgmode.org/][org mode]] file to keep track of servers with VMs and containers, as it seemed like that would fit well with the hierarchical structure of org files. @@ -49,17 +49,17 @@ the host machine. ,*** web-jail #+END_SRC -Each machine gets a billet point list of what's running on it, with -the text as a link if they're something I can open in-browser. That -would be things like static content and web interfaces. I also write -details about services underneath their bullet points if I have more -details I want to remember. +Each machine gets a bullet point list of what's running on it. For +services with web interfaces, I add a link with the name of the +service to the list, so I can click it to open it in my browser. I +also write details about services underneath their bullet points if I +there's more I want to remember. #+BEGIN_SRC org ,* Vultr ,** example.com - Minecraft - =/home/minecraft/survival= + Save directory: =/home/minecraft/survival= Port 4587 - [[https://example.com][nginx]] - [[https://example.com:8080/][znc]] @@ -77,9 +77,53 @@ servers like anything else in org-mode, adding [[https://orgmode.org/manual/Tags [[https://orgmode.org/manual/Working-with-Source-Code.html#Working-with-Source-Code][code blocks]], [[https://orgmode.org/manual/Hyperlinks.html#Hyperlinks][hyperlinks]], [[https://orgmode.org/manual/Tables.html#Tables][tables]], [[https://orgmode.org/manual/Attachments.html#Attachments][attachments]], putting details in [[https://orgmode.org/manual/Drawers.html#Drawers][drawers]], etc. +#+begin_src org +,* home +,** proxmox + :PROPERTIES: + :IP: 192.168.0.6 + :SSH_USER: dante + :OS: Proxmox-VE + :END: + - [[https://192.168.0.6:8006][WebUI]] + +,*** VMs +,**** openindiana + :PROPERTIES: + :OS: OpenIndiana + :IP: 192.168.0.11 + :SSH_USER: dante + :END: + +,**** pfsense + :PROPERTIES: + :IP: 192.168.0.12 + :OS: FreeBSD + :SSH_USER: admin + :END: + - [[https://192.168.0.12][WebUI]] + +,*** Containers +,**** pihole + :PROPERTIES: + :IP: 192.168.0.21 + :OS: Debian + :SSH_USER: pi + :END: + [[http://192.168.0.23/admin/][WebUI]] + +,**** test + :PROPERTIES: + :IP: 192.168.0.22 + :OS: Debian + :SSH_USER: dante + :END: + +#+end_src + Finally to keep my SSH config up to date, I wrote [[https://github.com/dantecatalfamo/ox-ssh][ox-ssh]]. A backend -for org-mode that lets you export your buffer as an SSH configuration -file. It takes all of the properties from the server headings and -turns them into entries in a configuration file. It [[https://github.com/dantecatalfamo/ox-ssh#usage][supports]] every -client configuration option OpenSSH has, so I can maintain my entire -SSH client list from within my org-mode file. +for the org mode [[https://orgmode.org/manual/Exporting.html][export engine]] that lets you export your buffer as an +SSH configuration file. It takes all of the properties from the server +headings and turns them into entries in a configuration file. It +[[https://github.com/dantecatalfamo/ox-ssh#usage][supports]] every client configuration option OpenSSH has, so I can +maintain my entire SSH client list from within my org mode file. -- cgit v1.2.3