MacOS and the command line

I’ve spent decades using the Linux command line on a daily basis. Six months ago, I switched to a MacBook Pro as my day-to-day machine, and I’m still learning to acclimatize. Happily, many of the tools I’ve grown to love still work on MacOS, either because they’re shipped with it (ssh, git, python3, zgrep, zip, less, curl), or because I’ve installed them with “brew install …”

  • vim
  • ripgrep ‘rg’
  • tree
  • xz
  • socat
  • shellcheck
  • tcptraceroute
  • screen
  • jq
  • jhead
  • htop
  • coreutils

Things that are subtly different, and still annoy me:

  • find lacks a -mindepth option, so install “coreutils” and use “gfind”
  • bash 3 is ancient and doesn’t work like modern bash 5, so use zsh instead
  • grep lacks -P. Happily, -E gets me most of what I want, and when it doesn’t, I use “ggrep” (brew install ggrep) or “pcre2grep” (brew install pcre2) instead.
  • cat doesn’t respond to CTRL-D, so use CTRL-C instead, or use “gcat” from “coreutils”
  • ps is very different, and lacks a –forest option, so install and use “pstree”
  • zcat doesn’t use gzip. It handles compress Z files. So use “bzcat” , or “gzcat” from “coreutils”.
  • no sha256sum, md5sum, etc., so run “brew install coreutils” to get them.

There’s far more, under-the-hood, that is different, but I haven’t run into those things as much, yet. I’m still more comfortable with Linux, but I’m glad that “brew install” gives me so much. Thank you to the people who maintain ‘brew’ and the packages.

MacOS and keyboard shortcuts

Last August, I gave up my four-year-old Linux T590 Thinkpad for a MacBook Pro. They’re different, and in some aspects, it’s been a difficult journey because MacOS is not Linux. In other ways (apps, audio, Bluetooth, etc.), MacOS has been fantastic.

The hardest thing to get used to is the keyboard shortcuts. I use keyboard shortcuts extensively, and they’re quite similar between Windows and Gnome Desktop. Not so with MacOS. MacOS is not Gnome, and it’s not Windows either.

Shortcuts that I still get wrong, six months later, and so I’m still learning.

  • I hit CMD-Home, expecting to go to the top of the web browser window, or the top of a document.
  • I hit CMD-up-arrow to go to the beginning of the line, and does something else. On Windows/Gnome, CTRL-up-arrow does what I expect. On Mac, it’s CONTROL-A, and CONTROL-E to move to the end of the line, just like with zsh and bash (by default), so I can accept that.
  • F2 in the Finder doesn’t rename files. Apparently, the Return key does this instead. I can get used to that.
  • In PyCharm, I still don’t know how to set and jump to bookmarks.

Mac doesn’t have window-snapping like Gnome or Windows, so I use Rectangle to remedy that. Although the keyboard shortcuts are different, I’ve gotten used to them.

Now that I use Mac during the workday, I’m used to starting apps with COMMAND-space. When I use our at-home Windows computer or my Linux computer, it takes me a few seconds to adjust to the different shortcut keys — just hit the windows key, no space bar needed.

The differences under-the-hood are far more striking than the keyboard-shortcut differences, but that’s a topic for another day.

Notification hell & more courteous apps

I have a plethora of chat apps, and they notify me incessantly. My in-laws are planning a get-together using Google Chat. I get a notification every time someone posts a message — a message that I don’t need to see while I’m working.

Same for marching band. There’s a parent group, and from time to time, it sees a fair amount of discussion. Most of the time, I don’t need to be notified of each and every message in the discussion.

I have a dozen GroupMe groups, iMessage conversations, Slack, Teams and a few others.

It’s hard to stay focused on the conversation, the work, the task at hand when there’s a deluge of distractions. It’s notification hell.

On the other hand, iPhone and Android empower users with a great deal of notification options to try to help tame the hydra at the app level, but it requires time and effort to configure, and it doesn’t really help when the thing I really need to configure is the notification settings for individual chat groups within an app.

Then there’s my Garmin watch. It doesn’t know anything about my iPhone notification customizations, so it shows everything, instantly. Every once in a while, it’s a good thing, but most of the time, it’s downright annoying, and I have to take off my watch, or turn off Bluetooth on my phone.

Why can’t more of my apps be like Slack or GroupMe? Slack allows me to configure quiet hours, mute channels, and so much more. When my desktop is receiving notifications, it doesn’t notify my phone — thank goodness.

