Rick Cogley's Tech Logr

Short Technical Laser Bursts %%

Welcome

Here be my pithy, short, technical nuggets. Maybe I’m the only one who cares. Who says Hugo can’t be used for microblogging‽

01 Jun 2020

«19:06:58»

I like the Mac utility «ImageOptim» for crunching down my image sizes, and there is a good 3rd party app called «imageoptim-cli» that facilitates batch automation and incorporates other utils as well. Sweet! 🗜

RC Logr 20200601 190658 - I like the Mac utility … Rick Cogley

13 May 2020

«19:34:30»

Learned about two cool apps by Adam Newbold at @neatnikllc - «Salty», a simple secure encryption site and «omg.lol» an email forwarder and simple web page host. 😎 Lots more on their portfolio too, check it out: https://neatnik.net/work/

RC Logr 20200513 193429 - Learned about two cool apps by … Rick Cogley

11 May 2020

«11:22:19»

If you are making DNS changes, you may want to flush your local dns responder cache, so here is how to do it. 🤖

On a modern Mac, put it in a shell function (c.f. zsh):

1
2
3
4
5
6
function flushdns (){
  echo "Flushing DNS, enter your user password if prompted:"
  sudo killall -HUP mDNSResponder
  sudo killall mDNSResponderHelper
  sudo dscacheutil -flushcache
}

On Windows, do this in a command prompt:

1
  > ipconfig /flushdns

On Linux, it can be app by app or, on Ubuntu/Debian, you can do either of:

1
2
  $ sudo systemd-resolve --flush-caches
  $ sudo /etc/init.d/dns-clean start

RC Logr 20200511 112219 - If you are making DNS changes, … Rick Cogley

10 May 2020

«18:26:23»

So Zoom acquired a beloved crypto app Keybase, and the announcement blog post is so fuzzy and laden with corporate double-speak, it feels almost certain that Zoom will sunlight the app. How unfortunate. Big windfall for @malgorithms and co, big fuck you to Keybase users. 🖕🏻

RC Logr 20200510 182623 - So Zoom acquired a beloved … Rick Cogley

«17:45:59»

Many static site generators like Hugo have a built in dev web server. If you are just building some html with css, and need a simple solution to serve the files from any folder, you have a few solutions. See a couple of options:

Node.js users can install and run http-server:

1
2
3
4
npm install -g http-server
cd /path/to/my/working/folder
http-server --help
http-server

Visit http://localhost:8080 and look at the help to change the port.

Python 3 users can run:

1
python -m http.server 8080

Or with php:

1
php -S localhost:8080

Then if you use zsh put it in a function in your ~/.zshrc:

1
2
3
function serve-it (){
  php -S localhost:8080
}

RC Logr 20200510 174559 - Many static site generators … Rick Cogley

«17:37:30»

An rsync command I was using in a git hook was giving an error regarding permissions not getting copied properly. I was copying to keybase kbfs, so it makes sense that it differs from standard Mac permissions. I fixed it by changing -a to -rlOtcv. 👍

In .git/hooks/pre-hooks:

1
2
rsync -rlOtcv  --exclude '.git' /Users/myuser/dev/myuser.keybase.pub/ "/Volumes/Keybase (myuser)/public/myuser/"
exit 0

RC Logr 20200510 173730 - An rsync command I was using … Rick Cogley

«06:24:45»

Twurl uses ruby and broke, so I switched to CLI tweeting via a little golang utility called «twty». 🤓

One of golang’s main ideas is to allow apps to be installed easily on any platform, without needing to hassle with dependencies (Ruby, Python, I’m looking at you here). It’s lovely. Assuming you have golang setup, you just do:

1
$ go get github.com/mattn/twty

… and boom.

RC Logr 20200510 062445 - Twurl uses ruby and broke, so … Rick Cogley

03 May 2020

🗓 "Constitution Day" in Japan

«18:21:44»

There’s a cool blocks-based editor project called «editor.js» that outputs clean json, which is predictable when integrating with other systems (similar to how Notion’s editor works). I was wondering if there is a list of sites that use it, or a showcase of some kind, and learned that I can view a list of repositories that use it, via the Github “dependency graph”. Slick! 😎

RC Logr 20200503 182144 - There’s a cool … Rick Cogley

28 Apr 2020

«20:14:45»

Today I upgraded a Drupal site with drush, a convenient cli utility for Drupal, but managed to munge the site up. Fortunately I followed the usual steps, and used ./bin/drush archive-dump to back up prior to upgrading. It gives you a “Backups were saved into /path/to/backups/2020…” message, telling you where the backups were saved. This is my usual procedure:

1
2
3
4
5
6
7
8
9
cd /path/to/drupal/site
./bin/drush archive-dump
./bin/drush ups
./bin/drush sset system.maintenance_mode 1
./bin/drush cr
./bin/drush up drupal
./bin/drush up bootstrap //(etc, for instance)
./bin/drush sset system.maintenance_mode 0
./bin/drush cr

The problem was, I upgraded to the latest without checking my php version, and the drush up failed with some weird error that some helpful soul posted about on Stack Overflow. Since upgrading php to 7.7 from my lowly 5.x is fairly involved, I just compared and restored the backup core files to the production site folder, and did:

1
2
3
./bin/drush cr
./bin/drush sset system.maintenance_mode 0
./bin/drush cr

That fixed it.

RC Logr 20200428 201445 - Today I upgraded a Drupal site … Rick Cogley

12 Apr 2020

«09:54:33»

Everyone is saying stay 2 meters apart and I mentioned this in a previous post, but research showed that COVID-19 virus can travel up to 4.5 meters. That’s something important to keep in mind.

