Rick Cogley

Sticking out like a sore thumb in Japan since 1987! 日本語もOK ⚁ CEO @eSolia_Inc ❤️ code, jogging with Shiba Maru, yoga, photography.

Tools for the Modern Linux Learner

If you're trying to learn *nix command line, whether you're on a Mac, Linux, the Linux subsystem in Windows or something else, here's a few points you might find useful:

In my opinion, don't try to learn every command deeply, but rather learn the basics, take a while to get used to it, then circle back for more detail. Use man to learn what you need, when you need it.


Idan Kamara created a really useful site called « ExplainShell » that graphically shows what linux commands do. For example:

https://www.explainshell.com/explain?cmd=tar%20xzvf%20archive.tar.gz

It kind of looks like what you’d draw on a whiteboard, if you were giving a lecture on a particular command.

In a similar vein is https://cheat.sh/, from @igor_chubin.


If you want to share your terminal sessions with other learners, try out the free and open source «@Asciinema» service, which lets you record your terminal sessions for sharing. Slick.


If you need a remote Linux server to learn on, create an account at sites like ctrl-c.club, tilde.club or tilde.town.


Zsh is a good interactive shell to use. «Zsh for Humans» (z4h by @romkatv on GitHub) is a configuration for z-shell that just works and works well. It has a killer ssh wrapper feature, that lets you auto-push your zsh environment up to a remote server, and is pre-configured with the most useful stuff. That is not to even mention the awesome prompt it includes: powerlevel10k.


« Dasel » from Tom Wright @tomwright1993, is a truly cool tool. It uses a standard DAta SELector syntax, so you can learn it once, then use it for converting and querying files of various oft-used types. 🆒

It lets you do something similar to jq or yq, but it supports JSON, YAML, TOML, XML or CSV. Say you have a simple json file which you need in yaml. Just do this:

> dasel select -f website.json
{
  "ErrorDocument": {
    "Key": "404.html"
  },
  "IndexDocument": {
    "Suffix": "index.html"
  },
  "RoutingRules": [
    {
      "Condition": {
        "KeyPrefixEquals": "/"
      },
      "Redirect": {
        "ReplaceKeyWith": "index.html"
      }
    }
  ]
}

Easily convert to yaml like this:

> dasel select -f website.json -p yaml
ErrorDocument:
  Key: 404.html
IndexDocument:
  Suffix: index.html
RoutingRules:
- Condition:
    KeyPrefixEquals: /
  Redirect:
    ReplaceKeyWith: index.html

And boom.


If you need a super simple way to cryptographically sign a file, such as a software release, try « minisign », from @jedisct1.


« Dolt is git for data » as their repo says. 😎 A SQL database with git features, Dolt lets you push, pull, clone, branch, merge, do all the git things as well as all the sql things.

There's even DoltHub, where you can host public data such as this holidays dataset. It has tools like permissions, and a SQL query interface as well.


Try substituting «bat» for cat. Bat is a fast (written in Rust) cat clone with syntax highlighting for programming and markup languages, integration with your $PAGER, and git index awareness.


« Exa » (@dot_slash_exa) is a superb modern and fast ls replacement that supports colors, file and filesystem info, tree view, git info, and wide view. You have plenty of compute power, so why not take advantage of it and use something better than ls.


When you cannot dig dig for cli dns lookup, you might try « dog », written in Rust by Benjamin Sago @cairnrefinery (who also wrote the lovely exa) or « q », written in Go by Nate Sales. 😎

I especially like how you can output json from dog for consumption by another program for say, pushing to a database:

