From c81ff462a5d39950718f04c54eadb4ba32949377 Mon Sep 17 00:00:00 2001 From: vitrinekast Date: Tue, 26 Mar 2024 22:47:46 +0100 Subject: [PATCH] render some empty ones --- script.py | 7 ++++--- templates/book.jinja | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/script.py b/script.py index 294aec1..781d973 100644 --- a/script.py +++ b/script.py @@ -58,6 +58,7 @@ ip_address = run_command(['awk', '$1 == "inet" {gsub(/\/.*$/, "", $2); print $2} print("start running the service commands, this sometimes takes longer"); logins_today_log = subprocess.run(["sudo", "journalctl","_COMM=systemd-logind","-r" , "--output-fields=MESSAGE", "-S", "today", "-g", "'New session'" ], capture_output=True) +print(logins_today_log) logins_today = run_command(['grep', '-v', "'Boot'"], based=logins_today_log.stdout) kitchen_services = run_command(["sudo", "journalctl", "-S", "today", "-u", "kitchen-stove.service", "-u", "kitchen-bin.service", "-u", "kitchen-fridge.service", "-r", "-n"]).splitlines() @@ -76,11 +77,11 @@ output = template.render( # users_created_today=users_created_today, users_created_today=fallback, since_last_boot=since_last_boot, - list_package_installs=list_package_installs, + list_package_installs=[], # list_package_upgrade=list_package_upgrade, - list_package_upgrade=fallback, + list_package_upgrade=[], # list_package_remove=list_package_remove, - list_package_remove=fallback, + list_package_remove=[], device_info=device_info, days_since_last_boot = time_since_last_boot.days, kitchen_services = kitchen_services, diff --git a/templates/book.jinja b/templates/book.jinja index 3664de3..2409c21 100644 --- a/templates/book.jinja +++ b/templates/book.jinja @@ -91,9 +91,9 @@ user_deleted : {{ user_deleted }}

The state of chopchop on {{now}}


tldr@chopchop:~ $whoami

-

{{device_info}}

-

{{chopchop}}

-

{{ip_address}}

+

{{ device_info }}

+

{{ hostname }}

+

{{ ip_address }}

XPUB 1 users use chopchop as a shared community server. chopchop is usually located in the Piet Zwart Wijnhaven building, although for this occassion it is resting on the @@ -130,7 +130,7 @@ user_deleted : {{ user_deleted }} {{ log_output(users_created_today) }} {% if users_created_today|length > 0 %} - {{last_user_added_name}} user was added, and the network of trust grew ever so slightly. Users will be trusted with not just the keys and passwords to the "house" which is the server, but with a portion of responsibility to keep it afloat and contribute to what makes it a community of practices (and network of knowledge and dependence). + {{ last_user_added_name | replace(", ", "") }} user was added, and the network of trust grew ever so slightly. Users will be trusted with not just the keys and passwords to the "house" which is the server, but with a portion of responsibility to keep it afloat and contribute to what makes it a community of practices (and network of knowledge and dependence). {% else %} No new users were created today. The trust network remains the same size. {% endif %} @@ -158,13 +158,13 @@ user_deleted : {{ user_deleted }}

tldr@chopchop:~ $ grep 'upgrade' /var/log/dpkg.log

- Out of the installed packages, these ones were upgraded: + Out of the existing packages, these were upgraded: {{ log_output(list_package_upgrade) }} - Packages are upgraded to fix Previous bugs they had, or allow new options for usage they did not have prior. + Packages are upgraded to fix previous bugs they had, or allow new options for usage they did not have prior. {% else %} No existing packages were upgraded today.