So, correcting my earlier post, that’s one wavelength apart at 75 Mhz! Joking aside, that’s terrifying.

RC Logr 20200412 095433 - Everyone is saying stay 2 … Rick Cogley

29 Mar 2020

«15:48:42»

A geeky-funny Ham radio take on the idea of social distancing in this image from Twitter user @ai6yrham. 😂

Remember:

1
λ = 300 / 𝑓 (in MHz)

Wavelength is c/𝑓 where c is the speed of light at 300,000,000 meters per second, so 300/144 ≅ 2 -ish. So stay 2m apart and stay safe, people.

RC Logr 20200329 154842 - A geeky-funny Ham radio take … Rick Cogley

20 Mar 2020

🗓 "Vernal Equinox Day" in Japan

«11:41:00»

We are not quarantined in Japan (yet), but here is an idea to squelch the boredom: get a radio that can pick up shortwave, and do some BCL or broadcast listening. Last night I heard Beijing news on «Peking Hoso 7220 Khz on 41mb» in Japanese, talking about Coronoavirus and newborn pandas! 🐼

I have a Tecsun S-8800 which is a well-regarded portable radio that will take external antennas if you want them, can receive FM, MW (AM), SW, LW. Tecsun makes the AN-200, an external AM antenna which you can connect with a stereo connector if your radio has an input for that, or (in the case of the S-8000) you just set behind the radio and tune via its knob. It’s pretty amazing and works to improve the sound of AM stations.

Other stuff I learned:

  • Some AM stations are also using “wide band” FM to transmit, so you get a much better sound.
  • There are tons of SW stations to check out, and shortwave will bounce off the ionosphere so you can hear it from far away (unlike FM or AM which seem to be regional). I heard a wide array of stations while surfing the SW stations, which were transmitting at night from Korea, China, Taiwan. A lot of news-sounding broadcasts, including Chinese lessons for foreigners on 7324 Khz.
  • SW’s hard to censor apparently, so a lot of people use it to transmit non-fake news from their countries.
  • Japan has news transmitted on SW out of various countries in Asia, in Japanese.
  • SW stations don’t transmit 24x7, and the Short-Wave.info site is easy to use to find what’s transmitting right now, and in addition has good basic info about this whole kaboodle.
  • If your radio or its remote can accept direct frequency input, you can input the station’s frequency instead of turning a dial again and again. Apparently SW radios have a main tuner knob that gets you to the main frequency area, then you use a fine tuning knob to clean up the signal.

RC Logr 20200320 114100 - We are not quarantined in … Rick Cogley

17 Mar 2020

«09:42:34»

I just love webhook.site. Simon Fredsted @fredsted has done such a great job on it, and the paid flavor is especially useful. 🤖🦾

It lets you set up a unique URL for receiving http actions POST, GET etc, and has a scripting language with which you can manipulate the inbound payload and take actions, parsing out json or xml. Really good stuff.

RC Logr 20200317 094234 - I just love webhook.site. … Rick Cogley

«09:28:39»

A little .gitignore tip: you can use regex to cover cases where reports you do not want in your repo have a date stamp. Nifty. 😎

1
2
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

RC Logr 20200317 092838 - A little .gitignore tip: you … Rick Cogley

12 Mar 2020

«09:26:39»

I tried using the Post feature in Slack, and found that pasting code is buggy, and that you cannot easily copy a Post from one Slack Space to another. Uglay. Why u so beta, Slack?! 🐞

RC Logr 20200312 092639 - I tried using the Post feature … Rick Cogley

12 Feb 2020

«14:24:49»

Read about this in the NY Times this AM - Prof Po-Shen Loh has re-introduced an ancient method for solving quadratic equations, which uses parabola symmetry as the key and provides cleaner proofs. Shh, squelch haters by not telling anyone that Babylonia was in present-day Iraq. 🤷‍♂️

RC Logr 20200212 142448 - Read about this in the NY … Rick Cogley

09 Feb 2020

«09:41:57»

Apple is deprecating «kext» kernel extensions from macOS 10.15.4. Check your /System/Library/Extensions or /Library/Extensions folders and follow up with 3rd-party software makers (think audio, firewall, USB driver, keyboard driver, antivirus). This means stronger security, but less hackability. 🍏

RC Logr 20200209 094156 - Apple is deprecating «kext» … Rick Cogley

08 Jan 2020

«11:19:37»

If you need to generate a uuid, say for a unique filename, on mac you can do it via the uuidgen utility. Combine it with tr to remove the punctuation, and use pbcopy to slap it on the clipboard if you need. 🆔

 uuidgen | tr -d - | tr -d '\n' | pbcopy 

RC Logr 20200108 111937 - If you need to generate a … Rick Cogley

07 Jan 2020

«21:05:57»

I used the Simple Event Correlator «SEC» on a past project, and it is still maintained. It helps you monitor event logs using regex to detect fraud or attacks, by assigning meaning to patterns. Deep & interesting. 🔐

RC Logr 20200107 210557 - I used the Simple Event … Rick Cogley

02 Jan 2020

🗓 "New Year Holiday" in Japan

«16:17:26»

I use the CLI utility «jq» from stedolan a lot to manipulate json, and just bought a helpful Mac app called «jqTerm», from @rem Remy Sharp. 🤓🔥

It is similar to the existing jq playground, but has a pretty comprehensive set of built-in examples that are easy to load and play with, and lets you save your jq examples to the jqterm dot com site for sharing. Sweet!

RC Logr 20200102 161726 - I use the CLI utility «jq» … Rick Cogley