Moving to HTTPS-only

All the web stuff at polarweasel.org should be encrypted-only now. In other words, when you visit a page on the blog, or on the main site, you should see the little lock-icon thingy — or whatever your browser uses — in the address bar.

For my own future reference, and maybe yours too, here’s what I did.

These sites are hosted on Dreamhost, which makes it really easy (two clicks) to get a Let’s Encrypt certificate. So I did that for the various sites.

Then, I forced the web server (Apache, in this case) to redirect all non-encrypted requests to the encrypted site instead. To do that, I added this sort of thing to each site’s .htaccess file:

# Force all connections to go over SSL
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://sitename.org/$1 [R,L]

(Writing it that way, with no conditions, should guarantee a 500 error if mod_rewrite is disabled for some reason.)

That’s all you need to do for a static site. For the WordPress sites, you need to do a couple more things: set the site URLs in the Settings – General menu to https instead of http, and add the following to the site’s wp-config.php file, right above the “stop editing here” line:

define('FORCE_SSL', true);
define('FORCE_SSL_ADMIN', true);

And that’s it. More or less.

Note: If any of your pages have hard-coded (http://something) links in them, including calls to CSS stylesheets or Javascript, instead of relative (/something) links, you’ll need to update those. Relative links are your friends; use them.

Love Your Nose

Dr. Robert Ivker: ‘Love Your Nose’ – A Holistic Approach to Sinusitis Treatment is a pretty terrible title, but a pretty great resource. Just following one element of the strategy (the garlic pills) fixed up a sinus infection for me in record time last month. I was already eating Paleo, and I did also load up on the probiotics for immune support, but the garlic was the obvious kicker.

And when I say record time, I know whereof I speak. Last year’s sinus infection was four months long. I eventually gave up on the industrial-strength antibiotics, because they were mostly just killing off everything good in my gut. (And boy, was that fun.)

BioLite CampStove

The BioLite CampStove is a brilliant idea. Burning some little sticks will cook your food and charge your phone (or other USB device) all in one shot. Nice.

I’d love to own one, but most of the time, I wouldn’t be able to use it here in Colorado (or New Mexico, or Utah, or all our other desert-type neighbors). Fire bans, and all. If we were move someplace wetter, though, I’d be all over this.

How to un-break HP printing on Mountain Lion (and Lion)

UPDATE A subsequent update fixed the problem. Or at least didn’t re-create the problem.

HP software update 2.10 came out recently for Lion and Mountain Lion, and causes apps to crash when you try to print. If this is happening to you, here’s what to do about it.

Delete this:

/Library/Printers/hp/PDEs/hpPostScriptPDE.plugin

(You’ll need to provide authorization, either with sudo or by giving an administrator password to Finder.)

There is no step 2.

Top 10 API Worst Practices

Programmable Web just posted a really nice list of 10 reasons why your API sucks. Or doesn’t, depending on how good your documentation and developer experience (DX? Do we really need another bullshit acronym, people?) are. The post also links to their own list of 5 attributes of a great API. Definitely check out the presentation slides in that post.

Note that a number of the bad things (unexpected and undocumented releases, poor developer experience, inadequate support, and poor documentation) and good things (provide great developer support) are documentation-related. How surprising. Yet another bunch of reasons you should add a good writer to your development team.