Subfolders
Latest "Packages" files
» » » » » »
SQL query to list all WordPress post revisions for archiving

SQL query to list all WordPress post revisions for archiving

Here's the SQL query to get all post revisions, which I do prior to cleaning them out of the database, which seems to make it much faster: SELECT p.* FROM…
» » » » » »
Speeding up rsnapshot (rsync) backups by removing wildcard paths from exclude

Speeding up rsnapshot (rsync) backups by removing wildcard paths from exclude

I removed a bunch of wildcard paths from rsnapshot.conf's exclude, and suddenly tonight my backup ran in a few minutes instead of taking over a day like it usually does.…
» » » » » »
Resolving an rsnapshot error — “rsync: –delete does not work without –recursive (-r) or –dirs (-d). rsync error: syntax or usage error (code 1) at main.c(1795)”

Resolving an rsnapshot error — “rsync: –delete does not work without –recursive (-r) or –dirs (-d). rsync error: syntax or usage error (code 1) at main.c(1795)”

I discovered rsnapshot hadn't run in a few days. Checking /etc/rsnapshot.log, I found every recent day had this: rsync: --delete does not work without --recursive (-r) or --dirs (-d). rsync…
» » » » » »
Post-migration steps when migrating or restoring Linux from backup

Post-migration steps when migrating or restoring Linux from backup

There are intentionally vague broad steps, here just as a reminder to myself; best to look specific instructions for each of these steps up at restore time for the particular…
» » » » » »
Fastest way to delete a large, deep directory in Linux

Fastest way to delete a large, deep directory in Linux

Per numerous references around the web, to delete /path/to/directory-to-delete/: cd /path/to/ mkdir empty_dir rsync -a --delete empty_dir/ directory-to-delete/ rm -r empty_dir rm -r directory-to-delete Disclaimer: this is for my own…
» » » » » »
Reducing rsnapshot or rsync resource usage

Reducing rsnapshot or rsync resource usage

I've had sporadic problems with clearing the WP cache causing the server to return 520 errors for a few minutes. Usually other sites on the same server are fine, it's…
» » » » » »
Force Git to overwrite local changes if there is a branch conflict

Force Git to overwrite local changes if there is a branch conflict

Use code you find here at your own risk! I am not responsible if you damage your data or system by following any instructions you find here. Navigate to your…
» » » » » »
How to monitor RAM for tuning pm.max_children

How to monitor RAM for tuning pm.max_children

How to monitor RAM usage: free -h: This command shows your system's total, used, and free memory in a human-readable format. Key metrics: total: Total RAM. used: RAM currently in…
» » » » » »
Add sar logging for CPU, RAM, and disk I/O

Add sar logging for CPU, RAM, and disk I/O

Add or change /etc/cron.d/sysstat to this. This creates a cron jobe to write file /tmp/outage_resource_log.txt that keeps minute-by-minute stats, sometimes useful in troubleshooting slowdowns. However, it's not a great way…
» » » » » »
Add /fpm-status page to Apache virtual host

Add /fpm-status page to Apache virtual host

Add this to virtual host file in /etc/apache2/sites-available/, right below DocumentRoot, in both :80 and :443 sections SetHandler "proxy:unix:/var/php-fpm/170027027353667.sock|fcgi://127.0.0.1" Require all granted May need in /etc/php/8.2/fpm/pool.d/www.conf, not sure: pm.status_path =…
» » » » » »
View last 200 lines of all access logs on apache server

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"…
» » » » » »
How to check Fail2ban log

How to check Fail2ban log

Command to check fail2ban's log is sudo tail -f /var/log/fail2ban.log
Linux SQL Tuning Utilities

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]…