You run a medium-to-large size MySQL server with lots of databases, possibly for hosted websites. You've experienced performance degradation. You've fine-tuned your database engines, and no joy. Then you finally realise you need to run mysqloptimize, and the day is saved! Good on you. Of course, running mysqloptimize on a large server still takes half an ice age.
recipes
Cleaning Up a Debian APT Archive Cache
You have a Debian, Ubuntu or similar installation, and your /var partition keeps getting full when you upgrade. You check /var/cache/apt/archives and find it full of the usual mix of current and old versions of downloaded packages. Somehow, they haven't been deleted after installation, or you keep downloading them but not installing them. You now need a quick and clever way of cleaning up this mess, so only the latest version of each package remains.
Too Many Unknown PCI Devices
You just bought a shiny new motherboard, but the Linux kernel doesn't recognise some (or all) of the on-board PCI devices. Time to panic?
Renaming MP3s
Let's say you have a large collection of incorrectly labelled, or downright unlabelled MP3 files arranged in directories by artist. Each artist directory contains one subdirectory per album, with untagged files under them. You need these files ID3-tagged with some basic information, namely the artist and album.
Pascal's Triangle in Python
You need to generate Pascal's Triangle in Python, and you're lazy (an admirable trait). Alternatively, you're looking for a Pascal's Triangle generator that can show really high-ranking rows, ones with multi-hundred-digit (or multi-million-digit) coefficients.
Pascal's Triangle for LaTeX
You need to display Pascal's Triangle in a LaTeX document and whenever you hear ‘ampersand’ or ‘smallskip’, you go into a homicidal rage, leaving behind you a trail of viscera and blood-stained Lion Book pages. Also, you're lazy. Put that chainsaw down, this recipe is for you.
Linux RAID One-Liners
Here are some useful one-liner recipes to help manage Linux Device Mapper (sometimes also known as ‘software RAID’) devices. These are too short to warrant separate recipes. They're here because I need them for myself: no matter how many times I've done this, I always check again.
Flatten a Directory Structure
You have a deep directory tree of files, and you need to flatten it into a single directory, so that there are no files in subdirectories, and all the files are in the same place.
Detecting ‘Idle’ and ‘Away’ Timeouts in Javascript
A short Javascript program to improve detection of users idling or away from their keyboards, which should in turn improve how online users are detected. The file works with both jQuery and Prototype. It autodetects which is available at load time.
Cleaning Up a Debian APT Archive Cache
You have a Debian, Ubuntu or similar installation, and your /var partition keeps getting full when you upgrade. You check /var/cache/apt/archives and find it full of the usual mix of current and old versions of downloaded packages. Somehow, they haven't been deleted after installation, or you keep downloading them but not installing them. You now need a quick and clever way of cleaning up this mess, so only the latest version of each package remains.