GroupMe lets me mute individual groups and sub groups for 1 hour, 8 hours, 1 day, 5 days and always. This is a killer feature, one that Google needs to adopt in its chat app. Google chat lets me configure do-not-disturb for a duration, but it’s app-wide, not group specific. Apple also needs to learn from GroupMe and improve the temporary mute settings for iMessage.

It’s not just chat apps. It’s Google Photos where an algorithm wants to interrupt my day to tell me that it has memories to share, or iPhone wants to tell me how much screen time I used in the past week. Years ago, I disabled notifications completely for email, Facebook, MarcoPolo, and others. Some apps have been programmed to tell me, when I launch them, that I’ve disabled notifications, and that I should enable notifications. No thanks!

I use do-not-disturb on a frequent basis — when I’m at church, when I’m in a 1-on-1 meeting, and automatically when I’m driving. Maybe it’s anti-social, yet it gives me space to focus.

There are also times when I’ve forgotten my smartphone and left it behind. They were peaceful times, times when I was able to focus on the human beings next to me.

Maybe I need fewer apps, or I need to completely mute more apps. Maybe I need more tech-free zones (seems unlikely in today’s world). Maybe I need to disable notifications on my Garmin watch.

What is your solution?

My computer is the best and the worst

I have an excellent Thinkpad T590 running Ubuntu 22.04 — one of the best Linux laptops I’ve had, and yet it’s the worst. I have a snappy iPad Pro that is one of the best tablets I’ve ever used, and yet it’s the worst.

How can a computer be the best and the worst? Each has strengths and weaknesses.

Strengths of the Thinkpad + Ubuntu

  • My target deployment platform is Linux, and so developing on Linux is a much closer fit than using Windows or Mac.
  • Speedy docker — it’s native. On a Mac, it’s never native because it’s not Linux, and always goes slower — at least 10x slower, sometimes 100x slower, depending on whether the docker image is intel or uses native instructions.
  • Intel Iris Pro GPU with in-kernel drivers means that the display just works, including with external monitors. Suspend and resume work as well. It’s way better than with proprietary drivers.
  • Command line tools have all the GNU power options I want and to which I am accustomed. I.e things like “grep -P” for perl-style regex.
  • Powerful computer, not too heavy, 5 hours of battery life, even after 4 years of use.
  • Robust materials. It doesn’t fall apart. Excellent keyboard, including a number pad.
  • Matte screen — reducing glare, and nice to look at.
  • Chrome. Most critical things I need run pleasingly well in Chrome — Outlook, MS Teams, etc.
  • No ads inserted.
  • No Microsoft overlord forcing MS Edge on users.
  • Gnome desktop. No, it’s not particularly exciting, but it works, and it has great window snapping, very much like Windows.

Weaknesses of the Thinkpad + Ubuntu

  • Bluetooth audio. My Bose headphones work far better with my iPhone or iPad than with Linux. Linux bluetooth audio drops randomly, or is lower quality.
  • Audio with multiple possible output sources. My MS teams in-a-web-browser audio is always a challenge in this scenario.
  • Sometimes audio and/or bluetooth doesn’t work after a suspend/resume cycle, and I have to reboot the computer. Lately, I’m in many more conference calls, and unreliable audio is frustrating. Happily, I can switch to my iPad, where audio just works — every time.
  • Anemic built-in speakers, and tinny-sounding audio from built-in microphone. It’s subtle, but low audio quality makes it hard to listen to calls as effectively, and adds stress. This goes for the remote end of the call as well. There’s a reason podcasters invest in quality microphones. In my experience, Apple hardware has much better built-in speakers and microphones than any PC I’ve ever used. That said, purpose built-external mics are always better quality.
  • Apps. No WhatsApp for Linux (maybe that’s a good thing!), and same for many other apps that have no web-based option, forcing me to use my smartphone without a physical keyboard.
  • No fingerprint reader, no face unlock.
  • Viewing of thumbnails in the file explorer stinks compared to Windows or Mac.

Strengths of the iPad Pro

  • Instantly available and ready to go, 99.9% of the time, unlike Ubuntu, which is okay, but not as pleasing in this regard.
  • FaceId to unlock — so much faster than with a password or a pin.
  • Apps — so many to choose from. There’s an app for everything.
  • Excellent sound and microphones — great for conference calls, and it can even service an entire team in a conference room doing a remote call with people elsewhere — with its built in capabilities
  • Keyboard. Yes, I have one, and it makes my life better.
  • Bluetooth: It’s reliable, unlike with Linux — especially important with audio.
  • Touch screen.
  • Apple pencil.

