Recently I have been researching a way to automate the process of deploying some of my hobby projects. Frankly speaking nowadays I just pack everything in a docker container and call it a day, but as I rather very low-end servers (💸) I didn’t want to bring Swarm/Kubernetes overhead to the table (I had some pretty nice experience with Swarm a few years ago, but it seems k8s is eating the industry if you like it or not 🤷♀️).
Recently I decided to give an asdf a go as I wanted to switch from my old rvm / nvm / homebrew-for-other-langs setup (plus I wanted to give a dart a try). Unfortunatelly installing ruby 2.6.x for one of the projects under Catalina was a true PITA.
I was surprised that previous blog post about how to implement PhotoSwipe gallery using StimulusJS got so much traction (give the fact I spent 0 time promoting the blog and traffic is purely organic). So I decided to give it a follow-up and throw some ideas on how you can implement video support in PhotoSwipe using awesome Plyr library.
Below be some bunch of notes, for future self. As I’m getting older I like to think I’m also getting wiser - at least in some areas of my life. When I look back at myself, as an eager and enthusiastic, but inexperienced developer and at myself now - I can clearly see that I’m much more patient in general. I realized it’s a marathon and not a sprint (Hopefully. Unless you know - we will all die soon in 2020).
There is an official guide regarding ipv6 configuration using Ubuntu’s netplan. It seems it skips one crucial thing tho - and that is default route. The route step is mentioned in non-persistent and file interfaces sections (the ip -6 route add part). In order to fully get v6 working on their VPS I had to add the route via routes declaration in netplan yaml configuration (Ubuntu LTS 18.04).
Let’s say you have a go app deployed under docker and you want to handle kill signal send by docker (when docker stop is executed or when your service is being updated by docker swarm or whatever orchestration service). This usually should happen on long-running processes that need to close some connections, stop accepting new work before shutdown and so on.
I have been trying to tune down the usage of Google services in my life in the last couple of months. The monopoly google has regarding the global Internet is simply not healthy and we should be more aware of whom we gave our data. Over the years we very easily traded privacy for convenience without even noticing. At least I did.
A few weeks ago I gave Terraform a try. Ansible was my go-to tool when coming to managing servers for quite some time ago and I loved it for its simplicity and flexibility. So what about Terraform?
I wanted to write this post for a long time. I have first drafts from Q3 of 2018, yet I never had the chance to crystallize my thoughts on that matter. Because how you demystify a legacy project? And not only in Rails but in general? I guess the answer is the same as for many other similar questions - it depends. Technical debt is unavoidable. One split there, another over there. Your team has a worse day, requirements are unclear, you have no better idea, you’re annoyed, frustrated, business requirements changed, you pivoted. Bam, a few months later you wonder who wrote this pile of crap? Oh yeah - it was you. Or blame the other guy/gal. Because it’s a tradition. Instead of trying to form my thoughts into nice words I will put a list of bullet points for future references - hoping that at least some of them will be still useful and valid.
I had overall good experience with Traefik 1.x used on Rancher 1.x (before they switched to Kubernetes, rest in peace Cattle container orchestration) and recently I have been trying to migrate my tiny playground infrastructure to Traefik 2.0. Unfortunately, the API is completely different and you have to wrap your head around the new concept how to handle load balancing from scratch. It seems official documentation is still not there yet so I’m gonna post some general examples specifically for load balancing docker services using docker labels alone (without using file configuration at all) - hopefully somebody will find it helpful.