Books read in July

The Letters of Vincent Van Gogh, by Vincent Van Gogh

My wife got this as a birthday gift. It is a tragic look at Van Gogh’s suffering but passionate and all too brief life. The editor’s notes before each section were quite helpful in setting the context. Before reading this, I saw Loving Vincent, a beautiful tribute to the same author. So I’d recommend folks to watch that movie first, and dive into the week if they crave more.

The Checklist Manifesto, by Atul Gawande

I’m been tweaking my productivity tools, and this seemed like a well-recommended book in that space. It is quite nice although a bit light. The summary is that in high pressure and critical jobs, experts usually look for corner-cases but quite often miss the basics. And a good checklist serves as a reminder for a group of people to coordinate tasks well.

Pomodoro Technique Illustrated, by Staffan Noteberg

Continued my productivity investigation with this book. Again, a light, enjoyable read. I read the book using the Pomo technique itself and quite liked the approach. I have too many meetings at work these days to be able to use this as often as I’d like. But it seems like a nice way to pace your work without getting swamped by distractions.

K8s terminal enhancements

I’m interacting with a large numbers of k8s clusters at $WORK and picked up some nice tools to make my life easier.

Firstly, get k9s. It’s a lovely tool for terminal-lovers. It has a nice vi-style interface with tab-completion, so you’d just have to something like :namespaces to see the equivalent of kubectl get ns.

For navigating through a cluster and exploring, this is a lot better than other GUIs like lens.

Secondly, get krew which is a plugin manager for kubectl. I installed these plugins to start with:

  • ctx – Easily switch between contexts. Integrates out of the box with fzf so it’s pretty sweet
  • ns – Same, for switching namespaces rapidly
  • tail – Tails across all pods in a service, among other things
  • tree – shows the hierarchy of resources (like Service -> Endpoint) in a tree

Books read in June

Thinking, Fast and Slow by Daniel Kahnemann

Did not have high expectations going in, as I was already aware that an entire chapter was essentially worthless due to the replication crisis that has proven that most research around priming has very little value.

I find survey-based research rather depressing. The book time and again states that researchers have a poor understanding of statistics, and the subjects display a high variability in their answers based on trivial and unrelated conditions. But it then goes on to quote study after study as if it were fact.

I’ve enjoyed other areas in non-fiction a lot more than this one and should probably stick to them.

Mistborn: The Final Empre by Brandon Sanderson

My first by the author. Thoroughly enjoyed it. Did not have too many of the usual fantasy tropes about heroes and destiny and so on.

All Systems Red by Martha Wells

Was a short science fiction piece I read for a change of pace. It had a decent cast and atmosphere.

Vim and Go setup

I’m reading Learning Go by Jon Bodner. The opening chapters have some nice tips on getting a good developer environment. Vim has the excellent vim-go plugin that bundles a ton of nice stuff. Here are some notes I took while I got things setup.

My .vimrc is here.

My detailed notes from reading the book are here, and what follows below is just the subset that deals with dev environment.

Vi

Install vim-go: it comes with a massive set of tools.

goimports

goimports for some neat stuff that gofmt doesn’t do. Install with:

go install golang.org/x/tools/cmd/goimports@latest

And run with:

goimports -l -w .

Vi: Just save it.

Linting with golint

Install: go install golang.org/x/lint/golint@latest

Run: golint ./...

Vi: :GoLint

SA with govet

Run: go vet ./...

Vi: :GoVet

This does not catch subtle bugs around shadow variables. So consider installing shadow as well:

Install: go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest

Run: shadow ./...

Combine golint, govet with golangci-lint

This tool runs 10 different linters by default and support dozens others.

Install: see official docs

Run: golangci-lint run

vim-go notes

  • Code completion is with Ctrl-x Ctrl-o
  • :Tagbar is bound to F8
  • :GoDef is bound to gd
  • :GoDefStack shows you how deep you’ve jumped, GoDefPop or Ctrl-T just pops to the last hop

Sample makefile

.DEFAULT_GOAL := build

fmt:
        go fmt ./...
.PHONY:fmt

lint: fmt
        golint ./...
.PHONY:lint

vet: fmt
        go vet ./...
        shadow ./...
.PHONY:vet

build: vet
        go build hello.go
.PHONY:build