Author Archives: Patrick McGoohan

Renewing Let’s Encrypt SSL on a GoDaddy shared cPanel hosting account

[Updated 11/17 to reflect deprecation of Let’s Encrypt Mac OSX client.] What’s not to love about the free SSL certificates from Let’s Encrypt? They’re pretty simple to install, they’re secure, and — best of all — they’re free. The only downside is that they’re good for just 90 days (they do have their reasons) so […]

Using “du” to determine directory size

The *nix command ls returns lots of useful information, particularly with the -alh flags, to display permissions, owner, group, modification date, file name, and human-readable size for all files and directories within the current directory. Well, sort of. It falls short on directory size, treating the directory like a file and returning only the size […]

Adding an empty directory to a Git repository

Unlike with Subversion, one cannot add an empty directory to a Git repository. Naturally, there’s a way around this. Create a .gitignore file within the subdirectory and add these lines: # Ignore everything inside this subdirectory… * # …except for this file !.gitignore As the comments detail, the first line tells Git to ignore everything […]

Redirecting http to https with htaccess

Once a site has been transitioned to the https protocol, it’s important to redirect all legacy traffic through this protocol, with a 301 “permanently moved” status code, so the change can propagate fully. Otherwise any site with a now-outdated a link to the http version will continue browsing that version, handily and unknowingly circumventing all […]

Deploying Let’s Encrypt SSL to a GoDaddy shared cPanel hosting account

[Updated 11/17 to reflect deprecation of Let’s Encrypt Mac OSX client.] Thanks to Let’s Encrypt, free, reliable SSL certificates are now widely available. And while some hosting companies (like Dreamhost) have made the process of installing and renewing Let’s Encrypt certificates point-and-click simple, others <cough>GoDaddy</cough> aren’t quite so forward-thinking, so one has to get one’s […]

Fixed Screen Width Mode in Firefox

Need to browse a site at a particular screen dimension? Launch Firefox, then press Command + Option + M  (on a Mac) to enter Fixed Screen Width Mode. Different dimensions (e.g. 320 x 480) are available via the presets dropdown or drag the sides or corners to customize the dimensions. Click the arrow button to […]

Installing EFF’s certbot locally on a mac

[Updated 11/17 to reflect deprecation of Let’s Encrypt Mac OSX client.] While it’s preferrable to install Electronic Frontier Foundation‘s certbot* on your hosting environment (so certificate renewal can be automated via cron), you’ll need root access to do so, in order to install dependencies. For those situations where that’s not possible, (such as a site hosted […]

How to prevent WordPress from overwriting your rewrite rules

Provided the permissions are properly set on the .htaccess file, WordPress will update it with its own rewrite rules whenever the “Save Changes” button on Settings > Permalinks is clicked, like so: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] […]

Case-insensitive RedirectMatch

RedirectMatch rules are, by default, case-sensitive: # ‘Old-Page.htm’ will result in a 404 error RedirectMatch 301 ^/old-page.htm$ http://new-site.com/ To make a RedirectMatch rule case-insensitive, add (?i) to the start of pattern: # Will redirect properly regardless of capitalization: RedirectMatch 301 ^(?i)/old-page.htm$ http://new-site.com/

Pushing a local repository to GitHub

One of Git’s strengths is the ability to configure a repository locally, so you can dive right into an idea regardless of whether or not you have a reliable (and secure) internet connection. Once you’re ready to share your code, one of the easiest and cheapest ways to do so is to import this local […]