Weaknesses of the iPad Pro

  • The apps for Google docs and Google sheets are surprisingly anemic compared to the web-browser experience — i.e. almost unusable, other than for viewing and simple editing. I’d just use them in Chrome, but Google dumbs down the online in-Chrome experience for iPad, forcing me to use the apps.
  • Side-by-side google docs. I often want to look at two documents at the same time, but Google docs doesn’t let me do that. It’s one at a time or nothing. Desktops are so much better.
  • Chrome. It’s running on a powerful M2 processor, yet Google disallows the extensions that improve my life. Desktop chrome is so much better.
  • Copy and paste within apps. Why is it, that in a web browser, I can copy-and-paste the portions of a conversation that I want (such as just the phone number or just the address), and paste them elsewhere, but within an app, it’s the entire text, or nothing?
  • Apple pencil for writing notes. Apple notes places the translated text wherever it pleases.
  • Apple pencil capabilities are underutilized. Most apps (Apple Notes, Apple Freeform, Miro, MS Whiteboard, etc.) don’t seem to support the pressure sensitive nature of the pencil.

Operating systems and the hardware they run on are like footwear. Flip flops, running shoes, irrigation boots and ski boots each have their place. That said, I don’t want to be lugging around all at the same time.

30 years of change

I was a part-time, student programmer at BYU in 1991. I wrote software in 4th Dimension on a Mac II with a color monitor. In 1992, I was helping our office secretaries to adopt email to send interoffice memos. In the fall of 1992, I took two years off to be a missionary for the Church of Jesus Christ of Latter-day Saints, and I spent most of that away from a keyboard. When I returned, the world had changed.

Everyone had email, and the advent of the PowerPC gave us vastly faster Macs than the old Mac II and we were using FoxPro to write our software. There was a new technology: NCSA Mosaic. I didn’t know if I’d be able to catch up with all of the changes, or if I could handle sitting in a chair for 8 or more hours a day.

I acclimatized to the office, and eventually “caught up”, if one can ever truly catch up in the world of technology and software. I bought a PC with an ample 32 MB of RAM and installed Linux on it.

I graduated in December of 1997 and went to work for small software company, creatively named Software Development Corporation. That’s a joke — it wasn’t a creative name, but it was a great place to work because my coworkers mentored me and cared about me. We ported new versions of WordPerfect to UNIX systems… or rather, other people did. I added an LDAP address book for the import and merge feature. Everything was written in C. We used the Internet, but not to find answers about APIs and coding… we still used books for that.

Fast forward to today, and nearly everything, technologically, has changed. Computer hardware, Linux is everywhere, open source software, new frameworks and programming languages have become staples of our lives.

Yet people are similar. We rely on each other, help each other, and strengthen each other.

Smartphone Tradeoffs

Here are some of the tradeoffs I evaluate when buying a smartphone. Emotion and momentum are valid items to factor into a decision. I’ve used both Android and iOS, and have been a mostly happy iPhone customer for several years

  • Camera quality — one of the most important considerations
  • Friends
    • If the people closest to you use Android, then go with Android, especially if you need them to help you maintain it or know how to use apps.
    • If you want to talk to friends with iMessage, then get an iPhone
  • App ecosystem
    • Is there a must-have app? Consider whether there are alternatives for a different smartphone OS. It can be fun to learn new things.
  • Integration ecosystem
    • Accessories — everyone makes accessories for iPhone, but android accessories may be cheaper
    • Apple watch only works well with iPhone, yet the integration is stellar (from what I’ve heard)
    • iMessage works seamlessly on Mac (I don’t own a Mac)
    • Etc.
  • Total cost of ownership
    • Time to maintain. Consider buying more storage if you don’t want to spend time erasing old photos to find enough space.
    • Security updates: Number of years the vendor will supply security updates. Apple is stellar in this area.
    • Durability: Will it last 3+ years? If so, it may save you money. Get a phone case and protect your investment.
    • Resale value
      • Some people say it’s dangerous to recycle phones because the sensitive data persists.
  • Appeal
    • I tend to focus more on functionality than on looks
    • A beautiful OLED screen is nice looking
    • An always-on screen is nice
    • Get a fun phone case
  • Vendor lock-in
    • iCloud sharing sucks compared to Google Photos, in my opinion
    • Do you want to be locked-in to one vendor’s ecosystem?
    • Android makes it far easier to get your photos off of your phone to a Linux computer. It’s much harder with an iPhone, and that’s the beauty of Google Photos… to get photos out of Apple’s clutches.

