Send a MIME-encoded email in HTML and plain text using Python’s smtplib (Python 2.x). Just call ‘mailer’ with a return address, list of recipients, message subject and body.
Month: August 2014
Perl File Change Notifier
This notifies users by email (sendmail) when a particular file changes on a Unix-style filesystem. This was originally written for a page that was being modified by multiple people in the wiki software shipped with Apple’s OS X Server. This worked all right as a hack, but if you need extensive content management or granular […]
Python LDAP Lookups
An example of a Python LDAP lookup, Python 2.x. This one uses the on-campus LDAP service at UC Davis, so just change the LDAPServer and searchBase for another LDAP server. Or you can print the results a little more nicely:
Online Analytics Tools
AbuseIPDB The Robtex – The Robtex Swiss Army Knife Internet Tool Norsecorp Cyberattack Map GeoTrace – Uses WHOIS, Hostip.info, LOC records, and TRACEROUTE to track IP address to physical location IP Chicken – A quick “what’s my IP” type of thing (or you could look at my page footer) Internet Traffic Report MX Toolbox – […]
Varnish and Pound with Apache
Using Varnish and Pound together is a relatively easy way to ensure the Varnish cache works for both SSL and non-SSL web sites. Varnish is a general-purpose web cache that can make your web sites and applications run substantially faster for your visitors while reducing the overall load on your web server. It works by […]
Swap Apache Prefork for Worker
By default most Apache web servers — at least prior to Apache 2.4 — run Apache’s Prefork MPM (multi-processing module). Prefork works OK and offers the greatest compatibility with existing Apache modules, but it consumes a relatively large amount of memory because it spawns many processes that each handle one connection at a time. Prefork […]
Install the APC Opcode Cache
Note: This is an old article, and the APC Opcode Cache is now abandoned. Strongly consider installing Zend OPcache instead. APC is now effectively unsupported, although you can still install and use it. Furthermore, OPcache is included in the PHP core as of PHP 5.5, and OPcache is also available and fully supported for PHP […]
Back Up MySQL Databases
A simple bash script to back up MySQL databases. This backs up every database on the server to individual gzipped files in the directory you specify so that you can easily restore them separately. If you want it to run everyday, save it with an .sh extension and add it to the crontab of an […]
Drupal Installation and Performance
These are some notes on Drupal installation and performance on Unix-like operating systems (using Ubuntu here). Drupal Installation Install MySQL and create the database and Drupal database user first. If you must use apt or yum to install Drupal, don’t try to install everything at once. If you can avoid it, don’t install Drupal from […]
Migrate Zope/Plone from CentOS to Ubuntu
I don’t use Zope and Plone anymore, but if you’ve played with Zope/Plone you know they are highly proprietary, fragile, missing a lot of desirable functionality, and overall pretty painful to manage. About the only thing I really ever liked about them was the relative ease of integrating Python libraries and code. Regardless, I sometimes […]