ghostwheel - virtual infrastructure controller

Table of Contents

"Restate the problem in terms of the solution." -variously attributed

The is the C4 README.org file for ghostwheel

1. Capabilities

  • [ ] instrumentation and controls
  • [ ] host and application status
    • [ ] aggregate and per host graphs for uptime/downtime and load
    • [ ] application service aggregate uptime/downtime and load
    • [ ] stop/restart/stop/rebuild controls
  • [ ] authoritative program source, documentation, licensing, etc. collection
  • [-] development and build automation

2. TODO State

Inject current machine, project, etc. status right here..

3. TODO Licensing and Documentation

Render some top-level documentation right here…

4. TODO Programs

List the various programs right here…

5. INPROGRESS Development

This section contains tools useful when developing ghostwheel (the system implemented and described by this document).

5.1. TODO Makefile

Encapsulate and orchestrate all integration tasks using Makefile (autoconf, etc. as needed).

5.2. TODO URI sourcing

Update document sections and blocks and collect source files and source fragments based on URI schemes

5.3. TODO iterate tangling and export while sourcing

5.4. DONE HTML rendering

To render HTML from this document place your cursor (point, in Emacs terms) into the code below and press C-c C-c (control+c, twice).

(org-html-export-to-html)

5.5. DONE Project source rendering

To render project sources from this document place your cursor (point, in Emacs terms) into the code below and press C-c C-c (control+c, twice).

(org-babel-tangle)

6. INPROGRESS Integration (in shell)

These programs run from the command line and shell-scripts.

6.1. TODO version control sourcing

Update document sections and blocks and collect source files and source fragments from version control systems.

6.2. TODO start.sh

Start or stop an application, program, system, host, etc.

6.3. INPROGRESS onboard.sh

#!/usr/bin/sh

C4REPO=${C4REPO:=$1}
if test -z "$C4REPO" ; then
    echo "$( basename $0 .sh ): repository is required (ERR)";
    echo "USAGE: $( basename $0 .sh ) <REPO>"
    echo " -or-  C4REPO=<REPO> $( basename $0 .sh )"
    echo "Where: <repo> is the path or URI of a repository.";
fi

## install to..
# instance name, default: c4
C4NAME=${C4NAME:="c4"}

# install basepath
C4IB=${C4IB:=/var}
C4IF=${C4IF:=/sbin}
C4HF=${C4HOME:=/hosted} # home folder
C4HT=${C4HT:=/htdocs}

# setup up version control commands
C4VC=${C4VC:=git}
C4VC_action=${C4VC_action:=clone}
C4VC_opt=${C4VC_opt:=""}

###
# main

oldpwd=$PWD
cloneto=$C4IB$C4IF
htmlto=$C4IB$C4HT

test -e $cloneto \
    || mkdir -p $cloneto \
    || (echo "$( basename $0 .sh ): cannot find or create $cloneto (ERR:$@)";
        exit 1)

cd $cloneto
$C4VC $C4VC_opt $C4VC_action "$C4REPO" \
|| (echo  "$( basename $0 .sh ): failed to clone $C4REPO in $cloneto (ERR:$@)";
    exit 1);

6.4. DONE build.sh

#!/usr/bin/sh
emacs --batch -l build.el

6.5. DONE tangle-README.sh

#!/usr/bin/sh
emacs --batch -eval '(progn (setopt org-safe-remote-resources '"'"'("\\`https://fniessen\\.github\\.io/org-html-themes/org/theme-readtheorg\\.setup\\'"'"'" "\\`https://fniessen\\.github\\.io/org-html-themes/org/theme-bigblow\\.setup\\'"'"'")) (find-file "README.org") (org-babel-tangle))'

6.6. DONE build.el

;;; build.el --- build README.md from README.org     -*- lexical-binding: t; -*-
;; Author: Corwin Brust <corwin@bru.st>
;; 
;;; Commentary:

;; tangle sources then build README.{md,html,txt} from README.org

;;; Code:

(require 'ox-md)
(require 'htmlize "/var/c2e2/orgvm/site-lisp/htmlize/htmlize.el" t)

(setopt org-safe-remote-resources
        '("\\`https://fniessen\\.github\\.io/org-html-themes/org/theme-readtheorg\\.setup\\'"
          "\\`https://fniessen\\.github\\.io/org-html-themes/org/theme-bigblow\\.setup\\'"))
(org-babel-do-load-languages
 'org-babel-load-languages
 '((C     . t)
   (ditaa . t)
   (dot   . t)
   ;; (http  . t) ; local source
   (emacs-lisp . t)
   (latex . t)
   ;(ruby . t)
   (js    . t)
   (perl  . t)
   (plantuml . t)
   (shell . t)
   ;; (typescript . t) ; not always loaded
   ))
(save-excursion
  (find-file "README.org")
  (org-babel-tangle)
  (org-md-export-to-markdown)
  (org-html-export-to-html)
  ;;(org-latex-export-to-pdf) ;; ugly, omit for now
  (org-ascii-export-to-ascii))

(provide 'build)
;;; build.el ends here

7. Boilerplate

7.1. Selecting the right interpreter for scripts

The "Sh-bang" line helps the operating system launch the right interpreter.

**

#!/usr/bin/env perl
# 

This additional "boilerplate" (or "standard text") which identifies the author and designates the program as free software by specifying a free software license (the GNU Public License).

Copyright 2025 Corwin Brust <corwin@bru.st>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/.

Author: Corwin Brust

Created: 2025-11-04 Tue 17:33

Validate