{
> dog esolia.com A AAAA MX TXT --json | jq
"responses": [
  {
    "additionals": [],
    "answers": [
      {
        "address": "99.84.138.103",
        "class": "IN",
        "name": "esolia.com.",
        "ttl": 26,
        "type": "A"
      },
      {
        "address": "99.84.138.27",
        "class": "IN",
        "name": "esolia.com.",
        "ttl": 26,
        "type": "A"
      },
      {
        "address": "99.84.138.119",
        "class": "IN",
        "name": "esolia.com.",
        "ttl": 26,
        "type": "A"
      },
      {
        "address": "99.84.138.118",
        "class": "IN",
        "name": "esolia.com.",
        "ttl": 26,
        "type": "A"
      }
    ],
    "authorities": [],
    "queries": [
      {
        "class": "IN",
        "name": "esolia.com.",
        "type": 1
      }
    ]
  },
  {
    "additionals": [],
    "answers": [],
    "authorities": [],
    "queries": [
      {
        "class": "IN",
        "name": "esolia.com.",
        "type": 28
      }
    ]
  },
  {
    "additionals": [],
    "answers": [
      {
        "class": "IN",
        "exchange": "alt1.aspmx.l.google.com.",
        "name": "esolia.com.",
        "preference": 5,
        "ttl": 300,
        "type": "MX"
      },
      {
        "class": "IN",
        "exchange": "alt2.aspmx.l.google.com.",
        "name": "esolia.com.",
        "preference": 5,
        "ttl": 300,
        "type": "MX"
      },
      {
        "class": "IN",
        "exchange": "aspmx.l.google.com.",
        "name": "esolia.com.",
        "preference": 1,
        "ttl": 300,
        "type": "MX"
      },
      {
        "class": "IN",
        "exchange": "aspmx2.googlemail.com.",
        "name": "esolia.com.",
        "preference": 10,
        "ttl": 300,
        "type": "MX"
      },
      {
        "class": "IN",
        "exchange": "aspmx3.googlemail.com.",
        "name": "esolia.com.",
        "preference": 10,
        "ttl": 300,
        "type": "MX"
      }
    ],
    "authorities": [],
    "queries": [
      {
        "class": "IN",
        "name": "esolia.com.",
        "type": 15
      }
    ]
  },
  {
    "additionals": [],
    "answers": [
      {
        "class": "IN",
        "message": "google-site-verification=K4Vo3d0t6V11dXkV2nWU-H0srafI_UVPtlCvKvN2npQ",
        "name": "esolia.com.",
        "ttl": 300,
        "type": "TXT"
      },
      {
        "class": "IN",
        "message": "keybase-site-verification=JldStq9k7lM6uosSy-za3ilkJo0mlnqSulhYIGMgbpQ",
        "name": "esolia.com.",
        "ttl": 300,
        "type": "TXT"
      }
    ],
    "authorities": [],
    "queries": [
      {
        "class": "IN",
        "name": "esolia.com.",
        "type": 16
      }
    ]
  }
]
}


Social Photo by Ash Edmonds on Unsplash

Maru the Shiba's Rebellious Phase

Our dog "Maru", a male Shiba, is going through a rebellious phase now at 11 months old. Our trainer told us Shibas especially go through a phase between 6 and 18 months where they seem to forget every bit of their training, won't listen to commands, won't eat, won't crate, forget there they're supposed to pee; all manner of fun stuff. Yep, it's happening. He's being extra difficult now, but there are still flashes of that obedient, cute little guy from, um, two weeks ago!

When it happens you just need to accept it, but also be smart about it. As the "alpha" you can't let him get away with everything, but as long as he is not tearing the place apart, we are finding that if we just chill and let him chill, he's more receptive to commands.

He has to take antihistamines for allergies, and thankfully has not started to resist the miracle-working "medi-ball" treats. These are balls with a marzipan-like consistency, into which you put a pill. We never, ever have trouble with giving him meds if we put it in a medi-ball. Good stuff.

Photo of Maru the Shiba at 11 Months



Photos by Rick Cogley

Japan is Sometimes Overly Precise

A while back, the morning news in Japan did a piece on "how much is too much reclining" in trains and planes. The result was, most people in Japan felt that 40.4 cm (15.90551 in) was the max they wanted someone in front of them to recline. In typical Japan News fashion, they measured distances and angles, and got a cute little girl to say when she felt uncomfortable when the man in front reclined. (What burns my cookies is when the person in front of you reclines violently and suddenly.)

Anyway, this sort of detail is typical in Japan, and it's something my western friends and I find rather humorous. For example, they go into incessant detail about wind speed and hectopascals of barometric pressure, compleat with demonstrations from poor schlub in the field going "yep, this gale force wind is realllly hard to walk in". I, for one, expect my news broadcast numbers to be reported with six decimals of precision. :-p

Of course many Japanese are aware of this tendency, and have done some excellent comedy taking the piss regarding it. Here are a couple funny examples:

I promise, those are meant to be comedy, despite the assertions from the "experts" in the comments section. (God save us).



Social Photo by Matt Artz on Unsplash

Trouble Comes Free

