loads of new commands included!

main
vitrinekast 8 months ago
parent 1e9dd4ba9a
commit ca8a75363b

@ -26,15 +26,14 @@
<header>
<h1>TL;DR</h1>
<h2>too log didn't read</h2>
<small>Some temp debug info: This log was generated on 2024-03-18 20:48:33.398733, the next will be available after 2024-03-18 23:48:33.398733. I now have 25 logs generated! </small>
</header>
<nav class="slider slider--top">
<label for="time">time</label>
<input type="range" min="0" max="100" id="time">
<input type="range" min="0" max="68" id="time" value="0" class="fn-time-slider">
</nav>
<nav class="slider slider--left">
<label for="annotation">annotations</label>
<input class="vertical" type="range" value="0" min="0" max="400" id="annotation">
<input type="range" value="0" min="0" max="400" class="vertical fn-annotation-slider">
</nav>
<main>
<div class="main__background">
@ -43,15 +42,36 @@
<div class="main__inner">
<article>
<h2>What happened today?</h2>
<small>Some temp debug info: This log was generated on 2024-03-18 22:38:41.543544, the next will be available after 2024-03-19 01:38:41.543544. I now have 68 logs generated! </small>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl -S today -u kitchen-stove.service -u
kitchen-bin.service -u kitchen-fridge.service -r -n</p>
<ul>
<li>Mar 18 21:11:15 chopchop systemd[1]: Failed to start kitchen-fridge.service - Kitchen Fridge Service.</li>
<li>Mar 18 21:11:15 chopchop systemd[1]: kitchen-fridge.service: Failed with result 'exit-code'.</li>
<li>Mar 18 21:11:15 chopchop systemd[1]: kitchen-fridge.service: Start request repeated too quickly.</li>
<li>Mar 18 21:11:15 chopchop systemd[1]: Stopped kitchen-fridge.service - Kitchen Fridge Service.</li>
<li>Mar 18 21:11:15 chopchop systemd[1]: kitchen-fridge.service: Scheduled restart job, restart counter is at 6.</li>
<li>Mar 18 21:11:15 chopchop systemd[1]: kitchen-fridge.service: Failed with result 'exit-code'.</li>
<li>Mar 18 21:11:15 chopchop systemd[1]: kitchen-fridge.service: Main process exited, code=exited, status=2/INVALIDARGUMENT</li>
<li>Mar 18 21:11:15 chopchop python3[26203]: /usr/bin/python3: can't open file '/home/xpub/kitchen/Fridge/fridge.py': [Errno 2] No such file or directory</li>
<li>Mar 18 21:11:14 chopchop systemd[1]: Failed to start kitchen-stove.service - Kitchen Stove Service.</li>
<li>Mar 18 21:11:14 chopchop systemd[1]: kitchen-stove.service: Failed with result 'exit-code'.</li>
</ul>
<pre>sudo journalctl -S today -u kitchen-stove.service -u kitchen-bin.service -u kitchen-fridge.service -r -n</pre>
<p>Mar 18 17:39:13 chopchop systemd[1]: Started kitchen-fridge.service - Kitchen Fridge Service.
Mar 18 17:39:07 chopchop python3[10827]: lp: No file in print request.
Mar 18 17:39:07 chopchop python3[10812]: request id is hp-color-laserjet-cp5225-16 (1 file(s))
Mar 18 17:39:06 chopchop systemd[1]: Started kitchen-stove.service - Kitchen Stove Service.
Mar 18 17:38:33 chopchop systemd[1]: Started kitchen-bin.service - Kitchen Bin Service.</p>
<pre>uptime -s</pre>
<p><span class='hostname'>tldr@chopchop:~ $</span>uptime -s</p>
<p>2024-03-18 07:51:34</p>
<span class="annotation fn-annotatation" level="1">
@ -61,7 +81,9 @@ Mar 18 17:38:33 chopchop systemd[1]: Started kitchen-bin.service - Kitchen Bin S
an image.
</span>
<pre>sudo journalctl _COMM=useradd -r -n 1 --output-fields=MESSAGE</pre>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=useradd -r -n 1 --output-fields=MESSAGE
</p>
<p>Feb 29 15:08:48 chopchop useradd[8744]: new user: name=colord, UID=118, GID=130, home=/var/lib/colord, shell=/usr/sbin/nologin, from=/dev/pts/4
</p>
@ -72,255 +94,372 @@ Mar 18 17:38:33 chopchop systemd[1]: Started kitchen-bin.service - Kitchen Bin S
network of knowledge and dependence).
</span>
<hr />
<pre>users_created_today</pre>
<p>-- No entries --
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for users_created_today
</span>
<pre>list_active_services</pre>
<p>[ - ] alsa-utils
[ - ] apparmor
[ + ] atop
[ + ] atopacct
[ + ] bluetooth
[ - ] console-setup.sh
[ + ] cron
[ + ] cups
[ + ] cups-browsed
[ + ] dbus
[ + ] dphys-swapfile
[ + ] exim4
[ + ] fake-hwclock
[ - ] fcgiwrap
[ - ] hwclock.sh
[ + ] incron
[ - ] keyboard-setup.sh
[ + ] kmod
[ + ] networking
[ - ] nfs-common
[ + ] nginx
[ - ] paxctld
[ - ] php7.4-fpm
[ + ] php8.2-fpm
[ + ] procps
[ - ] pulseaudio-enable-autospawn
[ + ] raspi-config
[ + ] rng-tools-debian
[ - ] rpcbind
[ - ] rsync
[ - ] saned
[ + ] ssh
[ - ] sudo
[ + ] triggerhappy
[ + ] udev
[ - ] uuidd
[ - ] x11-common
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_active_services
</span>
<pre>list_groups</pre>
<p>root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:xpub
tty:x:5:
disk:x:6:
lp:x:7:aleevadh,bernabereit,lorenzo,mania,mszw,mxrwho,river,senak,thijsoid,v,vitrinekast,wang,xpub,xpub,zerozeta,zz1,www-data
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:xpub,mb,river,joak,aleevadh,bernabereit,lorenzo,mania,mszw,mxrwho,river,senak,thijsoid,v,vitrinekast,wang,xpub,zerozeta,zz1,murtaugh,mb
fax:x:21:
voice:x:22:
cdrom:x:24:xpub
floppy:x:25:
tape:x:26:
sudo:x:27:joak,aleevadh,bernabereit,lorenzo,mania,mszw,mxrwho,river,senak,thijsoid,v,vitrinekast,wang,xpub,zerozeta,zz1,murtaugh,mb,strt,cristina,chipchip,killer
audio:x:29:xpub,river,pulse,vitrinekast,liquidsoap
dip:x:30:
www-data:x:33:vitrinekast
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:xpub
sasl:x:45:
plugdev:x:46:xpub
staff:x:50:
games:x:60:xpub
users:x:100:xpub,murtaugh,aleevadh,h4ck3r,mania,mszw,mxrwho,senak,v,wang,zerozeta,bernabereit,lorenzo,mb,river,thijsoid,vitrinekast,zz1,joak,cristina,strt,chipchip,killer
nogroup:x:65534:
systemd-journal:x:101:
systemd-network:x:102:
systemd-resolve:x:103:
input:x:104:xpub
kvm:x:105:
render:x:106:xpub
crontab:x:107:
netdev:x:108:xpub
systemd-timesync:x:109:
messagebus:x:110:
bluetooth:x:112:
avahi:x:113:
spi:x:999:xpub
i2c:x:998:xpub
gpio:x:997:xpub
systemd-coredump:x:996:
xpub:x:1000:
vitrinekast:x:1001:
senak:x:1002:
lorenzo:x:1003:
mxrwho:x:1004:
bernabereit:x:1005:
river:x:1006:
v:x:1007:
mania:x:1008:
aleevadh:x:1009:
h4ck3r:x:1010:
thijsoid:x:1011:
mszw:x:1012:
zerozeta:x:1013:
wang:x:1014:
zz1:x:1015:
Debian-exim:x:114:
rtkit:x:115:
murtaugh:x:1017:
mb:x:1016:
pulse:x:116:
pulse-access:x:117:
mlocate:x:118:
uuidd:x:119:
joak:x:1018:
sgx:x:120:
plocate:x:121:
polkitd:x:995:
_ssh:x:111:
pipewire:x:122:
cristina:x:1019:
strt:x:1020:
incron:x:123:
chipchip:x:1021:
killer:x:1022:
tcpdump:x:124:
liquidsoap:x:125:
lpadmin:x:126:river,xpub
ssl-cert:x:127:
scanner:x:128:saned
saned:x:129:
colord:x:130:
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_groups
</span>
<pre>list_package_installs</pre>
<p>2024-03-10 15:16:14 install libtk8.6:armhf <none> 8.6.13-2
2024-03-10 15:16:14 status half-installed libtk8.6:armhf 8.6.13-2
2024-03-10 15:16:15 install tk8.6-blt2.5:armhf <none> 2.5.3+dfsg-4.1
2024-03-10 15:16:15 status half-installed tk8.6-blt2.5:armhf 2.5.3+dfsg-4.1
2024-03-10 15:16:15 install blt:armhf <none> 2.5.3+dfsg-4.1
2024-03-10 15:16:15 status half-installed blt:armhf 2.5.3+dfsg-4.1
2024-03-10 15:16:15 install python3-tk:armhf <none> 3.11.2-3
2024-03-10 15:16:15 status half-installed python3-tk:armhf 3.11.2-3
2024-03-10 15:16:16 status installed libtk8.6:armhf 8.6.13-2
2024-03-10 15:16:16 status installed tk8.6-blt2.5:armhf 2.5.3+dfsg-4.1
2024-03-10 15:16:16 status installed blt:armhf 2.5.3+dfsg-4.1
2024-03-10 15:16:16 status installed python3-tk:armhf 3.11.2-3
2024-03-10 15:16:16 status installed libc-bin:armhf 2.36-9+rpt2+deb12u4
2024-03-12 14:29:01 install python3-markupsafe:armhf <none> 2.1.2-1
2024-03-12 14:29:01 status half-installed python3-markupsafe:armhf 2.1.2-1
2024-03-12 14:29:02 install python3-jinja2:all <none> 3.1.2-1
2024-03-12 14:29:02 status half-installed python3-jinja2:all 3.1.2-1
2024-03-12 14:29:02 status installed python3-markupsafe:armhf 2.1.2-1
2024-03-12 14:29:03 status installed python3-jinja2:all 3.1.2-1
2024-03-15 09:51:48 install libhttp-parser2.9:armhf <none> 2.9.4-5
2024-03-15 09:51:48 status half-installed libhttp-parser2.9:armhf 2.9.4-5
2024-03-15 09:51:48 install libmbedx509-1:armhf <none> 2.28.3-1
2024-03-15 09:51:48 status half-installed libmbedx509-1:armhf 2.28.3-1
2024-03-15 09:51:48 install libmbedtls14:armhf <none> 2.28.3-1
2024-03-15 09:51:48 status half-installed libmbedtls14:armhf 2.28.3-1
2024-03-15 09:51:48 install libgit2-1.5:armhf <none> 1.5.1+ds-1+deb12u1
2024-03-15 09:51:48 status half-installed libgit2-1.5:armhf 1.5.1+ds-1+deb12u1
2024-03-15 09:51:49 install bat:armhf <none> 0.22.1-4
2024-03-15 09:51:49 status half-installed bat:armhf 0.22.1-4
2024-03-15 09:51:50 status installed libmbedx509-1:armhf 2.28.3-1
2024-03-15 09:51:50 status installed libmbedtls14:armhf 2.28.3-1
2024-03-15 09:51:50 status installed libhttp-parser2.9:armhf 2.9.4-5
2024-03-15 09:51:50 status installed libgit2-1.5:armhf 1.5.1+ds-1+deb12u1
2024-03-15 09:51:50 status installed bat:armhf 0.22.1-4
2024-03-15 09:51:50 status installed libc-bin:armhf 2.36-9+rpt2+deb12u4
2024-03-15 09:55:52 status installed bat:armhf 0.22.1-4
2024-03-15 09:55:52 status half-installed bat:armhf 0.22.1-4
2024-03-15 09:55:52 status not-installed bat:armhf <none>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl -S today _COMM=useradd -r</p>
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for users_created_today
</span>
<p><span class='hostname'>tldr@chopchop:~ $</span> grep 'install' /var/log/dpkg.log</p>
<ul>
<li>2024-03-10 15:16:14 install libtk8.6:armhf <none> 8.6.13-2</li>
<li>2024-03-10 15:16:15 install tk8.6-blt2.5:armhf <none> 2.5.3+dfsg-4.1</li>
<li>2024-03-10 15:16:15 install blt:armhf <none> 2.5.3+dfsg-4.1</li>
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_package_installs
</span>
<li>2024-03-10 15:16:15 install python3-tk:armhf <none> 3.11.2-3</li>
<pre>list_package_upgrade</pre>
<p>
<li>2024-03-12 14:29:01 install python3-markupsafe:armhf <none> 2.1.2-1</li>
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_package_upgrade
</span>
<li>2024-03-12 14:29:02 install python3-jinja2:all <none> 3.1.2-1</li>
<pre>list_package_remove</pre>
<p>2024-03-15 09:55:52 startup packages remove
2024-03-15 09:55:52 remove bat:armhf 0.22.1-4 <none>
<li>2024-03-15 09:51:48 install libhttp-parser2.9:armhf <none> 2.9.4-5</li>
<li>2024-03-15 09:51:48 install libmbedx509-1:armhf <none> 2.28.3-1</li>
<li>2024-03-15 09:51:48 install libmbedtls14:armhf <none> 2.28.3-1</li>
<li>2024-03-15 09:51:48 install libgit2-1.5:armhf <none> 1.5.1+ds-1+deb12u1</li>
<li>2024-03-15 09:51:49 install bat:armhf <none> 0.22.1-4</li>
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span> grep 'remove' /var/log/dpkg.log</p>
<ul>
<li>2024-03-15 09:55:52 startup packages remove</li>
<li>2024-03-15 09:55:52 remove bat:armhf 0.22.1-4 <none></li>
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=systemd-logind -r
--output-fields=MESSAGE -S today -g "New session" | grep -v 'Boot'</p>
<ul>
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=groupadd -r --output-fields=MESSAGE</p>
<ul>
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=groupremove -r --output-fields=MESSAGE
</p>
<ul>
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=usermod -r</p>
<ul>
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=userdel -r</p>
<ul>
</ul>
<hr/>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo service --status-all</p>
<ul>
<li>[ - ] alsa-utils</li>
<li> [ - ] apparmor</li>
<li> [ + ] atop</li>
<li> [ + ] atopacct</li>
<li> [ + ] bluetooth</li>
<li> [ - ] console-setup.sh</li>
<li> [ + ] cron</li>
<li> [ + ] cups</li>
<li> [ + ] cups-browsed</li>
<li> [ + ] dbus</li>
<li> [ + ] dphys-swapfile</li>
<li> [ + ] exim4</li>
<li> [ + ] fake-hwclock</li>
<li> [ - ] fcgiwrap</li>
<li> [ - ] hwclock.sh</li>
<li> [ + ] incron</li>
<li> [ - ] keyboard-setup.sh</li>
<li> [ + ] kmod</li>
<li> [ + ] networking</li>
<li> [ - ] nfs-common</li>
<li> [ + ] nginx</li>
<li> [ - ] paxctld</li>
<li> [ - ] php7.4-fpm</li>
<li> [ + ] php8.2-fpm</li>
<li> [ + ] procps</li>
<li> [ - ] pulseaudio-enable-autospawn</li>
<li> [ + ] raspi-config</li>
<li> [ + ] rng-tools-debian</li>
<li> [ - ] rpcbind</li>
<li> [ - ] rsync</li>
<li> [ - ] saned</li>
<li> [ + ] ssh</li>
<li> [ - ] sudo</li>
<li> [ + ] triggerhappy</li>
<li> [ + ] udev</li>
<li> [ - ] uuidd</li>
<li> [ - ] x11-common</li>
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>getent group</p>
<ul>
<li>root:x:0:</li>
<li>daemon:x:1:</li>
<li>bin:x:2:</li>
<li>sys:x:3:</li>
<li>adm:x:4:xpub</li>
<li>tty:x:5:</li>
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_package_remove
</span>
<li>disk:x:6:</li>
<pre>device_info</pre>
<p>Raspberry Pi 4 Model B Rev 1.4
<li>lp:x:7:aleevadh,bernabereit,lorenzo,mania,mszw,mxrwho,river,senak,thijsoid,v,vitrinekast,wang,xpub,xpub,zerozeta,zz1,www-data</li>
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for device_info
</span>
<li>mail:x:8:</li>
<pre>debian_version</pre>
<p>12.1
<li>news:x:9:</li>
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for debian_version
</span>
<li>uucp:x:10:</li>
<pre>kernel_version</pre>
<p>Linux chopchop 6.1.65-v8+ #1703 SMP PREEMPT Tue Dec 5 16:25:41 GMT 2023 aarch64 GNU/Linux
<li>man:x:12:</li>
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for kernel_version
</span>
<li>proxy:x:13:</li>
<li>kmem:x:15:</li>
<li>dialout:x:20:xpub,mb,river,joak,aleevadh,bernabereit,lorenzo,mania,mszw,mxrwho,river,senak,thijsoid,v,vitrinekast,wang,xpub,zerozeta,zz1,murtaugh,mb</li>
<li>fax:x:21:</li>
<li>voice:x:22:</li>
<li>cdrom:x:24:xpub</li>
<li>floppy:x:25:</li>
<li>tape:x:26:</li>
<li>sudo:x:27:joak,aleevadh,bernabereit,lorenzo,mania,mszw,mxrwho,river,senak,thijsoid,v,vitrinekast,wang,xpub,zerozeta,zz1,murtaugh,mb,strt,cristina,chipchip,killer</li>
<li>audio:x:29:xpub,river,pulse,vitrinekast,liquidsoap</li>
<li>dip:x:30:</li>
<li>www-data:x:33:vitrinekast</li>
<li>backup:x:34:</li>
<li>operator:x:37:</li>
<li>list:x:38:</li>
<li>irc:x:39:</li>
<li>src:x:40:</li>
<li>gnats:x:41:</li>
<li>shadow:x:42:</li>
<li>utmp:x:43:</li>
<li>video:x:44:xpub</li>
<li>sasl:x:45:</li>
<li>plugdev:x:46:xpub</li>
<li>staff:x:50:</li>
<li>games:x:60:xpub</li>
<li>users:x:100:xpub,murtaugh,aleevadh,h4ck3r,mania,mszw,mxrwho,senak,v,wang,zerozeta,bernabereit,lorenzo,mb,river,thijsoid,vitrinekast,zz1,joak,cristina,strt,chipchip,killer</li>
<li>nogroup:x:65534:</li>
<li>systemd-journal:x:101:</li>
<li>systemd-network:x:102:</li>
<li>systemd-resolve:x:103:</li>
<li>input:x:104:xpub</li>
<li>kvm:x:105:</li>
<li>render:x:106:xpub</li>
<li>crontab:x:107:</li>
<li>netdev:x:108:xpub</li>
<li>systemd-timesync:x:109:</li>
<li>messagebus:x:110:</li>
<li>bluetooth:x:112:</li>
<li>avahi:x:113:</li>
<li>spi:x:999:xpub</li>
<li>i2c:x:998:xpub</li>
<li>gpio:x:997:xpub</li>
<li>systemd-coredump:x:996:</li>
<li>xpub:x:1000:</li>
<li>vitrinekast:x:1001:</li>
<li>senak:x:1002:</li>
<li>lorenzo:x:1003:</li>
<li>mxrwho:x:1004:</li>
<li>bernabereit:x:1005:</li>
<li>river:x:1006:</li>
<li>v:x:1007:</li>
<li>mania:x:1008:</li>
<li>aleevadh:x:1009:</li>
<li>h4ck3r:x:1010:</li>
<li>thijsoid:x:1011:</li>
<li>mszw:x:1012:</li>
<li>zerozeta:x:1013:</li>
<li>wang:x:1014:</li>
<li>zz1:x:1015:</li>
<li>Debian-exim:x:114:</li>
<li>rtkit:x:115:</li>
<li>murtaugh:x:1017:</li>
<li>mb:x:1016:</li>
<li>pulse:x:116:</li>
<li>pulse-access:x:117:</li>
<li>mlocate:x:118:</li>
<li>uuidd:x:119:</li>
<li>joak:x:1018:</li>
<li>sgx:x:120:</li>
<li>plocate:x:121:</li>
<li>polkitd:x:995:</li>
<li>_ssh:x:111:</li>
<li>pipewire:x:122:</li>
<li>cristina:x:1019:</li>
<li>strt:x:1020:</li>
<li>incron:x:123:</li>
<li>chipchip:x:1021:</li>
<li>killer:x:1022:</li>
<li>tcpdump:x:124:</li>
<li>liquidsoap:x:125:</li>
<li>lpadmin:x:126:river,xpub</li>
<li>ssl-cert:x:127:</li>
<li>scanner:x:128:saned</li>
<li>saned:x:129:</li>
<li>colord:x:130:</li>
</ul>
</article>
</div>
</main>
<aside>
<h3>whoami: Raspberry Pi 4 Model B Rev 1.4</h3>
<small>Linux chopchop 6.1.65-v8+ #1703 SMP PREEMPT Tue Dec 5 16:25:41 GMT 2023 aarch64 GNU/Linux, 12.1</small>
</aside>
<footer>
<h3> current residency 145.24.139.169</h3>
</footer>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript">
var allFiles = ['log_2024-03-18_22:06:14.html', 'log_2024-03-18_22:13:35.html', 'log_2024-03-18_20:31:29.html', 'log_2024-03-18_21:05:28.html', 'log_2024-03-18_20:14:57.html', 'log_2024-03-18_20:30:59.html', 'log_2024-03-18_21:08:02.html', 'log_2024-03-18_22:14:45.html', 'log_2024-03-18_22:10:45.html', 'log_2024-03-18_21:20:03.html', 'log_2024-03-18_22:12:57.html', 'log_2024-03-18_18:15:58.html', 'log_2024-03-18_22:08:47.html', 'log_2024-03-18_20:31:58.html', 'log_2024-03-18_18:25:09.html', 'log_2024-03-18_21:06:54.html', 'log_2024-03-18_21:20:44.html', 'log_2024-03-18_21:06:45.html', 'log_2024-03-18_21:54:20.html', 'log_2024-03-18_20:45:19.html', 'log_2024-03-18_18:18:36.html', 'log_2024-03-18_21:04:35.html', 'log_2024-03-18_21:00:06.html', 'log_2024-03-18_21:12:06.html', 'log_2024-03-18_21:14:16.html', 'log_2024-03-18_16:17:21.html', 'log_2024-03-18_21:16:40.html', 'log_2024-03-18_21:08:38.html', 'log_2024-03-18_21:05:57.html', 'log_2024-03-18_18:25:35.html', 'log_2024-03-18_18:17:10.html', 'log_2024-03-18_21:09:16.html', 'log_2024-03-18_16:18:13.html', 'log_2024-03-18_20:41:42.html', 'log_2024-03-18_21:13:50.html', 'log_2024-03-18_18:15:40.html', 'log_2024-03-18_21:30:17.html', 'log_2024-03-18_18:09:27.html', 'log_2024-03-18_20:13:32.html', 'log_2024-03-18_16:16:48.html', 'log_2024-03-18_21:56:01.html', 'log_2024-03-18_22:06:28.html', 'log_2024-03-18_20:54:32.html', 'log_2024-03-18_20:47:36.html', 'log_2024-03-18_20:13:03.html', 'log_2024-03-18_21:07:35.html', 'log_2024-03-18_21:18:09.html', 'log_2024-03-18_16:04:58.html', 'log_2024-03-18_20:47:07.html', 'log_2024-03-18_20:48:33.html', 'log_2024-03-18_22:07:46.html', 'log_2024-03-18_18:11:42.html', 'log_2024-03-18_21:51:57.html', 'log_2024-03-18_20:31:07.html', 'log_2024-03-18_22:05:46.html', 'log_2024-03-18_21:30:51.html', 'log_2024-03-18_22:16:11.html', 'log_2024-03-18_21:15:19.html', 'log_2024-03-18_22:06:32.html', 'log_2024-03-18_21:15:46.html', 'log_2024-03-18_22:05:57.html', 'log_2024-03-18_22:15:47.html', 'log_2024-03-18_20:44:46.html', 'log_2024-03-18_20:45:07.html', 'log_2024-03-18_21:07:16.html', 'log_2024-03-18_21:09:41.html', 'log_2024-03-18_21:04:46.html', 'log_2024-03-18_21:27:43.html'];
window.addEventListener("DOMContentLoaded", function () {
var nextDate = new Date("2024-03-18 23:48:33.398733");
var nextDate = new Date("2024-03-19 01:38:41.543544");
var now = new Date();
var ms = nextDate - now;
console.log("start a timeout in , ", ms);
@ -334,6 +473,7 @@ colord:x:130:
}
});
</script>
<script type="text/javascript" src="script.js"></script>
</body>
</html>

