kolektiva.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Kolektiva is an anti-colonial anarchist collective that offers federated social media to anarchist collectives and individuals in the fediverse. For the social movements and liberation!

Administered by:

Server stats:

3.9K
active users

#awk

6 posts5 participants0 posts today
Continued thread

Yeah! Smart #awk just slashed some legs 🤭

Mar 12 14:43:57 nogoo Blocking 2a01:4f8:1c1c:8fc2::1: Too many bad Method: "\x15\x03\x03\x00\x02\x01\x00"
Mar 12 14:43:59 nogoo Blocking 167.235.158.251: Too many bad Method: "\x15\x03\x03\x00\x02\x01\x00"

EDIT: And, BTW, #Pushover is part of the process so that I get the information while not logged on the server. So thank you @pushover for the SaaS 😗

Doing some table generation in awk, and is there an easier way to do "all fields n to NF" than this?

function combine(combn, combs) {
for (; combn<=NF; ++combn) {
combs=combs "\t" $(combn)
}
return combs
}

I could use printf on the fragments, but the annoyance is that loop, instead of
(string-join (cddr fields) "\t")
or whatever.

Ich habe hier 200 Text-Dateien, jeweils ca. 110 Megabyte, über 1,6 Millionen Zeilen.

Die erste Spalte soll fortlaufende Zahlen enthalten.

for F in $(ls stream_*.txt); do echo -en "$F\t"; awk 'NR==1{n=$1-1;}{print $1-NR-n;}' $F | uniq -c; done

Schleife über alle Dateien mit Namen stream_*.txt:
– gib Dateinamen aus,
– ziehe Zeilennummer und (ersterWert-1) von erster Spalte ab,
– zähle, wie häufig "0" oder etwas anderes rauskommt.

Ergebnis: alles in Ordnung ✅ 🥳

#Linux #AWK #CLI @climagic

Der #FPGA lief gut durch, ∃ Logdatei mit 29.385.185 Zeilen.

Die erste Spalte soll einfach nur hochzählen (wenn Zahlen fehlen = Fehler).

awk '{print $1-NR;}' tomotrg25.log | sort -n | uniq -c

… zieht von der Zahl in der ersten Spalte ($1) die Zeilennummer (NR = number of records) ab, dann wird sortiert, dann werden identische Zeilen zusammengefasst/gezählt.

Weil die Werte tatsächlich aufsteigend sind: $1-NR = const und diese Konstante kommt 29385185 mal vor 🥳

#Linux#awk#sort

If you want to run a #Linux command, displaying only the header line and lines which match a pattern, you can turn to #awk

Example:

sudo ss -tlunp | awk 'NR == 1 { print; } /dnsmasq/ { print; }' | less -NSiRJ