Of course there are people who live by creating trouble as their raison d'être, like Baron Munchausen. In my thinking, life dishes out trouble anyway and automatically, so why make it more difficult?

People who are constantly negative are as impractical in thought, as people who are constantly positive. People who make even more mistakes to compound the problem as the pressure mounts, then bail, are another good example. As are people who fail to plan at all, or people who blurt out problems expecting magic, as though nobody else ever noticed it and just failed to wave their magic wand to fix it. Another example is people who insist on looping you in to their every issue.

I strive to not be an example of the above. I like people who fix problems and will fix problems with me, and try to cultivate relationships with them.

N.b.: "Munchausen Syndrome" is colloquially called "match pump" in Japanese. S/he who lights the match also yields the pump. Very descriptive. Almost poetic.



Social Photo by Robert Gourley on Unsplash

Praise for Discomfort

Thinking about motivation and how to motivate, I came to a conclusion that works for me.

Praising someone for what they are already good at, is a waste of an interaction. The person being praised learns nothing, especially if you or others have said it before. The praiser misses a chance to make any sort of difference, and can fall into a rut of doing nothing to improve or better themselves.

I think it's better to guide someone in the direction of things they don't like to do or are not good at, then praise them when they do it. Such as when a person, perhaps an "introvert", who fears and avoids confrontation, takes the plunge and confronts a difficult person in their life. Or when a decidedly non-athletic person makes a big effort to get out there and do something more athletic, even if it's just walking around the block to start. Or when a person develops job skills that they never thought they'd be able to. I think praise in those circumstances has lasting meaning.

Conversely, praising a talented athlete for being great athletically, or a student who never has to study to do well, for getting good grades, is just a waste.

Through the lens of living in Japan, people criticize more when you're uchi rather than soto. When you are uchi, a part of the group (the family, company, or club), the criticism can be harsh, because "otherwise, who else would ever say this." And usually, we don't direct too much criticism at someone outside the group, at someone who is soto. However it feels dysfunctional to me, no matter how many years I have lived in Japan, to harshly criticize someone just because they're a group member, and you can. I want to remember that words can be weapons.

Hopefully I am neither too harsh nor sweet, giving praise where it counts most, and therefore succeeding to motivate people to do better.



Social Photo by Cindy Tang on Unsplash

Got Japanese Humor?

I like comedy because laughter makes me feel better, and the heavy stuff comes for free. What about in Japan?

Japan has some interesting comedy or "owarai" styles that are good to know for learners of Japanese. It might be really, really esoteric to those who don't speak any Japanese, but if you're trying to get from intermediate to advanced any language, you could do worse than to listen to and learn some comedy in that language.

Japan has some types of humor such as the performed styles manzai, rakugo, or konto, and written styles like senryu.

Manzai (漫才) acts are almost always a "double act" pair like Abbott and Costello, and it's characterized by rapid fire talk, back and forth between a "tsukkomi" straight man, and a "boke" funny man. The M-1 Grand Prix is a great Manzai act competition. Manzai acts I like are Waraimeshi ("double boke" style switching the boke role between them), Tutorial (delusional "wild idea" style) and Slim Club (extra slow delivery).

Rakugo (落語) is traditionally a lone seated comic, performed with a fan as a prop, with an emphasis on a story. After the success of M-1 Grand Prix for manzai acts, single-performer acts got features on the "R-1 Grand Prix". The R comes from Rakugo, even though these acts are usually pretty far removed from traditional rakugo.

Konto (コント) are skit performances, sometimes quite elaborate and funny. They remind me of the ones Carol Burnett and her troupe used to do on her show. God, I'm old.

Senryu (川柳) especially "Salaryman Senryu" are haiku-like poems which riff on daily life.

If you're a learner of Japanese and interested in this, just search online for the above words.

Read More



Social Photo by Michel Grolet on Unsplash

Stop Fiddling with your Tool

Are you a project manager or, a manager of MS Project. That is, is your selected tool impeding you rather than helping you? The more time spent fiddling with your tool (an apt metaphor here), the less time you're spending thinking and communicating about how people, things and money fit with your schedule and the goals you're aiming to meet.

There may be projects that require a 5000-line Gantt chart, but even large projects I've managed have never needed one. Steering committees made up of senior people don't want to hear a PM droning on trying to zoom in on a super-detailed Gantt. In fact, most would question the sanity of a PM who shared or presented such a monstrosity.

