;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. #@44 The command we use for listing containers. (defconst lxc/list-command "sudo lxc-ls --fancy-format name,state,pid,ipv4 --fancy" (#$ . 87)) #@55 Make the list of containers using `lxc/list-command.' (defalias 'lxc/list #[nil "\302\303\304\305\306 !\307\"\"\310\311!\312\313!#)\207" [lxc/list-command cmd ->> -drop 2 split-string shell-command-to-string "\n" -filter #[(s) "G\301V\207" [s 0] 2] -map #[(s) "\301\302\303\304\"\"\207" [s -filter #[(s) "G\301V\207" [s 0] 2] split-string " "] 5]] 6 (#$ . 231)]) (defalias 'lxc/get-id #[nil "\301=\204\n\302\303!\207\304\305 \212\305 b\210\306\307\310 \311#\206\310 S)\"C\207" [major-mode lxc-list-table-mode error "lxc-start: need an ID" buffer-substring-no-properties line-beginning-position re-search-forward " " line-end-position t] 6]) #@36 Start the specified LXC container. (defalias 'lxc-start #[(id) "\301\302\303\"!\210\304\305!\205\306 \207" [id shell-command format "sudo lxc-start -d -n %s" called-interactively-p any tabulated-list-print] 4 (#$ . 887) (lxc/get-id)]) #@103 Stop the specified LXC container. This doesn't actually do an LXC KILL, it uses LXC clean shut down. (defalias 'lxc-kill #[(id) "\301\302\303\"!\210\304\305!\205\306 \207" [id shell-command format "sudo lxc-stop -n %s" called-interactively-p any tabulated-list-print] 4 (#$ . 1132) (lxc/get-id)]) #@51 Make the table entries for `tabulated-list-mode'. (defalias 'lxc/table-entrys #[nil "\300\301\302 \"\207" [-map #[(e) "@\301\302\"D\207" [e apply vector] 4] lxc/list] 3 (#$ . 1439)]) (defvar lxc-list-table-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [lxc-list-table-mode-hook variable-documentation put "Hook run after entering LXC containers mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp lxc-list-table-mode-map definition-name lxc-list-table-mode] 4) (defvar lxc-list-table-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [lxc-list-table-mode-abbrev-table lxc-list-table-mode-map variable-documentation put purecopy "Keymap for `lxc-list-table-mode'." boundp lxc-list-table-mode-syntax-table definition-name lxc-list-table-mode (lambda (#1=#:def-tmp-var) (defvar lxc-list-table-mode-syntax-table #1#)) make-syntax-table "Syntax table for `lxc-list-table-mode'." (lambda (#1#) (defvar lxc-list-table-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `lxc-list-table-mode'." derived-mode-parent tabulated-list-mode] 5) #@261 Major mode for listing your LXC containers. In addition to any hooks its parent mode `tabulated-list-mode' might have run, this mode runs the hook `lxc-list-table-mode-hook', as the final or penultimate step during initialization. \{lxc-list-table-mode-map} (defalias 'lxc-list-table-mode #[nil "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2036 \321 =\203<\322\f\323 \"\210)\324+\325\"\204V+,=\204V\326+\325,C#\210\327 !\210\330\f!\210+,\331-\332 \333\334#\210\332 \335\336#\210\332 \337\340#\210\341./0\342\343\344\345F1/\346\347EC&2\350 \210)\351\352!\207" [delay-mode-hooks major-mode mode-name lxc-list-table-mode-map lxc-list-table-mode-syntax-table parent make-local-variable t tabulated-list-mode lxc-list-table-mode "LXC containers" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table lxc/table-entrys define-key "s" lxc-start "k" lxc-kill "O" lxc-open loop "name" "state" "pid" "IP" 20 nil tabulated-list-init-header run-mode-hooks lxc-list-table-mode-hook lxc-list-table-mode-abbrev-table local-abbrev-table tabulated-list-entries for col in vconcat tabulated-list-format] 10 (#$ . 2899) nil]) #@43 Show the list of LXC containers you have. (defalias 'list-lxc #[nil "r\300\301!q\210\302 \210\303 \210\304p!)\207" [get-buffer-create "*lxc-list*" lxc-list-table-mode tabulated-list-print switch-to-buffer] 2 (#$ . 4267) nil]) #@40 Open a tramp session to the container. (defalias 'lxc-open #[(name) "\303\304 \"\211\305\234\306\307\310\n\"!*\207" [name container ip kva lxc/list 2 find-file-other-window format "/ssh:ubuntu@%s:"] 5 (#$ . 4499) (list (progn (goto-char (line-beginning-position)) (re-search-forward "^\\([a-zA-Z0-9-]+\\)" (line-end-position) t) (let ((name (match-string 1))) name)))]) (provide 'lxc)