TIL: auto-input yes/no/anything to command prompts

Have you ever been running a script or command, and just want to easily pass “yes” to all prompts? It turns out there’s a simple command for that: yes.

Piping yes to a script will provide every script prompt with a y response. In fact, yes can take a single argument, allowing us to customize the text we want returned (eg. yes n will return n to every script prompt). According to the man page, yes was written with a specific use-case in mind:

Screen Shot 2018-08-15 at 1.29.40 PM

My own use-case is much less aggressive: pruning stopped containers.

Screen Shot 2018-08-15 at 1.39.27 PM.png

TIL: Node app deployment with SSL

I thought SSL certificates with a DigitalOcean VPS were easy; then today I learned to deploy a Node app with Now by Zeit.

Following their basic tutorial, I deployed an example app in seconds. Then after creating a CNAME record for a subdomain, I linked the two together, and had my subdomain live with a valid Let’s Encrypt certificate installed and ready.

Screen Shot 2016-06-25 at 2.05.08 PM.png

Everything about working with Now is very refined and the essence of simplicity – from their CLI, to their password-less logins and modern, minimalist account interface. It feels light-years ahead of any other hosting and deployment tooling I’ve played with. (Note that mapping custom domains is part of their Premium plan, but they also provide a free OSS Plan that allows more human-readable URLs than those generated by default.)

TIL: HTTPS sites are not so hard any more.

Like many, I was curious to see how the Let’s Encrypt project would roll out in the real world. I remember looking at documentation for setting it up when it first came out, and quickly moved on – it seemed complicated and laborious (still, pretty great for a free SSL cert).

Now that it’s been around for a while (WordPress.com custom domains use Let’s Encrypt certs), I thought I’d check again how difficult it would be to throw it on a random domain of mine. I reactivated my DigitalOcean account, spun up a VPS, did some basic setup, and nabbed a new domain (a 6-letter domain, $8 for 5 years, wut) for fun. After waiting overnight for DNS propagation, I banged through three quick tutorials for Nginx, PHP7, and Let’s Encrypt – and had my cert up and running. Not a bad server setup for ~$5 a month and next to no effort.

(Edit, September 2, 2016: “my cert up and running” link is dead as I’ve deactivated my DigitalOcean account; turns out I only need ZEIT now.)