Skip to content

Learning Caddy Server

As part of setting up my new home server, I decided to learn Caddy. Caddy is a replacement for nginx/apache. With its plugin system, zero-config SSL support, and modern architecture, it’s a good bit more powerful. It’s been a while since I’ve used something that just felt right: well-designed, great abstractions, good defaults, etc. I’m really impressed with what they’ve built. It’s a beautiful piece of software with well-written documentation. It’s pretty easy to use, but I ran into some sharp edges and wanted to share my experience and my example Caddyfile. Caddy Features It’s designed for local development and production usage…

Continue Reading

Understanding DNS Requests on macOS

The DNS Stack Here’s a quick overview of how the DNS stack on macOS works. Much of this also applies to linux. cat /etc/resolv.conf contains a list of potential DNS resolvers DNS servers work off of UDP (not TCP) on port 53, but at this point, there are multiple DNS protocols that use different ports and configurations. You can see the DNS resolvers assigned to a specific device using scutil –dns This list is autogen’d and managed by the DNS settings of the current network device Unlike linux variants, this is not managed by NetworkManager and instead uses macOS-specific tooling, much of which is opaque…

Continue Reading

Fast, Local, Written-by-you Code Search

I work with many disparate open-source repos in many different programming languages. I often encounter a problem that I know I’ve solved before, but I can’t remember where I solved it. When I worked at Stripe, we had livegrep. It searched all of the repositories across Stripe in real-time. GitHub has an awesome code search tool now too. I love code search: often, it’s easier to "grep the internet" for obscure usage examples than asking ChatGPT or Google. However, what was missing was a code search tool I could quickly run on the command line to search through local Git repositories that were mostly written by me…

Continue Reading

Learning Elixir and Ecto

I’m finally posting a long-running learning document that I wrote as I I continued work on my original Elixir side project. I stopped working on this for at least a year and recently picked it back up as part of exploring some technologies for my next startup. This post got way longer than I expected, but hopefully, it’s a great compendium of notes and learnings from someone trying to learn Elixir who has a strong understanding of ruby, python, javascript, etc. What I’m learning Here’s what I’m going to be learning: How does Ecto work? Supervisor, tasks, processes, etc. "Let it Crash" philosophy. What exactly does this mean in practice?..

Continue Reading

Re-learning Modern PHP

A while back, I ran into Monica (a sort of fancy address book). I started to use and self-host the project as part of tinkering with my raspberry pi and then wanted to make a couple of improvements to the project. This was a good excuse to explore the PHP world and see how things have evolved since I touched the language over a decade ago. I’m surprised to say this, but working with PHP was not nearly as painful as I thought it would be. The language and tooling have evolved nicely over the years. If I was forced to use PHP as my daily driver, I wouldn’t be too disappointed!..

Continue Reading

Fixing Word Navigation in ZSH

Moving to zsh from bash has been a great quality of life improvement. However, there is one thing that has driven me nuts that I have not been able to figure out: customizing the word boundary definition. I’m using zsh 5.9 and have a lot of plugins. forward-word ,backward-word , and the kill variants were the main widgets that I use. I used bindkey to determine these functions. After some investigation, it seems like these widgets are controlled via zstyle ':zle:*' configuration. You can dump configuration via zstyle -L You can determine what underlying zsh function is used by a widget via zle -lL…

Continue Reading

Using HTTPS Locally: Pow, SSL, Rails, and Apache

Using HTTPS local development or testing environments is a hassle. A common practice is to disable SSL in development, but I’ve had too many cases of minor bugs creeping in when routing works differently between environments. I also don’t like manually having to let my browsers know that a self-signed certificate is valid. Here’s the configuration that I use to easily add https support on my development machine to any application served—or proxied—through port 80. Pow I use Pow as my development rails server. However, because I often work with other languages as well, I run Apache (you could just as easily use nginx) and reverse proxy Rails application requests to Pow. To do this, you’ll need Pow to bind to a port that is not port 80…

Continue Reading

Rails & Yosemite: Resolving libv8 and therubyracer Installation Problems

As a developer, upgrading to a new OS is always a task, especially when it comes to rails dependencies (surprisingly, Cocoa projects didn’t have as much of an issue with Yosemite). I always wipe my machine and start fresh. This introduces a new class of problems, some of which I was able to mitigate this time around with mackup (a preference backup and restoration tool) and some upgrades to my dotfiles. I customize bundler to work in parallel, store all gems for a given project in the vendor/ directory for that project, and to not use shared gems at all…

Continue Reading