With Melvin's kind permission, I have created a repository on github which has all of these files in it. Hopefully that will allow them to "stick around" a bit longer. You can peruse them at:
Also, this allows you to preview individual files and, if you want, to only get those which you want right now. I will also add, as Melvin has in his README, that these are "as is" and there is __NO__ support for them. If they work, you're golden. If the don't, ... .
Based on several positive feedback's from my previous submission for unused index queries, I've decided to contribute most all of the scripts and queries I've written or collected over my career. Therefore please find attached:
dba_scripts.tar.gz -> scripts to automate specific queries. Note that there are two potentially dangerous scripts.
flip_database_connect.sh -> Changes the state of datallowconn for a specific database logins_block.sh -> prevents all non-superusers from future logins. MUST be run as user postgres
queries.tgz -> sql only queries (but more than dba_scripts) queries.zip -> Same as above, but for Windows O/S, even though I do not advise running production on Windows.
Please remember to read the README.txt provided with each for a general explanation.
If for some reason the attachments did not work, you can email me directly and I will send to your email.
CAVEAT EMPTOR! Please DO NOT write to me asking me why I did things one way when you think it should be done another way, or way I chose specific values for a query. There are several available editors you can use to make your own changes. IOW: Do not peer into the oral cavity of an equestrian present!