Optimizing Docker Container Image Size

Introduction When I was containerizing my blog search service, I went through multiple iterations of the Dockerfile as I was learning how to create an image. Containerizing was easy but I wanted to create a small and efficient image and that process was a bit more involved than I expected. I want to go into a little detail about what I learned about writing a Dockerfile that puts importance on the final image size....

January 7, 2024 · John

Updating Blog Full Text Search

Introduction A few years ago I switched from WordPress to Jekyll and I lost full text search. But then I remembered I’m hosting my blog on my own server! So I wrote a Full Text Search service to restore the only feature I lost in the transition. This was working great until I moved from Jekyll to Hugo. The search Javascript needed a slight tweak but otherwise search was still working....

December 5, 2023 · John

A Better Vaultwarden Deployment

Introduction Earlier this year I looked at switching from Bitwarden (online service) to self hosting Vaultwarden. The post I wrote was fairly high level and focused on different container options. It was a fairly generic deployment that didn’t go into much detail. Configuration and security considerations were woefully neglected in that post. It also didn’t go into detail about how I’d integrate it into the VPS that I use as VPN, DNS, and now password vault server....

November 26, 2023 · John

Vaultwarden a Self Hosted Password Vault

Introduction When Lastpass first came on the scene I jumped on it because of how easy it makes syncing passwords between devices. Previously, I was using a local password manager that was only on my computer. Thankfully, mobile logins weren’t nearly as necessary for daily life back then. However, I still needed my computer to log into anything on my phone. Over the years, Lastpass started having security incidents. This isn’t surprising with how big it became....

March 16, 2023 · John

String List in C

Introduction Currently we have a generic list container which uses void pointers to allow anything to be stored. Previously, we created a type safe string hashtable wrapping the generic hashtable. We want to do the same thing for our list and so now we’re going to create a type safe string list wrapping our generic list. Design Unlike the string hashtable we want to extend the our string list to have some string specific functionality....

April 22, 2020 · John

Generic List in C

Introduction Lists (dynamic arrays) are yet another super useful data structure that C just doesn’t have. C arrays are great for when you can get away with a fixed size but not so fun if you need to dynamically expand because you don’t know quite how many elements you’ll need. You could use a series of reallocs and memmoves but that’s going to get old really fast. It’s also error prone and not obvious when growth is needed....

April 9, 2020 · John

String Hashtable in C

Introduction We have this amazing generic hashtable and we can put pretty much anything we want into it, but it has a few flaws. It uses void pointers and has a pretty verbose setup with that callback struct. If you’re using the same types over and over again you’ll have a lot of redundant code. There is also a much more pressing issue of void pointers. They remove type safely. It would be really bad if you passed the wrong type to a hashtable meant for another....

March 28, 2020 · John

Generic Hashtable in C

Introduction So, C doesn’t have a native hashtable object but that’s not a problem because we can use one one someone else wrote. Lack of a robust standard library is probably the biggest impoundments of working with C. It’s a real shame C doesn’t natively support hashtables because they are so versatile. You should keep this saying in mind, “when in doubt hash it out”. It works for programming and for life in general....

March 6, 2020 · John