PDO, or PHP Data Objects, is a database abstraction extension that allows you to use a common set of commands to access any database for which PDO has a driver. This includes MySQL and compatibles (e.g., MariaDB), PostgreSQL, Oracle, Microsoft SQL Server, IBM DB2, SQLite, and others. While it’s nice not having to rewrite all […]
Author: Geoff Stratton
PHP: List Last Updated Files
An old PHP script to list the most recently updated files within a web site using their ‘last modified’ time stamps.
Python: Statistics Calculators
Some statistics calculators written for Python 2.x (the str.format() method requires Python >= 2.6). Of course you could just use the numpy or statistics libraries, but where’s the fun in that? All solutions verified where possible by Wolfram Alpha or else by EasyCalculation.com.
Python: XML-RPC Requests
Tinkering with Python xmlrpclib, in this case for updating a WordPress blog from the command line. Using Python 2.7.6 here. xmlrpclib is included with Python 2.7, but if you need it, install with Pip.
WordPress Plugin Development Tutorial
This article is intended to serve as a simple WordPress plugin development tutorial. For the purpose of demonstration we’ll create a plugin that removes comment spam. For this to work, you have to be running some sort of anti-spam system like Akismet that marks spam comments as such when they’re submitted. Comments are written into […]
C#.NET: Doc/Docx to Simple HTML Converter
I have this problem: mo matter what my official job or title, people keep sending me Word documents that they want posted online to match the web site styling. Yes, you can use Word to convert documents to HTML, but Microsoft’s version of “HTML” resembles the Rohonc Codex — little has changed since the days […]
C#.NET: Countdown Timer
This is a simple Windows Forms countdown timer I created a few years back. I’d start something in the kitchen, get distracted on the computer, and then burn whatever I was cooking, so I built this to warn myself. The program takes user input into a masked textbox, uses the Systems.Windows.Forms.Timer class to count down […]
Web Server Performance 2016
This is a shorthand summary of web server performance and caching systems as of March 2016. General disclaimer: I try to link benchmark results that seem relatively neutral, but as with any survey or study or benchmark roundup, the most pertinent question is cui bono? Ultimately the only reliable benchmarks are those you run yourself […]
Securely Erase a Hard Disk
The only method I use to securely erase hard disks is ATA Secure Erase using the hdparm utility. Be sure to read the disclaimers and warnings at kernel.org carefully, since secure erase doesn’t work with all configurations and may brick your drive. The primary benefit of ATA Secure Erase is that it erases 100% of […]
CentOS 7: Kickstart Script
Basic CentOS 7 Kickstart installation script for setting up servers automatically. To use, create a bootable disc containing the script below in the /isolinux directory and type linux ks=cdrom:/ks.cfg at the boot: prompt.