Instead, I think the better approach is:

  1. let your teams manage their piece with whatever documents they want (sometimes compliance proscribes this) and report to you the day before the steering committee meeting.
  2. keep a 20,000 ft view Gantt in a Spreadsheet, with 5 or 6 activities, to roughly show where the project is at and just update the dates and status before each meeting.
  3. mark status in a simple "GYR" manner: Green means good, Yellow means slowed, Red means there's a showstopper. You can use it to focus attention where your executives can provide the most help: getting problems unstuck.

That said, there will always be someone who will be a tool about why you're not supplying a detailed Gantt, but don't buckle to that pressure. It's a fool's errand.

In the end, satisfy the real and pressing requirements of your projects, and stop fiddling with your tools.



Social Photo by Matt Artz on Unsplash

My Favorite Podcasts #trypod

Before COVID I used to walk to JR Totsuka station here in Yokohama, every day for my commute to Tokyo. It was a good opportunity to listen to a podcast, and I have several favorites I'll share here.

Although there's English news in Japan (I've paid so much in newspaper subscription fees for the last 34 years I'm practically an investor), I like radio, and Podcasts are a great radio-like way to keep up with what is going on outside our little archipelago. I can't stand queuing, but we do a lot of it while waiting for trains, so, podcasts come in handy to fill in that void. Also they are great for the train ride itself, too.

You can subscribe to these podcasts from Apple iTunes, apps like Overcast or Castro on iPhone (I don't have an Android but there are a bunch of apps you can use like "BeyondPod", "Stitcher Radio" and others), or on apps from the podcast producers, like NPR's "NPR One" app.

My Favorite Podcasts

In no particular order:

From Moz://a

Mozilla does important work "to ensure the Internet is a global public resource, open and accessible to all." The Mozilla Manifesto is worth studying, and it's great that there is an organization fighting for us, the "Joe and Jane Users" of the Internet. I like the Mozilla IRL podcast, which makes the point that our online lives are real life.

From NPR

Here's NPR's directory, and among those, I love:

  • Invisibilia
  • Planet Money
  • TED Radio Hour
  • How I Built This

From PRX

PRX sponsors a curated group of podcasts called "RadioTopia", which keeps me deep into listening material from gems like:

  • 99% Invisible
  • ZigZag
  • What Trump can teach us about Con Law
  • The Memory Palace
  • The Allusionist
  • Criminal
  • This is Love
  • Song Exploder
  • Mortified

From CIR and PRX

PRX and the Center of Investigative Reporting co-sponsor a great one:

From WNYC Studios

WNYC produces many beloved podcasts. Read more at their site, but here's the ones in my heavy rotation:

  • RadioLab
  • More Perfect
  • Freakonomics Radio
  • More Perfect
  • Here's the Thing

From WBEZ Chicago

Can't forget Ira Glass team's "stories in three acts". I love these Podcasts from WBEZ:

  • This American Life
  • Serial
  • S Town

... and you can learn more at the WBEZ website.

Others

No less important, but here are a handful of other great ones:

  • From Glenn Ostlund: MytholoGuy is a fantastic new family-friendly podcast that showcases stories from around the world. I wish I had had it when my kids were growing up.
  • From Stitcher: Stephen Dubner's Tell Me Something I Don't Know). Fake news antidote.
  • From Defacto Sound: 20000 Hertz. Want to know all about "that sound"? 2K Hertz has you covered.
  • From Panoply: Malcolm Gladwell's Revisionist History. Revise away; it's so entertaining.
  • Kevin Allison's Risk! podcast. It's kind of an adult version of "Mortified".

And that's a wrap. If you're not yet into Podcasts, the ones above are a good starting point. You're sure to branch out and find other ones you love, among the great content that's being produced these days. Enjoy!

Read More



Social Photo by Jonathan Velasquez on Unsplash

Japan Banking is a Polite Bureaucratic Hell

The other day I had to do three bank transfers for my company, since my business partner who usually takes care of this, couldn't. The bank tellers are really very polite, but I can't get away from the idea that they are also completely incompetent, albeit really politely.

The thing is, I had only the bank book and the hanko (stamp). If you have the cash card and PIN, it's easy to do a bank transfer. You deal with an ATM only. But if you don't, it's forms, and forms mean mistakes, especially for a schlub like me whose written Japanese is fair, to be charitable. 😅

