Posts in category Scripts
Easy Python: MySQL connection and ite...
If you’ve been looking for a simple python script to use with MySQL that you can use to expand upon for your next project, check this one out. It has error handling for the connection, error handling for the sql call, and loop iteration for the rows returned.
#!/usr/bin/python
import sys
import MySQLdb
my_host = "localhost"
my_user [...]
How to: rotate wordpress posts into h...
If you’re using the new Arthemia theme for WordPress you might notice that there are two areas of the theme that can have articles promoted to; namely Headline and Featured sections. This is controlled by category association. Basically you have a post and if you want it in the Headline area of the theme you attach the category “ [...]
A simple webpage test script in Pytho...
Looking around on Google for a webpage test script returns a lot of results. Some of them are useful, some are not. In particular, for Python, the scripts on the first page of results are minimal and lacking a useful copy and paste / ready to go script that will answer the question “is my webpage available?”. So I decided to wri [...]
Fun with the pipe
Of course there are better ways to manage security on webservers, but I was playing around with the apache error log file today and wanted to get all of the subnets for the script kiddies that are hammering on this dev box. A quick one liner and we’re done!
ROOT-(0)> grep "error" error_log |awk -F[ {'print $4'}| sort | sed -e 's/]//g' [...]
Change control generator
Perhaps you have found yourself in the middle of planning a large maintenance that involves many servers and many clients and all of the work is the same and you noticed that you don’t want to write a change control document for each client or each server.
Well, here’s some code that will write one for you. Just fill in your ar [...]
Monolith DBA Toolkit 0.4.3 Released
The Monolith Toolkit of scripts for DBA routines. 0.4.3 has been released. You can download it here: http://code.google.com/p/monolith-toolkit/
Some information on the toolkit and what it contains:
mt-backup-parallel -> runs mysql backups in parallel super fast, has lots of reporting features
mt-check-replication -> script to report [...]
Monolith Toolkit – MySQL DBA to...
Today I decided to package all of my various scripts together into a useful toolkit. Some are perl, some are shell script. These scripts are, in general, one off scripts that I wrote in order to get things done that weren’t available at the time. Now they’re nicely organized and will receive updates at the google code repo.
So f [...]
Parallel mysqldump backup script avai...
Large databases, long mysqldump times, long waits for globally locked tables. These problems basically never go away when you rely on mysqldump with –all-databases or a list of databases, as it dumps schemas serially. I’m not going to explain serial vs parallel processing here since that’s a larger topic. Suffice to say th [...]
Rotating General Query & Slow Lo...
Sometimes you need to have the general query log on and even though it causes more disk I/O than you may want, it’s good for troubleshooting. This log can and probably will fill up your disks rather quickly. Then there’s the slow query log – setting log_slow_queries and log_queries_not_using_indexes will write out the que [...]
Schema for DBA duties
I’m starting up a schema to hold stored procedures that automate common DBA tasks. SQL file for import is here: opsmonitor.sql
More SPs will be added in time… whenever I get the time to write them that is.
UPDATE: Jeff Stoner will be heading up this project to contain his scripts, of which the ones currently listed in the first [...]





