Rick Cogley's Tech Logr

Short Technical Laser Bursts %%

Welcome

Rick’s short, technical tip microblog built with Hugo, powered by Deno Deploy. See also my fabulous repository at Github for this site.

24 Feb 2019

«16:34:38»

Gotta remember the difference between the z-shell config files. The .zshenv loads first, and is sourced by all zsh instances, so keep it small and enter only environment variables that are needed by any shell, whether interactive or non-interactive, like $PATH. Next .zprofile is sourced just before .zshrc and is read only at login, and can be used for variables that do not change frequently, like flags for compilation. Then comes .zshrc which is executed at the start of an interactive session, and is used to define aliases, functions, shell options (e.g. for history, or your prompt) and any key bindings. The .zlogin file is sourced after the shell is fully set up, and usually compiles completions and maybe shows a “fortune”, or starts X on linux systems. At last comes .zlogout, which might be used to clear settings or release resources.

RC Logr 20190224 163437 - Gotta remember the difference … Rick Cogley

23 Feb 2019

«06:53:51»

You can elect to decrypt your macOS FileVault via your Apple ID, but that implies keys stored in iCloud. Good security means less convenience, generally, so since I could not find my recovery key, I decrypted and re-encrypted my MBP overnight. Decryption took 4 hours, then I woke up and did the re-encryption, which took at least 6 hours. Now my key is stored safely. πŸ”“

RC Logr 20190223 065350 - You can elect to decrypt your … Rick Cogley

22 Feb 2019

«12:10:57»

Creating responsive email templates that are viewable on any device is full of pitfalls. Zurb had a decent sass framework for it, now unmaintained, and there are a few services for this, some eye-wateringly expensive (c.f. litmus, bee, coffeecup). Going to try mjml.io and see how it goes. πŸ’Œ

RC Logr 20190222 121056 - Creating responsive email … Rick Cogley

«09:10:05»

I am a MailMate user myself for email, MailMate being the fantastic IMAP-centric feature-rich mailer for macOS. But if you are an Exchange user, you might check out Hiri for Win, macOS and even Linux. βœ…

RC Logr 20190222 091004 - I am a MailMate user myself … Rick Cogley

«07:55:57»

By creating a situation where so many companies developed websites that only worked in IE, Microsoft kinda shot themselves in the foot. Now even MS are telling ppl to stop using IE as default, echoing the sentiment that most of the web design community has strongly held for years. πŸ€“

RC Logr 20190222 075557 - By creating a situation where … Rick Cogley

20 Feb 2019

«11:18:43»

If your system is EFI or UEFI, you can make use of a utility called rEFInd, which looks like it really covers the bases for various and flexible configurations for booting, on Mac, Linux or PC.

RC Logr 20190220 111843 - If your system is EFI or UEFI, … Rick Cogley

«09:34:53»

I have tried various bulk email services, and now I will try the self-hosted sendy, which like others uses Amazon AWS SES to do the bulk sending. SES is uber inexpensive and in my experience, works well with a good delivery rate.

RC Logr 20190220 093453 - I have tried various bulk … Rick Cogley

19 Feb 2019

«20:12:47»

Got asked by a client to add a second URL to a block on a seminar page, but they wanted to add a counter for seminars with two URLs, so the page would show “seminar URL 01” and “seminar URL 02”. I’m pulling json from a db, then using Hugo to build the site, ranging over the json to build the seminar page. I added a field in the db to contain the second URL, and some conditional code to display the counter. The challenge was to add the counter only for seminars with two URLs, but not for those with one. For the first URL I used a with clause, and added the counter only in the case that the second URL was set.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
...
{{ with (index . "γ‚»γƒŸγƒŠγƒΌ URL") }}
  <div class="flex flex-column flex-row-ns">
γ€€  <div class="dtc v-top w-100 w-30-ns">
     <p class="b lh-copy mv0">γ‚»γƒŸγƒŠγƒΌ URL{{ with ($.Scratch.Get "surltext2") }}(01){{ end }}</p>
    </div>
    <div class="dtc v-top pl3 w-100 w-70-ns">
      <p class="lh-copy mv0">
      <span class="dn-s"><a href="{{ . }}" target="_blank" class="no-underline purple hover-gold">{{ $.Scratch.Get "surltext" }}</a></span>
      <span class="dn-ns"><a href="{{ . }}" target="_blank" class="no-underline purple hover-gold">γƒͺンク</a></span>
      </p><br/>
    </div>
  </div>
{{ end }}
...

