When you want to add a domain to a directadmin server and you get the message that it already exists but you can’t find it in directadmin, there might be some lingering files left over. This script will let you find them.
Dump all databases
Simple script with minimal settings to be set. Will dump databases and save them in a location of your choosing after cleaning backups that are deemed to old (age of your choosing). It’s been written with mariadb as primary target. Mariadb binaries complain now when called on with their mysql-counterpart names. So mysql is now …
Continue reading Dump all databases
userlogs.sh
It sometimes happens when a user on a directadmin server causes heavy load. When this user only has 1 domain it’s easy to figure out what’s going on. But sometimes there are users with a lot more domains. This script makes it easier to tail all of the sites’ acces logs in one go.
Identify php versions per domain per user in directadmin
At times you might want to get a list of which php versions are in use by which domain. There’s a plugin for directadmin for that (https://wavoe.bitbucket.io/phpversionlist/phpversionlist.tar.gz) but you can’t easily export the info to excel, especially when doing multiple servers. This script makes a nice csv. Changelog:v2.2: 2022/02/11: added creator If you have multiple …
Continue reading Identify php versions per domain per user in directadmin
directadmin’s dnssec made easier
Directadmin offers support for DNSSEC. In order to config this you have to edit the zone file, twice. You first to to dns management, search for the domain and click the generate keys button. Then you have to go back and clik the sign button. You can use the script /usr/local/directadmin/scripts/dnssec.sh but you have to …
Continue reading directadmin’s dnssec made easier
A simple watchdog script
At times you find some daemons just stop but since they’re not actively used all the time etc you don’t find out until long after. This script watches the named process. Run it from cron to run checks occasionally (like */15 * * * * for every 15 minutes). If you replace the DAEMON=<daemon name> …
Continue reading A simple watchdog script
Bad bots (nginx)
Fed up with bots hammering your site? Block them by simply dropping the connection. When they present their user agent all they get is a HTTP 444 (just close connection, do not reply).
Convert files to webp
Do you have a folder with many images that you want to convert to webp? Don’t want to do it all by hand? Use this script then. You will need to set the WORKDIR variable, and perhaps change the path to the bash shell (like when you’re on FreeBSD, the path is /usr/local/bin/bash). Requirements: webp …
Continue reading Convert files to webp
repair and optimize all tables
Sometimes the database daemon crashes (because the server ran out of swap space for example). This can cause the databases to be damaged. Finding and repairing the database table in question can be an arduous task, especially if you have a lot of databases. This script runs both repair and optimize on all tables. You’ll …
Continue reading repair and optimize all tables
Automatically block asshole bots
There’s a great many bots out there that set off so many requests webservers can get swamped. This script searches for particular user agents, finds the originating ip address (ipv4 or ipv6) and then blocks the whole subnet. This is specifically done for yandex and MJ12bot who use a large amount of subnets. This script …
Continue reading Automatically block asshole bots