-
Cheat Sheet: From SQL to NoSQL
Recently I was fascinated by MongoDB’s flexibility to change data structure on the fly, in contrast there will need a ALT TABLE SQL statement for any schema change in a SQL database. Here I make a list of typical operations and how they are done in both SQL and NoSQL(in my case, MongoDB) flavours. Create…
-
A Simple RabbitMQ Consumer with Python
Here’s a very simple RabbitMQ consumer in Python, deployed in a Kubernetes cluster. I used this to act as a consumer for testing purposes. First the Python code: The above code can be saved as a ConfigMap in the cluster: Then the Kubernetes manifest: At last this can be simply deployed with 🙂
-
How to Add Extra Scrape Configuration for Prometheus
After some recent updating to my home server running Ubuntu Server 20.04, the InfluxDB server suddenly stopped working. I’ve used InfluxDB + Telegraf for many years, the combination worked very well without much maintenance. But as I have deployed some new-ish stuff – Prometheus, Loki, etc. in my garage Kubernetes lab, I think it’s time…
-
How to Easily Enable Webhook Mode for Python Telegram Bots
I created a Telegram bot(@wordsquad_bot) using python-telegram-bot framework. There are 2 modes to run the bot: Since my bot has got almost all features and run stably for a while, I decided to setup webhook for it. I came across a few articles and did a bit of troubleshooting myself so here’s probably the easiest…
-
Kubernetes 1.24: Bye Bye Docker
Since I just got extra 4 CPU cores and 32GB of memory to my garage Kubernetes lab cluster, there’s enough capacity to let me juggle some upgrades. My cluster was running Kubernetes version 1.22 for almost a year which is already reaching end-of-life in many commercial managed Kubernetes offerings. After some reading I found that…
-
Ubuntu Server 20.04 on ThinkPad W520
10 years ago, I would dream for a ThinkPad W520 laptop: imagine 4 cores, 8 threads, 32GB memory and 160GB SSD in 2012! I saw one of these old battleship-class laptops Gumtree the other day so I bought it without much hesitation – It’s still very good as a mini server even in 2022. In…
-
How to Use YAML as Data Source in Terraform
I love how DRY and lean YAML can be, since I started to learn Ansible years ago. Recently I wanted to provision MySQL user privileges right after the database instance provisioned in Google Cloud SQL. I used petoju/mysql Terraform provider to get the job done, it’s a community provider but seemed to be quite popular.…
-
Monitoring as Code with Grafana
TL;DR: I used Grafana Helm charts and ArgoCD to deploy dashboards as code. I’ve been using Grafana to build dashboards for years, both at work and as a hobby. A dashboard was created by hand for monitoring my garage Kubernetes cluster. Since I’ve adopted gitOps with ArgoCD a few years ago, what about going forward…