@ -1,5 +1,3 @@
window.addEventListener("DOMContentLoaded", function () {
var allAnnotations = this.document.querySelectorAll(".fn-annotatation");
let level = 0;
@ -16,11 +14,49 @@ window.addEventListener("DOMContentLoaded", function () {
}
updateShownAnnotations();
document.getElementById("annotation").addEventListener("input", (e) => {
document.querySelector(".fn-annotation-slider").addEventListener("input", (e) => {
level = Math.round(e.currentTarget.value / 100);
updateShownAnnotations();
})
const doTimeTravel = (e) => {
var next = allFiles[parseInt(e.target.value)];
// TODO: loading state
// TODO: trigger the loading state on input, only debounce the request
// TODO: make sure when visiting /log/{log}.html, this interaction also works
// TODO: better error management
// TODO: display the current selected file somewhere
fetch(window.location.href.replace("index.html", "") + "logs/" + next).then(function (response) {
return response.text();
}).then(function (html) {
var parser = new DOMParser();
var parsed = parser.parseFromString(html, 'text/html');
var newContent = parsed.querySelector(".main__inner");
var container = document.body.querySelector(".main__inner");
if(newContent) {
container.innerHTML = newContent.innerHTML;
} else {
container.innerHTML = "Couldn't load"
}
}).catch(function (err) {
// There was an error
console.warn('Something went wrong.', err);
});
}
})
const debounce = (callback, waitTime) => {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => {
callback(...args);
}, waitTime);
};
}
document.querySelector(".fn-time-slider").addEventListener('input', debounce(doTimeTravel, 1000));
})

