I recently installed Ubuntu on an old Mac Mini, and I ran into a problem where I couldn’t get a bluetooth keyboard to wake the device (actually a Harmony Hub remote, but it presents itself as a bluetooth keyboard). I did some digging and found this offline page which describes a method for enabling wake-from-suspend for USB devices. This is an attempt at slightly simplifying this.
Here’s what I do when I want to set up a Jest on a React project.
There’s lots of various writeups out there on how to do this, but this one is mine. In this article, we’re going to explore setting up Pi-hole on a Raspberry Pi, and tunnel all our DNS queries to CIRA’s “Canadian Shield” DNS service using
cloudflared. Since I’m using CIRA as my DNS provider, I thought I’d also set this up in an official CIRA Raspberry Pi case:
I’ve been meaning to learn how to use jscodeshift for a while. Today we’re going to use jscodeshift to convert some old React 15
ref="container"code to some new React 16
This article is going to explore using winston and Elasticsearch to do “structured logging” in Node.js. The basic idea is that we want to write logs with some metadata attached to them, beyond just a timestamp, a level, and a message.
The traditional “twelve factors” approach to logging is just to write your logs to stdout, and let some extrenal process deal with logging. For example, you might use fluentd to read stdout on all your processes and write the results into Elasticsearch. This works well, and it works across different projects written in different languages. But, with a little extra work, we can write some extra information into those logs.
For example, for every request we could write the URL of the request to the log as
request.url, and then write the response time in milliseconds as
response.responseTime, and now it’s a simple mater to generate an Elasticsearch graph showing our average and max response time to HTTP requests, or even to write a query which finds the top ten slowest routes in our system. Or we could write a
userfield to the log on every request, so we can figure out which users in our system are most active.
subscribe via RSS