https://wikitech.wikimedia.org/wiki/Generating_CAPTCHAs
Running the following in a cronjob should be mostly trivial
sudo -u apache mwscript extensions/ConfirmEdit/maintenance/GenerateFancyCaptchas.php aawiki --wordlist=/home/aaron/words --font=/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf --blacklist /home/aaron/badwords --fill=10000 --verbose