From f71638271a197927660e955a0b53c9deff2d757d Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 3 Jul 2018 01:29:22 +0300 Subject: initial commit --- %HOME%/.config/systemd/user/linux-status.service | 10 ++ .gitignore | 1 + LICENSE.txt | 21 ++++ README.md | 28 +++++ cgi-bin/hostname.sh | 8 ++ cgi-bin/systemctl_status_system.sh | 8 ++ cgi-bin/systemctl_status_user.sh | 8 ++ cgi-bin/systemctl_timers_system.sh | 8 ++ cgi-bin/systemctl_timers_user.sh | 8 ++ cgi-bin/top.sh | 8 ++ index.html | 132 +++++++++++++++++++++++ 11 files changed, 240 insertions(+) create mode 100644 %HOME%/.config/systemd/user/linux-status.service create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100755 cgi-bin/hostname.sh create mode 100755 cgi-bin/systemctl_status_system.sh create mode 100755 cgi-bin/systemctl_status_user.sh create mode 100755 cgi-bin/systemctl_timers_system.sh create mode 100755 cgi-bin/systemctl_timers_user.sh create mode 100755 cgi-bin/top.sh create mode 100644 index.html diff --git a/%HOME%/.config/systemd/user/linux-status.service b/%HOME%/.config/systemd/user/linux-status.service new file mode 100644 index 0000000..3273327 --- /dev/null +++ b/%HOME%/.config/systemd/user/linux-status.service @@ -0,0 +1,10 @@ +[Unit] +Description=linux-status + +[Service] +Type=simple +WorkingDirectory=/srv/linux-status +ExecStart=/usr/bin/python3 -m http.server --cgi + +[Install] +WantedBy=default.target diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f2cef --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/links.bin diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..977fc1d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Egor Tensin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..90c1f1f --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +linux-status +============ + +Simple Linux status web pages. + +Deployment +---------- + +Clone to /srv/linux-status and use [config-links]: + + > pwd + /srv/linux-status + + > ~/workspace/personal/config-links/update.sh + ... + + > loginctl enable-linger "$( whoami )" + > systemctl --user enable linux-status + > systemctl --user start linux-status + +[config-links]: https://github.com/egor-tensin/config-links + +License +------- +Distributed under the MIT License. +See [LICENSE.txt] for details. + +[LICENSE.txt]: LICENSE.txt diff --git a/cgi-bin/hostname.sh b/cgi-bin/hostname.sh new file mode 100755 index 0000000..38b7700 --- /dev/null +++ b/cgi-bin/hostname.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +echo 'Content-Type: plain/text; charset=utf-8' +echo + +hostname diff --git a/cgi-bin/systemctl_status_system.sh b/cgi-bin/systemctl_status_system.sh new file mode 100755 index 0000000..119b2e2 --- /dev/null +++ b/cgi-bin/systemctl_status_system.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +echo 'Content-Type: text/plain; charset=utf-8' +echo + +SYSTEMD_COLORS=no systemctl --system status --no-pager --full diff --git a/cgi-bin/systemctl_status_user.sh b/cgi-bin/systemctl_status_user.sh new file mode 100755 index 0000000..7ba1dd3 --- /dev/null +++ b/cgi-bin/systemctl_status_user.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +echo 'Content-Type: text/plain; charset=utf-8' +echo + +SYSTEMD_COLORS=no systemctl --user status --no-pager --full diff --git a/cgi-bin/systemctl_timers_system.sh b/cgi-bin/systemctl_timers_system.sh new file mode 100755 index 0000000..3c93d8b --- /dev/null +++ b/cgi-bin/systemctl_timers_system.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +echo 'Content-Type: text/plain; charset=utf-8' +echo + +SYSTEMD_COLORS=no systemctl --system list-timers --all --no-pager --full diff --git a/cgi-bin/systemctl_timers_user.sh b/cgi-bin/systemctl_timers_user.sh new file mode 100755 index 0000000..c8b0a95 --- /dev/null +++ b/cgi-bin/systemctl_timers_user.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +echo 'Content-Type: text/plain; charset=utf-8' +echo + +SYSTEMD_COLORS=no systemctl --user list-timers --all --no-pager --full diff --git a/cgi-bin/top.sh b/cgi-bin/top.sh new file mode 100755 index 0000000..630afff --- /dev/null +++ b/cgi-bin/top.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +echo 'Content-Type: text/plain; charset=utf-8' +echo + +top -b -n 1 diff --git a/index.html b/index.html new file mode 100644 index 0000000..4de6bf1 --- /dev/null +++ b/index.html @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.3