Monolith–Download Web Pages Into a Single HTML File

Monolith is one of a number of tools available to save a web page and all of its assets into a single downloaded HTML file.

Unlike the conventional “Save page as”, monolith not only saves the target document, it embeds CSS, image, and JavaScript assets all at once, producing a single HTML5 document that is a joy to store and share.

If compared to saving websites with wget -mpk, this tool embeds all assets as data URLs and therefore lets browsers render the saved page exactly the way it was on the Internet, even when no network connection is available.

Monolith is cross platform so it works on Linux, BSD, macOS, and Windows.

I typically rely on Single File to auto-capture and save web pages as I browse, but having more tools like this is always good.

Ensuring Hard Drive Data Is Securely Destroyed

I ran across this Hacker News discussion about ShredOS, which is a utility designed to securely erase data from a hard drive.

This is one of a number of available tools that attempt to render data unrecoverable by overwriting the hard drive with other data. ShredOS has an impressive number of options, from a basic “fill the device with 0s” to DoD 5220.22M compliant wiping, which requires overwriting the data 7 times.

The Hacker News discussion notes that this doesn’t really work for SSDs, and there is some discussion about alternative methods for those.

I used to use tools like this when disposing of hard drives, but instead, opt for this process now:

  1. All the drives I use are encrypted with a long, unique passphrase key.
  2. When I’m ready to dispose of a drive, I change the encryption key to a random string that I do not record anywhere.
  3. Have the drive physically destroyed.

A bit paranoid? Absolutely, but a small price to pay to never worry about that drive again.

0.30000000000000004.com

LOL. So, errors with floating point math in programming languages are such a common question that someone built an excellent website–0.30000000000000004.com–to explain this to folks.

The title refers to the fact that .1 + .2 will frequently be represented as 0.30000000000000004 because of how floating point systems represent repeating decimals.

The site includes language-by-language examples of how simple operations such as .1 + .2 are handled by popular programming languages.

Generate A List of Calendar Dates

This is a nice online tool for generating a list of calendar dates.

For my purposes, I needed to generate a list of all dates for specific years going back to the 1980s.

The tool has a robust set of options that let me specify the date format to exactly what I needed and even add a “.md” extension at the end of each date because, ultimately, this list gets fed into a tool that outputs empty Markdown files.

Calendar Date Generator Options
Calendar Date Generator Options

Generating Empty Text Files from the Windows Command Line

Recently, I needed to generate a large number of empty text files for a project and looked for the best way to automate this.

I’m certain there are numerous ways to accomplish this, but I found a quick Windows command line method of doing so.

First, create a text file that has the filename and extension for the files. In my case, I needed to make a file for each day of a specific year in the past, so I created a files.txt file that looked something like this:

2008-01-01.md
2008-01-02.md
2008-01-03.md

I saved that in a folder on my laptop’s C: drive, then navigated to that folder from the Windows command line.

From there, the following command will read the files.txt file and create a new file for each line in that directory:

for /f "delims=" %F in (files.txt) do copy nul "%F"

From there, I was able to move the files to the application directory where I needed them and begin processing them.