A Redis object cache for WordPress

Written late at night in English • Tags: , , , ,

WordPress Site Health had been nagging me to use a persistent object cache. I already run Zend OpCache, so I wondered what else I needed.

OpCache is an opcode cache: it stores the compiled bytecode of the PHP source so the engine need not recompile it on every request. The object cache is a different layer, holding the results of database queries and transients. WordPress ships with a non-persistent object cache that lives only for the duration of a single request; making it persistent means backing it with something that survives across requests, such as Redis.

On this site I manage the WordPress tree with svn and do not let PHP write into it, which changes a couple of the steps from the usual click-in-the-dashboard instructions. While I also generally prefer nginx and PHP-FPM, this site is still on Apache with mod_php. However, the installation is basically the same regardless of the web server software, but troubleshooting differs between them. I’m covering both here. (more…)

Installing AI CLI tools

Written early in the morning in English • Tags: ,

I dedicated a VM for running AI CLI tools. Consider it a kind of a sandbox, if you will. (more…)

»
Some git workflows that I don’t do too often. (more…)

Refreshing old Terraform state

Written at evening time in English • Tags: , ,

If you find yourself with an old Terraform state file (say from v0.11) and you need to run terraform plan to check things out, you’ll need to make some adjustments:

  • Add a terraform block with required_providers to provide the source for the provider.
  • Remove the version statement from the provider block. (You will want to move it to the provider in the required_providers block.)
  • Adjust any other syntax changes that result in errors (terraform plan):
    • list()tolist([])
    • type = "string"type = string
    • Possibly many others…
  • Replace the provider in the existing ancient state file.
  • Refresh the providers (terraform init).
  • Plan away! (more…)

Released tcsh 6.23

Written late in the morning in English • Tags: ,

I am pleased to announce that tcsh-6.23 is now available; this is mainly a bug fix release (after 2 years) with a couple of new features:

  1. Add jobs -Z to setproctitle(3)
  2. Add ln=target in LS_COLORS
  3. Add a :Q modifier that preserves empty arguments

Please consult the Fixes file for a complete list of changes. (more…)

»
Today I wanted to use phpMyAdmin for the first time in quite a while, only to see errors when viewing a table. Lucky for me, there was an easy fix. (more…)

Blockquoted code blocks, part 2

Written late in the morning in English • Tags: ,

For seven years I’ve maintained a small patch to PHP Markdown Extra. However, the upstream was not happy with it, so I just kept my local copy patched. Now I’ve given in: as Markdown has become very popular, it has been better to just adopt a syntax that works across different implementations (e.g. with GitHub Flavored Markdown). (more…)

»
I’ve been switching my NetBSD machines to using a serial console lately, as it is easier to copy output from it (no more screen shots). (more…) (2)

Nested screens

Written at lunch time in English • Tags: ,

I occasionally want to run nested screen sessions and this configuration allows me to use the same control character for both the inner and outer sessions by switching between them. (more…)