From 4e80ad2d34f307991562c364b157d1c7a502cd96 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 23 Sep 2022 18:29:01 +0000 Subject: deploy: 29c1b6a06f8d5c546fbd5514731c4ac4c504f6c3 --- print.html | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) (limited to 'print.html') diff --git a/print.html b/print.html index 5a70cb5..bec2e28 100644 --- a/print.html +++ b/print.html @@ -76,7 +76,7 @@ @@ -1152,6 +1152,21 @@ done | sort -k2 -n

We capture values from VmRSS and Name into variables and print them at the END once processing all records is done.

+

Capture in array

+
echo 'a 10
+b 2
+b 4
+a 1' | awk '{
+    vals[$1] += $2
+    cnts[$1] += 1
+}
+END {
+    for (v in vals)
+        printf "%s %d\n", v, vals[v] / cnts [v]
+}'
+
+

Capture keys and values from different columns and some up the values. +At the END we compute the average of each key.

Run shell command and capture output

cat /proc/1/status | awk '
                      /^Pid/ {
@@ -3482,6 +3497,49 @@ tcp/udp/icmp            Filter for protocol.
 
# -k: Start capturing immediately.
 ssh <host> tcpdump -i <IF> -w - | sudo wireshark -k -i -
 
+

Web

+ +

html

+

Collapsible element

+

Rendered html

+
<details>
+  <summary>Some text goes here</summary>
+  ... some more text goes here.
+</details>
+
+
+

With the open attribute <details open> the details are unfolded by default.

+
+

Minimal 2 column layout

+

Rendered html

+
<style>
+.grid-2col {
+  display: grid;
+  grid-template-columns: 2fr 1fr;
+  gap: 1em
+}
+.col1 {
+  grid-column-start: 1;
+  background-color: red;
+  padding-left: 1em;
+}
+.col2 {
+  grid-column-start: 2;
+  background-color: green;
+  padding-left: 1em;
+}
+</style>
+<div class="grid-2col">
+  <div class="col1">
+    <p>Some text in the first column.</p>
+  </div>
+  <div class="col2">
+    <p>Some text in the second column.</p>
+  </div>
+</div>
+

Arch