That said, there are always lemons. Once, I was on the phone with Apple for five hours to get a phone activated for one of my kids, with no resolution. We ended up trading in the already-used-in-our-family phone for a brand new one. Apple gave us $100 credit or so for it.

Working from home, again

It’s 2022, and before I returned from holiday vacation, the company HR department emailed and asked us to work from home if we can.

When we went into lockdown in 2020, the networking folks beefed up the VPN and the speeds to our internal on-premise server infrastructure. I bought an external monitor for home use, a pair of Ethernet-over-Power bridges, and set up a fantastic makeshift workspace (a slab of wood on top of sawhorses)… one that I’ve moved to a few different locations in the house before settling in the master bedroom. Even after lockdown ended, I continued to work from home two days a week.

So working from home has been part of my reality, and the adjustments of doing it full-time again include:

  • I miss the in-person interactions that I had with coworkers. Video conferencing is good, but it’s not the same.
  • I get a minor amount of cabin fever, so I go on walks.

I look forward to a time when coronavirus is no longer a problem.

Investment in memory safety: Chrome, Rust and other tooling

The software most of us use on a daily basis wasn’t built with robust security in mind. If it was built with any effort toward security, it was most likely built with “casual”, or “good intentions” security.

The process that gives us our modern software has typically focused on features and value rather than preventing malicious actors. Yet we live in a connected world, and although connectivity brings power and opportunity, it also brings risk.

Risk because there’s gain in hacking our lives and the organizations with which we interact — schools, hospitals, insurance providers, municipalities, government agencies, social media networks and smaller scale entities.

So I’m glad that Google engineers are vigilant in looking for ways to improve the security of the Chrome browser that so many of us use on a daily basis.

https://security.googleblog.com/2021/09/an-update-on-memory-safety-in-chrome.html

Using better tooling will not solve all security problems — nowhere close, but it’s helpful.

Grateful for innovation & beauty

I’m grateful for the amazing cameras on modern smartphones, including low light mode. I’m glad that family members share pictures they take — enabled by AirDrop and online services such as Google Photos, and even Facebook (lower resolution).

I’m thankful for the beauty of the natural world, and that I get to enjoy it with my family.

Timpanogos Cave

Which programming language?

During my career, I’ve written code in C, C++, GNU Make, Perl, Java, Groovy, Ruby, Python and bash. I’ve often wondered what new programming language (or framework) I should learn so that my skills remain relevant. The number of languages and frameworks has blossomed over time, and the size of the industry has increased to support and keep them vibrant.

In the old days, I read books to learn new languages, but in modern Internet times with online tutorials and stackoverflow.com, I haven’t used them as much. Recently however, a coworker loaned me “The Go Programming Language,” published by Addison Wesley and written by intelligent, seasoned software engineers. Studying it reminds me that I enjoy books. They often contain a distillation of knowledge and wisdom that is harder to come by in online mediums.

For example, the Go tutorials explain how to use slices, but they don’t explain the mechanism of how they work, so they were a bit confusing. This book rectifies that gap in my knowledge, and briefly covers other interesting side-topics such as how UTF-8 was designed to be self synchronizing and directly searchable without having to convert it first.

Go isn’t as familiar to me as what I’m used to, so initially I didn’t like Go. I remember feeling the same way about learning Ruby, which is even more foreign than Go. In the end, there are many considerations with using a programming language that matter more than whether it feels familiar or foreign, elegant or boring. John Arundel summed it up well:

…every programming language represents a set of trade-offs. Each language is optimised for different things, so your choice of language should be determined by what suits you and the problems you want to solve with it.

Tradeoffs include, but are not limited to…

  • Integration — the ability to integrate with existing systems at various levels — the operating system, foreign libraries and programming languages, network systems and APIs
  • Maintainability (simplicity and type checking are great benefits on large projects)
  • Speed of compilation (important on large projects where frequent change occurs)
  • Performance in production — speed, scalability, memory usage
  • Tooling — build system, editors (IDEs), refactoring support, linters, formatters, packaging, deployment, profiling, testing, etc.
  • Ecosystem: libraries (availability and quality of those libraries), community
  • Backward compatibility
  • Industry momentum — pool of engineers, the time to come up to speed, trust, longevity.

Engineers don’t often get to pick the programming language for a project — it’s already been chosen by the time they arrive on the scene. Instead, they get to pick the project or the company they work on or for.