@ -4,7 +4,8 @@ from datetime import datetime, timedelta
import os
import fnmatch
amount_of_logs = len(fnmatch.filter(os.listdir("./logs"), '*.html'))
# TODO: check sorting of these files (should be chronological)
log_files = fnmatch.filter(os.listdir("./logs"), '*.html')
now = datetime.today()
next_report = now + timedelta(hours=3)
@ -12,19 +13,22 @@ next_report = now + timedelta(hours=3)
def run_command(command, based = False):
result = subprocess.run(command, capture_output=True, input=based)
result.check_returncode()
return result.stdout.decode('UTF-8').strip()
stripped = result.stdout.decode('UTF-8').strip()
if "No entries" in stripped:
return ""
else:
return stripped
last_user_added = subprocess.run(["sudo", "journalctl","_COMM=useradd","-r","-n", "1" , "--output-fields=MESSAGE"], capture_output=True)
last_user_added_name = run_command(['grep', '-Po', "(?<=name)\W*\K[^ ]*"], based=last_user_added.stdout)
users_created_today = run_command(["sudo", "journalctl", "-S","today","_COMM=useradd","-r","-n","1","--output-fields=MESSAGE"])
users_created_today = run_command(["sudo", "journalctl", "-S","today","_COMM=useradd","-r","--output-fields=MESSAGE"]).splitlines()
since_last_boot = run_command(["uptime","-s"])
slb_date = datetime.strptime(since_last_boot, "%Y-%m-%d %H:%M:%S")
time_since_last_boot = now - slb_date
list_package_installs = subprocess.run(["grep", 'install', "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8')
list_package_installs_init = subprocess.run(["grep", 'install', "/var/log/dpkg.log"], capture_output=True)
list_package_installs = run_command(['grep', '-v', "status"], based=list_package_installs_init.stdout)
list_package_upgrade = subprocess.run(["grep", 'upgrade', "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8')
list_package_remove = subprocess.run(["grep", 'remove', "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8')
@ -33,7 +37,11 @@ device_info = run_command(['awk', '-F:', '{ print $2}'], based=device_info_grab.
ip_address_show = subprocess.run(["ip", "addr", "show", "end0"], check=True, capture_output=True)
ip_address = run_command(['awk', '$1 == "inet" {gsub(/\/.*$/, "", $2); print $2}' ], based=ip_address_show.stdout)
kitchen_services = run_command(["sudo", "journalctl", "-S", "today", "-u", "kitchen-stove.service", "-u", "kitchen-bin.service", "-u", "kitchen-fridge.service", "-r", "-n"])
logins_today_log = subprocess.run(["sudo", "journalctl","_COMM=systemd-logind","-r" , "--output-fields=MESSAGE", "-S", "today", "-g", "'New session'" ], capture_output=True)
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()
# loading the environment
env = Environment(loader=FileSystemLoader("templates"))
@ -45,23 +53,29 @@ template = env.get_template("template.jinja")
output = template.render(
now = now,
next_report = next_report,
amount_of_logs = amount_of_logs,
log_files = log_files,
last_user_added=last_user_added.stdout.decode('UTF-8'),
last_user_added_name=last_user_added_name,
users_created_today=users_created_today,
since_last_boot=since_last_boot,
list_package_installs=list_package_installs,
list_package_upgrade=list_package_upgrade,
list_package_remove=list_package_remove,
list_package_installs=list_package_installs.splitlines(),
list_package_upgrade=list_package_upgrade.splitlines(),
list_package_remove=list_package_remove.splitlines(),
device_info=device_info,
days_since_last_boot = time_since_last_boot.days,
kitchen_services = kitchen_services,
ip_address = ip_address,
list_groups = run_command(["getent","group"]),
list_active_services = run_command(["sudo", "service", "--status-all"]),
logins_today = logins_today,
list_groups = run_command(["getent","group"]).splitlines(),
list_active_services = run_command(["sudo", "service", "--status-all"]).splitlines(),
debian_version = run_command(["cat", "/etc/debian_version"]),
kernel_version = run_command(["uname","-a"]),
hostname = run_command(["hostname","-i"])
hostname = run_command(["hostname","-i"]),
groups_created = run_command(["sudo", "journalctl", "-S","today","_COMM=groupadd","-r"]).splitlines(),
groups_removed = run_command(["sudo", "journalctl", "-S","today","_COMM=groupremove","-r"]).splitlines(),
user_modified = run_command(["sudo", "journalctl", "-S","today","_COMM=usermod","-r"]).splitlines(),
user_deleted = run_command(["sudo", "journalctl", "-S","today","_COMM=userdel","-r"]).splitlines(),
)
log_file_name = "logs/log_" + now.strftime("%Y-%m-%d_%H:%M:%S") + ".html"

@ -42,8 +42,8 @@ body {
background-color: var(--background);
display: grid;
grid-template-columns: min-content 1fr min-content;
grid-template-rows: min-content 50px 1fr 50px;
grid-gap: 1rem 2rem;
grid-template-rows: min-content min-content 1fr min-content;
grid-gap: 1rem 1rem;
grid-template-areas:
"header header header"
". s-top s-top"
@ -92,9 +92,12 @@ main {
background-color: black;
border-bottom-right-radius: 60%;
}
article h1,
article h2,
article h2 {
margin-top: 1rem;
margin-bottom: 1rem;
}
article h3 {
margin-top: 1rem;
margin-bottom: 0.5rem;
@ -131,20 +134,39 @@ article {
}
article p,
article pre {
article pre, article li {
margin: 0 0;
font-size: 14px;
line-height: 1.5;
}
article pre {
article ul, article ol {
list-style-type: none;
padding: 0 0;
margin: 0 0;
}
article li {
margin-bottom: .15rem;
}
article p, article li {
word-break: break-word;
}
article .hostname {
color: green;
padding-right: 1ch;
}
footer {
grid-area: footer;
}
footer h3, aside h3 {
line-height: 1;
}
aside {
grid-area: aside;
writing-mode: vertical-rl;

@ -26,15 +26,14 @@
<header>
<h1>TL;DR</h1>
<h2>too log didn't read</h2>
<small>Some temp debug info: This log was generated on {{ now }}, the next will be available after {{ next_report }}. I now have {{ amount_of_logs }} logs generated! </small>
</header>
<nav class="slider slider--top">
<label for="time">time</label>
<input type="range" min="0" max="100" id="time">
<input type="range" min="0" max="{{log_files|length}}" id="time" value="0" class="fn-time-slider">
</nav>
<nav class="slider slider--left">
<label for="annotation">annotations</label>
<input class="vertical" type="range" value="0" min="0" max="400" id="annotation">
<input type="range" value="0" min="0" max="400" class="vertical fn-annotation-slider">
</nav>
<main>
<div class="main__background">
@ -43,11 +42,19 @@
<div class="main__inner">
<article>
<h2>What happened today?</h2>
<pre>sudo journalctl -S today -u kitchen-stove.service -u kitchen-bin.service -u kitchen-fridge.service -r -n</pre>
<p>{{kitchen_services}}</p>
<small>Some temp debug info: This log was generated on {{ now }}, the next will be available after {{ next_report
}}. I now have {{ log_files | length }} logs generated! </small>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl -S today -u kitchen-stove.service -u
kitchen-bin.service -u kitchen-fridge.service -r -n</p>
{% if kitchen_services|length > 0 %}
<ul>
{% for item in kitchen_services %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% endif %}
<pre>uptime -s</pre>
<p><span class='hostname'>tldr@chopchop:~ $</span>uptime -s</p>
<p>{{ since_last_boot }}</p>
{% if since_last_boot is defined %}
<span class="annotation fn-annotatation" level="1">
@ -57,7 +64,9 @@
an image.{% endif %}
</span>
{% endif %}
<pre>sudo journalctl _COMM=useradd -r -n 1 --output-fields=MESSAGE</pre>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=useradd -r -n 1 --output-fields=MESSAGE
</p>
<p>{{last_user_added}}</p>
{% if last_user_name is defined %}
<span class="annotation fn-annotatation" level="1">
@ -71,101 +80,103 @@
network of knowledge and dependence).
</span>
{% endif %}
<hr />
<pre>users_created_today</pre>
<p>{{users_created_today}}
{% if users_created_today is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for users_created_today
</span>
{% else %}
(no input)
{% endif %}
<pre>list_active_services</pre>
<p>{{list_active_services}}
{% if list_active_services is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_active_services
</span>
{% else %}
(no input)
{% endif %}
<pre>list_groups</pre>
<p>{{list_groups}}
{% if list_groups is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_groups
</span>
{% else %}
(no input)
{% endif %}
<pre>list_package_installs</pre>
<p>{{list_package_installs}}
{% if list_package_installs is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_package_installs
</span>
{% else %}
(no input)
{% endif %}
<pre>list_package_upgrade</pre>
<p>{{list_package_upgrade}}
{% if list_package_upgrade is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_package_upgrade
</span>
{% else %}
(no input)
{% endif %}
<pre>list_package_remove</pre>
<p>{{list_package_remove}}
{% if list_package_remove is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for list_package_remove
</span>
{% else %}
(no input)
{% endif %}
<pre>device_info</pre>
<p>{{device_info}}
{% if device_info is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for device_info
</span>
{% else %}
(no input)
{% endif %}
<pre>debian_version</pre>
<p>{{debian_version}}
{% if debian_version is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for debian_version
</span>
{% else %}
(no input)
{% endif %}
<pre>kernel_version</pre>
<p>{{kernel_version}}
{% if kernel_version is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for kernel_version
</span>
{% else %}
(no input)
{% endif %}
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl -S today _COMM=useradd -r</p>
{% if users_created_today is defined %}
<span class="annotation fn-annotatation" level="1">
A level 1 annotation for users_created_today
</span>
{% endif %}
{% if list_package_installs|length > 0 %}
<p><span class='hostname'>tldr@chopchop:~ $</span> grep 'install' /var/log/dpkg.log</p>
<ul>
{% for item in list_package_installs %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% endif %}
{% if list_package_upgrade|length > 0 %}
<p><span class='hostname'>tldr@chopchop:~ $</span> grep 'upgrade' /var/log/dpkg.log</p>
<ul>
{% for item in list_package_upgrade %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% endif %}
{% if list_package_remove|length > 0 %}
<p><span class='hostname'>tldr@chopchop:~ $</span> grep 'remove' /var/log/dpkg.log</p>
<ul>
{% for item in list_package_remove %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% endif %}
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=systemd-logind -r
--output-fields=MESSAGE -S today -g "New session" | grep -v 'Boot'</p>
<ul>
{% for item in logins_today %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=groupadd -r --output-fields=MESSAGE</p>
<ul>
{% for item in groups_created %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=groupremove -r --output-fields=MESSAGE
</p>
<ul>
{% for item in groups_removed %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=usermod -r</p>
<ul>
{% for item in user_modified %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo journalctl _COMM=userdel -r</p>
<ul>
{% for item in user_deleted %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<hr/>
<p><span class='hostname'>tldr@chopchop:~ $</span>sudo service --status-all</p>
<ul>
{% for item in list_active_services %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<p><span class='hostname'>tldr@chopchop:~ $</span>getent group</p>
<ul>
{% for item in list_groups %}
<li>{{ item }}</li>
{% endfor %}
</ul>
</article>
</div>
</main>
<aside>
<h3>whoami: {{device_info}}</h3>
<small>{{kernel_version}}, {{debian_version}}</small>
</aside>
<footer>
<h3> current residency {{ip_address}}</h3>
</footer>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript">
var allFiles = {{log_files}};
window.addEventListener("DOMContentLoaded", function () {
var nextDate = new Date("{{ next_report }}");
var now = new Date();
var ms = nextDate - now;
console.log("start a timeout in , ", ms);
@ -179,6 +190,7 @@
}
});
</script>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
Loading…
Cancel
Save