View from my office


Today in WTF-UX

“Read on”

Just kidding.


How is it?

2020 and I only just now listened to in full.


Make it work

I <3 the simple “legend” used here to indicate which bands are supporting each date on this tour. There’s a minor coding mistake- do you see it?-, but the technique is simple and it works so well.


Context matters


Tods Law

Each thing you do spawns new things to be done.

my Theorem of doing stuff


Several People Are Typing

Dad, what was work like before Slack?

Formless and empty, darkness was over the surface of the deep, and the Spirit of God was hovering over the waters.

Dad! Stop it. Seriously what was it like?

Less hurried. More thoughtful.

That sounds nice. Can we go back to that?

No. We only go forward.

Uncategorized unix

How I use ChromeOS’s linux containers

When you enable “Linux” on ChromeOS, a default Virtual Machine is created (and a default linux container). VM’s are the layer above containers- each VM can house multiple containers. The default VM is named “termina” and once it exists, you can interact with it from crosh (The Chromium OS Shell) using the vmc command. The default container is named “penguin”.

Note, for my purposes, I create a second VM named wpvm and then create containers within that VM. This makes it fast and easy to spin up Debian environments (I’ll try to cover other container types in a later post) for whatever your needs may be. The --enable-gpu is optional. YMMV.

First, open a crosh window (ctrl-alt-t). Then, to create and start a new VM named “wpvm”:

crosh> vmc start --enable-gpu wpvm

After the above VM is created, you’ll end up at a shell prompt within the VM. A potential point of confusion, the prompt below shows “(termina)” when we’re actually in a VM named “wpvm”. The “(termina)” here refers to the VM image ChromeOS uses for all VM’s. Keep calm and keyboard on.

(termina) chronos@localhost

From here, exit the VM using ctrl-d

Now let’s create a container within the new “wpvm” VM. We’ll use Google/ChromeOS’s standard Crostini container, “stretch”:

crosh> vmc container wpvm stretch

If everything worked, you’ll find yourself signed into the new Debian Stretch container with a bash prompt:


If you want to verify the VM and the container were created and running, you can open a new crosh window (ctrl-alt-t), list the available VM’s, shell into the “wpvm” VM using the vsh command (reminder, this puts you into the VM, not the container) and then check the status of any running containers with:

crosh> vmc list
 Total Size (bytes): xxxxxxxxx
crosh> vsh wpvm
 (termina) chronos@localhost ~ $ lxc list
 |  NAME   |  STATE  |         IPV4          | IPV6 |    TYPE    | SNAPSHOTS |
 | stretch | RUNNING | (eth0) |      | PERSISTENT | 0         |

To shell into a running container (obviously, the associated VM must also be running):

crosh> vsh wpvm stretch



’93 Landcruiser still rocks


WP Dev with Docker

I got stuck for a bit today on how to configure a PHP PDO connection in a Docker based WordPress dev env. Here’s the function…

 * Get the database connection
 * @return \PDO database connection instance
public function get_connection() {
    $dbname = \TMSC\tmsc_sync()::$tms_db_name;
    $username = \TMSC\tmsc_sync()::$tms_db_user;
    $password = \TMSC\tmsc_sync()::$tms_db_password;
    // Build the DSN string
    $host = \TMSC\tmsc_sync()::$tms_db_host;
    $port = '3306';
    if ( strpos( $host, ':' ) ) {
        list( $host, $port ) = explode( ':', $host );

    $dsn = "mysql:host={$host};port={$port};dbname={$dbname}";

    $connection = new \PDO( $dsn, $username, $password, array(
    ) );

    // Since MySQL supports it, don't automatically quote parameters to allow control over data types.
    // This comes in useful for automatically manipulating the LIMIT clause.
    $connection->setAttribute( \PDO::ATTR_EMULATE_PREPARES, false );

    // Uncomment to enable connection debugging.
    $connection->setAttribute( \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION );

    $this->set_mysql_global_defaults( $connection );
    return $connection;

When this function connects to a Remote AWS/RDS database, we configure it with a FQD for the $host variable. But, when running the same function locally, within our Docker setup, we must use the docker container name “jetpack_mysql” (as defined in the docker-compose.yml file) and not “” or “localhost”.