Static site generator «Hugo 0.55.1» was released, with three bug fixes. Go static! 🚀 #gohugo #jamstack #golang #webdev
RC Logr 20190412 233559 - Static site generator «Hugo …Welcome
Rick’s short, technical tip microblog built with Hugo, powered by Deno Deploy. See also my fabulous repository at Github for this site.
12 Apr 2019
MacOS or Linux users, you might find log file viewer «lnav» useful. It is for viewing local log files, and requires no server like Splunk. Fire it up, press ?
to toggle help or /
to search. 🕵🏻
11 Apr 2019
The first black hole “photo” is incredible, and before her credit gets sucked into said black hole, it was Dr. Katie Bouman came up with the clever computer algorithm to capture it. She explains how, from the TED stage. (Say it in @GuyRaz’s voice) What an inspiration to young women considering a career in STEM! 👭
A couple of technical tidbits:
- the black hole is so far away, 53 million light years, that it required use of the planet-sized EHT or Event Horizon Telescope. The EHT is 8 observatories across the globe, using interferometry to combine the data.
- there was petabytes worth of data, and it had to be ferried around via essentially “sneakernet”, since some of the locations don’t have good Internet connections and there was simply too much data to send via wire.
- Dr. Bouman herself has said it was a team effort, and indeed it was a team of 200 astronomers world wide.
- Scientists on the team estimate the mass to be 6.5 billion times as massive as our sun.
Read about it here from MIT news office.
RC Logr 20190411 071927 - The first black hole …10 Apr 2019
Saw @AdobeType post that they are adding the #Reiwa era single-kanji character to their Japanese type faces such as Source Han Sans. This is the single-kanji version of the era name, like the Unicode ㍻ U+337B «square era name heisei». 🇯🇵
RC Logr 20190410 093015 - Saw @AdobeType post that they …Turns out birds are not so bird-brained after all, per the «Birdsong» episode of the fantastic 20000 Hz podcast @20korg (20K Hz is the typical upper limit of human hearing). Birds have a pharynx like humans, but sing with their syrinx, an organ at the base of the trachea. 🐦🐧
Some awesome examples from the episode:
- the New Zealand kokako can produce organ-like chords
- the African Grey Parrot can mimic human speech
- Mockingbirds can mimic other birds and even frogs
- the Australian Lyre bird and its uber-complex syrinx can mimic whatever it hears!
It’s worth a listen, and birds are cooler than you might imagine!
RC Logr 20190410 075101 - Turns out birds are not so …09 Apr 2019
PSA: A serious bug was discovered in Apache, the web server that powers a lot of the internet. Vulnerability CVE-2019-0211 allows scripts to be executed with root privileges, allowing system takeover especially on shared hosting environments. 🐞☠️
Apache foundation released patched version 2.4.39, so confirm and update (or request an update):
|
|
You might need to confirm from your “control panel” in a shared environment. Note that Apache sysadmins can make settings to block these tools from getting any details about the web server. Same caveat applies, but you can also put <?php phpinfo() ?>
in a file like info.php
, then serve and access it.
After upgrading to static site generator «Hugo 0.55.0», building with hugo server -D
returns a couple of non-fatal warnings that should be corrected. 🐞
- The
.Site.Pages
includes section pages so you might need to change it to.Site.RegularPages
. I was building anindex.json
for searching and relying on it to supply data to a script, but after the upgrade, the index included pages with no content. To fix, I just changed to the latter. - When you get
Page's .Hugo is deprecated
you just need to change from something like.Hugo.Generator
tohugo.Generator
in your<head>
. .GetParam
is being deprecated, so see if you can just access the param directly. For example, indicating what posts are in draft form:
|
|
Static site generator «Hugo 0.55.0» was released, we got a lot of great new features to play with, and it is even faster and more flexible. Go static! 🚀
RC Logr 20190409 071904 - Static site generator «Hugo …08 Apr 2019
Today I learned about «Lynis», an agentless security auditing tool for *nix
-based systems, that lets you do compliance testing e.g. for HIPAA or SOX, pen testing, vulnerability detection to help you harden systems. I ran it and it appears to work well and returns useful suggestions after it runs, e.g. install this, disable that, confirm the other. 🤖
This is what the first few lines of the results look like:
|
|
(via @binitamshah on Twitter)
RC Logr 20190408 145501 - Today I learned about «Lynis», …«Cargo Cult» programming is a waste of time and effort. The best way is to understand fully, so do not ritually include features that serve no purpose, nor copy-paste code you do not understand. ✈📦
RC Logr 20190408 061136 - «Cargo Cult» programming is a …06 Apr 2019
I often need to replace dates in the frontmatter of markdown files, in «RFC 3339» format for content in static site generator Hugo. A simple shell function using gnu date, sed, head and pbcopy puts the current timestamp on the clipboard easily. 👻
|
|
Here is how it works:
- Gnu date with the
--rfc-3339
switch gives us a timestamp like2019-04-06 18:38:19+09:00
, is piped to… sed
which replaces the space with a T, then that is piped to…head
to remove the trailing newline, which is finally piped topbcopy
to put the result on the clipboard (MacOS only).
Then just paste it where you need it. By the way, the timestamp means “18:38:19 in the timezone +9 hours ahead of GMT”, or, Japan time.
RC Logr 20190406 181729 - I often need to replace dates …05 Apr 2019
You can use the Haversine formula to approximate the «great-circle» distance between points on the globe, to get, say, the distance between map locations expressed in latitude and longitude. 🗺
You can see it in use in this javascript around line 247, the meat of which is this:
|
|
To avoid storing a credential in command line history, you can store it in a file and use cat
to insert it when you need it. 🤓 Say you have your API token stored in /path/to/token
, here is how you might use that:
|
|
03 Apr 2019
If you use Win 10 64 bit, you can install the «Windows Subsystem for Linux» from Control Panel, Program, Turn Windows Features On or Off. Select it, OK and restart, then install your Linux distribution from the Windows Store - Ubuntu, Debian, openSUSE, even Kali for pen testing. 🤖 What else?
- Install Linux programs
sudo apt-get install jq
- Switch to
zsh
- Mount drives
sudo mount -t ...
- Run shell scripts
- Use Windows Run, Open to run Linux commands
bash -c "somebin"
- Upgrade your selected Linux
You can even possibly run graphical Linux programs, although this subsystem is not designed for that.
RC Logr 20190403 093056 - If you use Win 10 64 bit, you …01 Apr 2019
The new Japan era name is «Reiwa» 令和, the 239th such era, which comprises daily-use kanji rei 令 and wa 和, which could be translated as auspicious or orderly or calm or command, and peace or harmony, respectively. 🇯🇵 A couple of data points about the two characters are as follows:
令 Rei | 和 Wa | |
---|---|---|
Past Eras Containing | 0 | 20 |
JIS Code | 4E61 | 4F42 |
UTF16 Unicode | 4EE4 | 548C |
Strokes | 5 | 8 |
Old Variant | 龢 | |
Taught in Grade | 3 | 4 |
JLPT Level | 2 | 2 |
These details come from Jim Breen’s awesome WWWJDIC and Wikipedia. Software people can note also that there is a Perl library Date::Japanese::Era for Japan era conversion, by Twitter user @miyagawa. And the Unicode blog has a post about character code U+32FF, the one-character representation of the new name.
There were a few eras which were only a couple years long and even 1 year or less in the case of the Genji era, but the average for the last four is about 37 years. Will I last another era?! 🙀
RC Logr 20190401 134646 - The new Japan era name is …I was disappointed in this incredible article by Hans van «Hook», because it mentions the low angle of the sun in winter, without citing the angle. It is 30~46 degrees from vertical in Tokyo, so position those solar arrays with abandon. 🌞
RC Logr 20190401 073544 - I was disappointed in this …Welcome to April. The color palette on my Logr site this month was picked thinking of the pinks of 桃 «Momo», Sakura and Plum blossoms as well as the beautiful greens of breaking spring. The birds are singing in our back yard and the uguisu is back too. Ah spring! 🌸
Hugo Pipes is what enables weaving Sass variables into site code, to make it super simple to change the color scheme with a couple variables to define the scheme for the month.
|
|
31 Mar 2019
An «L» on a sock is ambiguous as it could mean left or large assuming English, so if you pick one of a pair up and get an L, then the other must be checked. If you pick and get an R, chuck that puppy on your right foot. 🕵🏻
RC Logr 20190331 115301 - An «L» on a sock is ambiguous …28 Mar 2019
Ever need a super simple way to show hidden files in Mac Finder or a File Open dialog, just press cmd-shift-.
to toggle. macOS and its predecessors are unix based, and unix hides files or folders that start with a period, hence its use in this binding. 🕵🏻
To make it permanent:
|
|
Slap a NO on the defaults command to reverse it. Also, you can ctrl-opt-click
the Finder icon in the Dock, to access the Relaunch command.
I love the zsh
configuration framework «prezto». Browse the runcoms folder for all the basic rc-type config files, and the modules folder for functions that you can load. 🤠 Switch into a module folder to display its readme. Edit the zpreztorc
runcom to select modules to load and make settings. Run the built-in function zprezto-update
to update. It:
RC Logr 20190328 165103 - I love the zsh configuration …enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.