Using Go Vanity URLs with Hugo

Go vanity import URLs are useful tools for maintaining a consistent import path for public Go packages, even if one changes code repository location. In this article, I show how to set up vanity URLs in a website built by Hugo and deployed on Netlify for Go packages hosted on a third-party site such as GitLab or GitHub.

Photo by: Jon Tyson (original)

Remote Time Machine for Multiple Macs

Time Machine, the built-in backup tool for MacOS, makes it relatively straightforward to set up a network share to be a backup target for a Mac computer. However, there are difficulties when trying to use the same share to backup multiple Mac systems. In this article, I highlight some of the issues and solutions associated with more than one computer running Time Machine backing up to a single network share.

Exploring the Synology PhotoStation API

I’ve started to use PhotoStation on my Synology NAS device at home to organize my photos and provide easy means to access remotely. I have been quite pleased overall, especially with the integration with the DS Photo app which can sync photos from an iPhone’s camera roll to the Synology NAS.

I was looking for an automated way to sort my photos into a hierarchy of folders by date. Unable to find a built-in way to do this or any public documentation for the PhotoStation API, I set about to explore the API and see what I could figure out.

The Magic of Go Comments

Comments are a valuable tool for documenting and communicating information about code. They are a common feature in nearly every programming language and Go is no exception. However, comments in Go programs can do far more than providing information readers of the code. In this article I will highlight some lesser known uses of comments within Go that have special – almost magical – behavior.

Using SO_PEERCRED in Go

At this year’s GopherCon, Gabbi Fisher (@gabbifish) of CloudFlare made a great presentation introducing her audience to the complexities of network socket options in Go (archived video of her presentation here). In her talk, Gabbi details how to use the network socket option SO_REUSEADDR to allow multiple processes on the same server to listen on the same network port. Gabbi closes by mentioning the breadth of socket options that are available beyond just her example. Inspired by her talk, I’ve decided to write about the SO_PEERCRED socket option and Go.

Using Page Bundles to Organize Resources

Last year, Hugo introduced the concept of page bundles. Page bundles give website authors a new way to organize all the resources (.md files, images, etc…) of a page together. In this article, I show how I transitioned some of my existing posts to use page bundles without changing the final website layout and appearance.

Photo by: Gigi (original)

Using Go Flags in Tests

Many developers are familiar with the flag package from the Go standard library. This package provides an easy method for adding command line options and argument parsing for Go programs. What may not be as well known is that flag can be used in Go unit tests as well.