Subfolders
Latest "Grimoires" Articles
Workshop » Reference Section » Grimoires » IT » Platforms » Linux » Packages » Apache

View last 200 lines of all access logs on apache server

find [path/to/access/logs/folder] -name "*_access_log" -exec sh -c 'tail -200 "$1" | grep -v "HetrixTools\|ok\.txt\|canary" | sed "s/$/ [$(basename "$1" _access_log)]/"' _ {} \; | sort -k4,4

The grep -v "HetrixTools\|ok\.txt\|canary" filters out hits from my uptime monitor.

Workshop » Reference Section » Grimoires » IT » Platforms » Linux » Packages » fail2ban

How to check Fail2ban log

Command to check fail2ban's log is sudo tail -f /var/log/fail2ban.log

Linux

Linux PHP tuning utilities & commands

1. See memory consumed by php-fpm8.2 (change this to match different PHP version if necessary)

ps --no-headers -o "rss,cmd" -C php-fpm8.2 | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'

Linux

Linux SQL Tuning Utilities

1. tuning-primer.sh

Run from Github:
curl -L https://raw.githubusercontent.com/BMDan/tuning-primer.sh/main/tuning-primer.sh | bash

2. MySQLTuner.pl

wget http://mysqltuner.pl/ -O mysqltuner.pl
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
perl mysqltuner.pl --host 127.0.0.1 --user [user] --pass [pass]

Remember to quote any punctuation or BASH tokens in the password.

Workshop » Reference Section » Grimoires » IT » Troubleshooting log

/Devlog

  • 2026jul3
    • Changed .metainfo > .dashicons {margin-bottom: -2px;margin-top: -2px; /* fix for dashicons raising text baselines in tags in meta info line */} to use ".page-header .metainfo > .dashicons" so didn't add weird spacing to metainfo in archove page post lists.
    • Create ktwp-table-of-contents and ktwp-raw-html-shortcode plugins
    • add :target {scroll-margin-top: 120px; /* o make named anchors always appear under sticky header */ }
  • 2026jul1
    • Added overflow-y:hidden during earthquake to prevent extra scrollbars from appearing.
    • Discovered the earthquake was moving all .do-earthquake-children around the same origin, and, earthquake was being applied to invisible elements. Fixed both.
  • 2026jun21
    • Moved category "In Brief: Topical Short Takes" from "Written Snippets" category to "Blog Posts" and renamed it "You Can Quote Me On That: Topical Short Takes".
    • Moved category "kwits" from top-level to a subcategory of "blog posts".
  • 2026jun15
    • Today Comcast (boo! hiss!) did some work…