• Terraform, please don't be dumb

    Cache invalidation is one of the hardest things to solve in computer science. Cloud DevOps is also really hard. Why terraform decided that you needed to cache cloud provider state is beyond me.

  • Kubernetes Day 1

    Enough cribbing about tooling, let’s run some containers!

  • 5-minutes to Python packaging

    Collection of trivial Python package ecosystem tidbits.

  • New Job

    It’s been about 3 weeks since I started at Microsoft again, and I think it’s important to share some internet memes about it. These memes do not necessariy represent any truth or lies about Microsoft and they are entirely my opinion and not necessarily Microsoft’s.

  • Can't avoid Kubernetes anymore

    Time comes for us all, and this time it came for me. I can’t avoid learning Kubernetes anymore so here we go!!!

  • My C# project structure

    Writing C# code involves using msbuild as the build system that resolves dependencies, orders projects topologically, compiles your codes, gathers your output files, creates publishable artifacts, etc. I learned to author msbuild project files quite well at Microsoft, and I got a few opinions out of it. In this post, I will summarize the best practices I have learned working with msbuild for C# development since 2016.

  • Slightly complex VSCode launch configurations

    VSCode supports starting and debugging processes through its launch configuration system, largely configured with the tasks.json and launch.json editor configuration files. Launch configurations control what happens, and in what order, when you press F5 and the green play button in the debug pane. As a project grows in scope and in team members, I have learned that it is easier to tell other developers “just press F5 and everything will just work” rather than asking them to read README files.

  • REPLs

    Introduction

    My latent ADHD is manifesting as an intolerance for the slowness of the .NET inner loop, specially when reality is more like:

    1. Write some C# (fun)
    2. Build (not fun, MSBuild is 🐢)
    3. Run (kinda fun, but in reality this means getting your program to the right state which is repetitive and loses novelty after the first run)
    4. Debug (Bash your head onto your keyboard until you understand what’s wrong)
    5. Enlightenment 🔥
    6. Go to 1
  • Hello LLDB

    Introduction

    I am reading through Crafting Interpreters by Robert Nystom and one of the first exercises asks you to write and debug a doubly-linked list in C. Regretfully I confess I never actually learned how to use GDB, ever, and on macOS I need to use the LLVM toolchain which means using LLDB instead of GDB. In this post I will write using LLDB to debug a simple C program.

    Reference program

  • Linux Disk Reference

    Running out of disk space on a system can be much more disruptive than running out of memory or being under high load. Recently at work we experienced a brief outage due to a machine (not a VM!) whose disk filled up with log files, which caused the application writing to disk to crash, which made the machine useless, which led to the outage. The mitigation was to release disk space, start the application, and configure it to limit its disk usage and to clean up logs. The investigation that led to discovering the issue was a pleasant trip through the different file system and disk utilization tools, and this may prove useful to me or someone else in the future.

  • Linux Networking Reference

    Contents

  • Fun with NeoVim 0.7

    Introduction

    I kept seeing posts on HackerNews about NeoVim so I decided to try it out and see what it can offer that vim cannot. In college, I used vim for almost all my classes but I haven’t used vim proper much at work aside from plugins and bindings for Visual Studio and Visual Studio Code. The general vibe I got is that that NeoVim addresses all of the old nonsense legacy crap defaults that vim maintains because of “backwards compatibility”. With fresh eyes, the 21st century should likely deliver better text editor defaults and designs than the 20th.

  • Final thoughts on F#

    Introduction

    F# is a primarily functional language for the .NET ecosystem. It is the functional cousin of C# and contains many features that slowly make their way into C# as developers demand more functional programming features out of C#.

  • Rust Day 2: Linked Lists

    Today I was inspired to continue learning Rust by implementing what every CS student eventually has to know backwards and forwards to get a job: a singly linked list. This shouldn’t be too hard, my list will support:

    1. Appending elements to the list one at a time
    2. Iterating over elements
    3. Determining the length of the list by iterating from head to tail
    4. Deallocating the list
    5. Using Rust modules (just to learn how they work)
  • Fun with jq

    What is jq?

    jq is a wonderful tool for processing JSON in the command line. The prevalence of JSON in web APIs and data dumps makes jq a very imporant tool for interactively manipulating JSON. The tutorial is good enough to get you started with basic functionality, but I found that real usage quickly outgrew the scope of the tutorial. In this post I will show examples of using jq in slightly more complex scenarios than the tutorial.

  • Swagger from C# code

    Problem

    At work we write a lot of ASP.NET REST controllers. Some of the controllers have their API documented in the Azure REST API specs in the form of a Swagger specification, and some are consumed internally by a system that requires us to expose a Swagger specification. This is our problem: say we want to write a controller for Widgets that supports CRUD operations. A developer has to:

    1. Write the C# code.
    2. Write the Swagger JSON necessary.
    3. Ensure (erm, try really hard) to make sure the swagger and the C# stay consistent with each other.
    4. Ship the Swagger to the clients.
  • Logging with Expressions

    Problem

    We recently had a problem at work where a piece of code was throwing an exception with the message “System variable should be X but is Y”. The problem was that we had no idea which value was incorrectly set, and we were so deep into highly reusable generic code that pushing the value name via method parameter would have required touching dozens of call sites.

  • Rust Day 1

    I’m learning Rust to get my systems programing muscle back into shape after living in C# land for a few years. C# is a very nice language and the tooling ecosystem around it is wonderful, but all the serious systems programming is happening in C/C++ and now Rust. I will try to document my baby steps into Rust for myself and for anyone else that wants to learn Rust after having programmed in C# for a while.