On getting there at 11AM, I explained the situation, saying what I brought and what I want to do. I got the right forms (there's a different one depending on the target bank). Filled the forms, getting help from the floor teller, whose directions I followed to the letter. It takes me a while to fill them out too, because of course it's all Japanese, this being Japan.

Submitted the forms, waited 20 minutes. Got apologetically called up and told I need to re-write the forms because the order I wrote the company name and my name was incorrect, and, I can't just cross it out. It has to be company name first, then my name and title. Also, I wrote my own title wrong, apparently, despite having been told to enter it that way. But... the lady out there said... nevermind. Have a seat...

So, rewrote the forms how the window teller told me (even flubbed up one from sheer fatigue and re-wrote it), re-submitted, more waiting. Called again. The name on this transfer form is not correct (despite the spelling being exactly what is on the directions I got from the requester). Fixed it to her directions, stamping where I needed to, and for some inexplicable reason they let me cross it out and stamp the affected area. Uhh, but you just said... nevermind. Have a seat...

Got called again, this time to write my name and company name on the back of a piece of paper "for security reasons". Uhh, ok... poor writing ensues. Have a seat...

Called again. Also, your name here, and here, and here is incorrect. It needs middle dots.

In other words, this:

コグレー ジェームズ

... had to be this:

コグレー・ジェームズ

Fortunately, this time they let me just add the dots, miracle of miracles.

More waiting, wondering if the Wizard of Oz in the back there is having fun or not. Finally, success, at 14:00 after three hours. I hope I never have to do that again. Argh.



Social Photo by Wesley Tingey on Unsplash

Japan PSA - Autumn is Murder Hornet Season

Robert on Strava says he "just takes the stings and calls it free Vespa", which is funny, but Asian Giant Hornets (Vespa mandarinia) in Japan are no joke. Read on to find out why.

Sept and Oct is breeding season for the Japanese Hornet, which is when they get aggressive. In Japanese, these are called "oo-suzumebachi (オオスズメバチ)" meaning "great sparrow bee" because of their large size. You know you're in trouble when they start clacking their mandibles. You'll hear their buzzing anyway, but when they start in with a clack!-clack! sound, know they're going on the attack.

If you're in Japan and watch the Japanese news, you'll see reports about these regularly. I read that 40-70 people die yearly in Japan from their stings, specifically from anaphylactic shock. These hornets have a re-usable stinger, so they can stick you multiple times. If you approach them, accidentally or on purpose, or are simply in their vicinity, they can attack. One came after me as I was hanging out the laundry, not even near a nest.

Black-clothed, loud, perfumed people be gone!

They say prevention is half the cure, so, this is what I've learned:

  • Stay away from their nests, in trees (even low to the ground such as in the roots of a big tree) or the eaves of buildings.
  • Wear solid white, and avoid creating areas of contrast on your body (like black stripes on a white background).
  • Don't wear any scents at all, even scented soaps - keep it boring on the trails in the autumn in Japan.
  • Do like bee-keepers do - stay calm, slow and quiet. Nobody likes a lot of noise on the trail anyway, but, if they are coming after you, don't swat at them and yell. Go gently and quietly.

If you do get stung, I read that the best thing to do is to squeeze out the venom (with your fingers, not by sucking), and keep it cold until you can get to a doctor. And multiple stings necessitate such a visit.

Stay safe out there.

⚠️ 🐝 😱

kenpei-vespa_mandarinia_japonica image

Related



Social Photo by hp koch on Unsplash

Deploy Hugo on Vercel

A question on the Hugo support forum prompted me to try deploying the Hugo quickstart site on Vercel. It was super simple. Here's what I did.

Hugo Quickstart

First, just run through the quickstart steps in a local folder to get it basically working. I put my projects in $HOME/dev.

Connect to Vercel using their CLI command

Assuming you have installed the vercel CLI command locally and have authenticated, you can connect your new Hugo project to your Vercel account by running vercel in the project folder. It prompts you for the basic settings you want for the project, and for a standard Hugo site, ./ is correct for the code directory:

vercel
Setup and deploy? Y
Which scope? Rick Cogley
(pick user or org, and I picked "Rick Cogley" my account)
Link to existing project? N
Project name: hugo-quickstart
In which directory is your code located? ./
Override settings? N
Deploying...

N.b.: Vercel private / free accounts require non-commercial sites

It will start deploying, and return some info about the deployed site.

Want to override the settings? [y/N] N
🔗  Linked to rickcogley/hugo-quickstart (created .vercel and added it to .gitignore)
🔍  Inspect: https://vercel.com/rickcogley/hugo-quickstart/APeDa4... [3s]
✅  Production: https://hugo-quickstart-lilac.vercel.app [copied to clipboard] [28s]
📝  Deployed to production. Run `vercel --prod` to overwrite later (https://vercel.link/2F).
💡  To change the domain or build command, go to https://vercel.com/rickcogley/hugo-quickstart/settings
user=1.07s system=0.25s cpu=0% total=2:39.28

You'll see that it creates a .vercel folder in your project folder, which contains account and project information in a project.json. This folder is added to .gitignore so if you git clone to another system at a later date, you'll need to link it again using vercel.

The site should now be available where Vercel deployed it (it's on the clipboard, so just paste into your browser to check).

So, it's deployed, and you could simply work from your local folder, and use the vercel CLI command to re-deploy when you need to. However, it's cooler to deploy on git push, so let's get that working next.

Minor Tweaks Needed

Now you can edit your Hugo config.toml adding the URL that Vercel provided as a baseURL, although, it appears that Vercel is smart enough to feed Hugo the production URL anyway.

Also, since Vercel's default Hugo version is really old, copy the vercel.json from my test repo for this post, and add it to the base of your project. This will tell Vercel to use that version of Hugo and also set some security headers for you.

Create a GitHub Repository and Link It

Next, create a repository in your Github, but do not add a README or anything. Then execute these commands from your local project folder, to add your new GH repository as a remote, add and commit the changed / added files, and push to main.

git remote add origin https://github.com/YourGithubUser/hugo-quickstart.git
git add .
git commit -m "added baseurl to config, added vercel.json"
git branch -M main
git push origin main

Now in your Vercel project, settings, Git menu, connect Vercel to your Github repo using the button.

Test by Editing and Pushing

Then to test, make an edit in the site files (e.g. content/my-first-post.md), push to main, then check the URL that Vercel deployed on. You can watch it deploy in your Vercel project.

And that is it. A very simply process to get a Hugo project linked up to and deployed to Vercel.

Vercel


Social Photo by Artiom Vallat on Unsplash

Backup Your @postmarkapp Templates

The other day I wrote about using Postmark for sending out HTML emails. We wanted to have a way to backup our Postmark email templates automatically, so we coded a simple Github Actions workflow.

There is about 10 minutes of setup for you to do, and it works well enough to backup your Postmark templates and server information on a schedule.

Basically, you need to:

  • Visit our postmark-backup repo on Github.
  • Click "Use this template" to copy the repo to your own account where you can set your repo's visibility.
  • Make a couple of adjustments to the workflow yaml file.
  • Add some repository secrets to reference your Postmark account and server tokens as appropriate.

Once it's setup, it's basically set and forget, and will backup on a schedule, or when you push.


Post Cover Photo by Markus Spiske on Unsplash. Git repo photo by Rick Cogley.

Upgrade your Terminal to 'Zsh for Humans' by @romkatv

Roman Perepelitsa has coded a fantastic, featureful zsh configuration that works right out of the box. "Zsh for Humans" (aka "z4h") and its companion prompt "Powerlevel10k" are easy to install, and come configured with the most useful features you might need in an interactive prompt. You can see what my configuration of the prompt looks like here:

z4h screenshot

I love the ssh wrapper feature, which lets you auto-push your zsh environment up to a remote server. You use the wrapper like this:

% z4h ssh myuser@thehost.com

My daily driver is macOS, so I needed to tweak some settings in my terminals to get the key bindings to work as expected:

  • iTerm2:
    1. iTerm, Prefs, Profiles (select your profile), Keys, then…
    2. Right/Left option key: Esc+
  • Kitty:
    1. In the config file: macos_option_as_alt yes

Now you can enter a command like history and before hitting Enter, press Alt-H to show help for that command.


Social Photo by Debby Hudson on Unsplash

Email Services For Your Apps

If you are hosting your app on a service like the recently-closed Webfaction, you might be getting shared space for your web pages or app, databases and email addresses that can be used for sending or receiving. However, many modern hosting environments such as Vercel , Netlify or others, don't come with email capability and assume you'll setup some service to handle the emails that are issued from your app, such as welcome messages, password resets and the like, or, inbound emails.

There are plenty of email services out there, and I've used many of them. There are two I started using recently, which have good UX, and hit the spot in terms of features.

There's a bit of setup in either case, and you need to be able to set up your DNS, but both services I mention below have good documentation and support.

Inbound Email via ImprovMX

ImprovMX is about forwarding inbound email in a flexible way. You could use it if your client wants to enable their website domain for email, say for a hello@theirsite.com address, forwarding to a distribution list at their usual corporate email system.

It also lets you forward json generated from the parts of an inbound email message, to a webhook, so that you could handle that programmatically.

We use it to forward the emails on our contracts. For example, if we have our support desk ticketing email setup so that an email address looks like acme-support@ourco.net, and we want to forward to ticket-acme@mail2db.ourco.jp and support-acme@ourco.co.jp, we can set up a rule that forwards:

([a-z]+)-support@ourco.net

...to:

ticket-$1@mail2db.ourco.jp, support-$1@ourco.co.jp

The regex in the parenthesis gets captured, and substituted into the $1 variable. Easy.

Also, you may have situations where the client wants to send out as hello@ourco.net, and ImprovMX makes it trivial to set up an SMTP login to use for this. There should be a way to make it work in most modern email client software.

Outbound Email via Postmark

For outbound email, consider Postmark. It supports the usual transactional emails (emails to a single To: address) such as welcome messages, password resets or invoices, as well as what they call broadcast emails such as announcements or ToS updates.

What I really like about Postmark is how easy it is to craft an HTML email template to use. There's a UI for this, and if you've ever struggled with assembling HTML email, you will know the value of something that just works. It's simply not like your standard web page development. Email clients are finicky, and writing emails that will work in most places is hard. The Postmark API documentation makes it easy to test, too. You just paste in your API token, and click.

postmark api

Postmark lets you set up an SMTP address, like ImprovMX, and so your app could take advantage of this to send, as well.

Postmark are conservative with who they let on their service. You have to fill out a short questionnaire about how you're intending to use their service, and someone will review your application. I think this posture is reasonable and good, because they can guarantee better deliverability that way.

You may have heard of DMARC, which lets you cut down on scammers spoofing emails from your domain? It prevents people from sending an email from you@yourco.com even though they don't have access to your email client. If a recipient or their system marks such an email as spam, it hurts the reputation of all the other emails being sent from your domain. DMARC is meant to help with this.

The problem with DMARC is, the reports are rather technical, and come in as a zip file that contains an XML file with all the details of all the problems with email on your domain. In my opinion, it's a non-starter for business users.

Postmark has a for-pay service called DMARC Digests, which gets you a dashboard and action items to improve deliverability for your domain. They also provide a free version, which seems great for a personal domain. In either case you need to set up or cause to be set up SPF, DKIM and DMARC entries in your DNS.

ImprovMX and Postmark make my life easier, and maybe they'll help you too.


Social photo by James Harrison on Unsplash

Apple iOS 15 "MPP" Mail Privacy Protection

After updating to Apple's iOS 15, amongst several privacy initiatives in iCloud+, you can enable "MPP" or Mail Privacy Protection, that has email marketers up in arms because it blocks those 1px "beacon" images used to track your opens.

It's easy to turn on:

Settings, Mail, Privacy Protection, Protect Mail Activity ON

What it does it pre-fetch your email contents to a proxy, blocking the trackers email marketers typically use. When macOS Monterey is released, it should be available in Mail.app.

As far as I understand it, MPP works only with Apple Mail for now, and I wonder if in the future Apple will open it up to 3rd party email apps.

You can turn off "remote image loading" in many web or OS email clients these days. I use MailMate on macOS, which for example lets you conveniently block images, giving you the option to download all of them, or just the ones not "strictly blocked".

image.png

It means you can have the intended visual experience, but opt out of the tracking image.


Social Photo by Alex Motoc on Unsplash

Japan Rail’s ubiquitous "Suica Penguin"

Japan Rail's IC rail pass "Suica" is so named because it helps daily commuters pass through gates easily, i.e. in a "Sui-Sui" manner, since 2001. Penguins are skillful swimmers, passing in and around obstacles with ease, so that’s why the "Suica Penguin" was born. Its designer is the lovely Chiharu Sakazaki 坂崎千春, who modeled it after an Adélie penguin. Ironically, people shuffling towards escalators during rush hour, walk a lot like penguins. 🐧🚅