3 ways to remove blank lines from a file
There are certainly more than 3 ways to do this. Typically I’ve always used sed to do this, but here’s my method using sed and two other methods using tr and awk: sed: sed '/^$/d' file_with_blank_lines...
View ArticleConverting a WordPress site to a static site using Wget
I recently made a YouTube tutorial on converting a WordPress site to a static HTML site. This blog post is a companion to the video. First of all, why convert a WordPress site to a static HTML site?...
View ArticleRenaming multiple files: replacing or truncating varied file extensions
In the previous post, I ran into an issue where Wget saved files to disk verbatim, including query strings/parameters. The files on disk ended up looking like this:...
View ArticleMinor improvements to legacy Perl code
We’re always working with code we didn’t write. You’ll spend far more time looking at code you didn’t write (or don’t remember writing) than you will spend writing new code. Today I looked at an...
View ArticleDirectoryIndex on a static HTML site hosted by AWS
Apache’s mod_dir has a DirectoryIndex option so that if you request a directory, it can return the index document for that directory. For example: https://www.example.com/dir/ would return...
View ArticleHosting a static site on AWS using S3 and CloudFront
A few years ago, Michael Berkowski gently scolded me for hosting a site on HTTP — not HTTPS. I decided that the easiest way to fix this (ignoring Let’s Encrypt for now) was to instead host the site, a...
View ArticleExtracting links from Google Sheets
I was working with a shared Google Sheet at work and ran into this: An excerpt of a Google Sheet. Each row contains a cell with a hyperlink labeled Link, but the actual URL is not displayed. I get it,...
View Articleicinga2 and http_expect_body_regex
This check (along with the other accompanying http variables) tries to confirm that the page includes an IP address or subnet: http_expect_body_regex =...
View ArticleDefault version of Python on Rocky Linux 8
Some questions came up at work today about the default version of Python on Rocky Linux 8. Someone said it was Python 3.6.8, others said it was Python 3.9. I decided to test this empirically and...
View ArticleJACODA – JAvascript COmpact DAta notation
On a lark, I made up a new JavaScript notation for representing tabular data: JACODA, or JAvascript COmpact DAta notation. The idea is that many JSON datasets are really just CSV files, except that the...
View Article