RC Logr 20190219 201247 - Got asked by a client to add a … Rick Cogley

«07:49:32»

It is easy to think that you must use javascript to do something like a collapsible menu, but that is not the case; it can be done in pure css using Β«inputΒ». See an example. πŸ‘πŸ»

RC Logr 20190219 074932 - It is easy to think that you … Rick Cogley

18 Feb 2019

«11:20:09»

A Google engineer stated at FOSDEM that the 8.8.8.8 DNS service is about generally faster internet leading to more Google searches, and consequently more ad revenue for them. But you have to wonder, why are orgs like Cloudflare or Quad9 offering their 1.1.1.1 and 9.9.9.9 services? Anything like that costs money, so if you use it for “free”, what are you offering in exchange? 🧐

RC Logr 20190218 112009 - A Google engineer stated at … Rick Cogley

17 Feb 2019

«19:53:45»

Linus Torvalds, the creator of Linux, tells us how to pronounce it. πŸŽ“

RC Logr 20190217 195345 - Linus Torvalds, the creator of … Rick Cogley

«09:34:13»

Hammerspoon hackers, you can get display names dynamically by doing this: local first_monitor = hs.screen.allScreens()[1]:name(), incrementing the index number for your second or third monitor variable. The challenge remains regarding refreshing the lua config when you move to a site with another monitor setup. 🀫

RC Logr 20190217 093413 - Hammerspoon hackers, you can … Rick Cogley

16 Feb 2019

«23:41:58»

I looked at various window tiling managers for macOS, but I think I will stick with hammerspoon. To use it, you write a lua program in your $HOME (similar to awesomewm for linux), and bind macOS APIs to keyboard shortcuts. It is a “bridge between the operating system and a Lua scripting engine”. Not only can you tile your windows, but also do things like trigger events when you arrive home, or, plug in a USB device, for example. πŸ€–

RC Logr 20190216 234157 - I looked at various window … Rick Cogley

«18:44:24»

I programmed my Elgato Stream Deck to trigger some macOS Services, namely the WordService from DevonTechnologies (freeware), and the ones that come with OpenPGP. Useful! 🀩 Get the key images here to save a little time. The green-grey T is meant to go on a folder type button, which then changes layers to a panel with all of these services.

Photo of configured Stream Deck
Photo: Stream Deck configured for easy use of TextService

Update:

  • 20200514 - Thanks to Goran Milinkov for the dead link notification re Devon’s Text Services. Updated!

RC Logr 20190216 184424 - I programmed my Elgato Stream … Rick Cogley

«15:09:20»

On macOS you can get the number of words in text on the clipboard, by doing pbpaste | wc -w, and even use osascript to use AppleScript to post it as a notification. If you put your script in an Automator “quick action” you can assign a keyboard shortcut to it: wordcount=$(pbpaste | wc -w) && osascript -e 'display notification '${wordcount}' with title "Word Count"' πŸ€–

RC Logr 20190216 150919 - On macOS you can get the … Rick Cogley

15 Feb 2019

«12:38:05»

In shell scripting, you need to keep in mind that single quotes preserve the literal value of characters in a string, whereas double quotes allow interpolation of the characters. Plenty of pitfalls with this.

RC Logr 20190215 123805 - In shell scripting, you need … Rick Cogley

«11:21:32»

Check out the keybow, a mini DIY mechanical keyboard that is a solderless design, meaning you can swap in replacement switches if you want to tinker with the feel. Also, it is programmable and has LEDs, so the potential to set it up as a cool macro pad is tempting. πŸ€“

RC Logr 20190215 112132 - Check out the keybow, a mini … Rick Cogley

«06:42:23»

I have been using linux on servers only, but idea of using a minimalist window manager alone for a daily UI, is appealing. i3 wm, awesome wm, and suckless dwm are three popular examples. The big question is, can I give up certain beloved apps?

RC Logr 20190215 064223 - I have been using linux on … Rick Cogley

14 Feb 2019

«16:29:59»

Ever need to download a website for offline viewing? You can use the wget utility to do it, like so: wget --mirror -e robots=off -U mozilla --recursive --page-requisites --html-extension --convert-links --restrict-file-names=windows --random-wait --domains mine.jp,another.jp --no-parent http://mine.jp It works pretty well, but is not perfect.

RC Logr 20190214 162959 - Ever need to download a … Rick Cogley