Archive

In response to a recent ExponentCMS security vulnerability which allows a cross-site script injection to allow anybody to create a new admin user, I’ve written the following script that will automatically apply the necessary patch. Suggested usage:

I had a niche need to make an easy summary of user directory sizes for an FTP server where the users’ homes could be in one of a few locations. I whipped up this script which should make it easy even for an ultra-novice to get this summary:

Anybody who’s adminned a Virtualmin server has probably had update hell. One that I personally have had to wrangle with is where Virtualmin will randomly disable email accounts, resulting in frustrated users calling you when noone can email them. I’ve written a quick Python script to dump out a list of all disabled email accounts to reduce the inevitable frustration caused by this issue, allowing one to quickly find all of the disabled emails and re-enable them, hopefully before anyone complains.

#/usr/bin/env python
file = open('/etc/postfix/virtual','r')
activemails = list()
for line in file:
if '@' in line:
activemails.append(line.split(None,1)[0])
file.close()
file = open ('/etc/passwd','r')
for line in file:
if '@' in line and '/bin/false' not in line:
email = line.split(':',1)[0]
if email not in activemails:
print email
file.close()