Embracing the Messiness in Search of Epic Solutions

Home

Welcome to my encyclopedia of shitty code!

  • Nginx: Requesting and Configuring SSL Certificate

    INTRO Step by step instructions for my future self to obtain the SSL certificate and to configure it in Nginx because my fragile little brain cannot retain them at the moment. INSTRUCTIONS Generate a private key and store it in a safe place. Generate a certificate signing request (CSR). Request a SSL certificate from Certificate […] Read More…

  • GCP Logging Agent: Converting Unstructured to Structured Logging

    BACKGROUND The GCP logging agent uses modified fluentd, which allows us to do either unstructured logging or structured logging. The structured logging relies on JSON payload while the unstructured logging can be any texts. The advantage of structured logging is we can leverage log features in GCP Log Viewer. UNSTRUCTURED LOGGING Installing the unstructured logging […] Read More…

  • GCP Stackdriver Agent: “write_gcm: can not take infinite value” Error

    PROBLEM When running the stackdriver-agent (v6.x), the log file contains the following errors:- SOLUTION By default, the swap metric is enabled. To verify, go to /etc/stackdriver/collectd.conf and locate the following configuration:- This error occurs because the VM instance does not have swap memory, hence this metric plugin tries to divide by 0. To verify the […] Read More…

  • Terraform: Handling Errors with try(…)

    PROBLEM Given the following output block:- Sometimes, during an apply or destroy, we may get this error:- One way to fix this is to do conditional expressions like this, but it’s not pretty:- SOLUTION Since Terraform v0.12.20, we can solve this with try and achieve the same outcome:- Read More…

  • GCP: Deleting Project with Lien… Quickly

    PROBLEM The whole idea of placing a lien on a project is to prevent accidental deletion. But, sometimes it’s a little pain in the ass to attempt a project deletion in GCP Console only to find out a lien was set, especially during the development phase. Then, we grumpily open up Cloud Shell and run […] Read More…

  • Terraform: Skipping Buggy Provider Version

    PROBLEM Given the following required_providers block… … it will allow the following Google provider version: >= 3.8, < 4.0. As of today (May 10), the latest Google provider is 3.20.0. A quick terraform init confirms that. However, sometimes, there’s a need to skip a buggy version. For example, 3.20.0 breaks google_compute_firewall. SOLUTION To achieve that, […] Read More…

  • GCP + Terraform: Running Terraform Commands with a Service Account

    PROBLEM When running these commands… … it allows terraform apply to provision the infrastructure using your credential. However, sometimes there’s a need to run Terraform using a service account. SOLUTION First, identify the service account you want to use… for example: [email protected]. Then, create and download the private key for the service account. Command: Output: […] Read More…

  • GCP + Kitchen Terraform: Local Development Workflow

    INTRODUCTION Here’s a typical workflow for implementing and running Kitchen Terraform tests outside of the GCP environment, for example, from an IDE on a Mac laptop. Enable “gcloud” Access Command: The first step is to ensure we can interact with GCP using the gcloud command using our user credential. This is needed because the tests […] Read More…

  • Git: Configuring Different Git User Info Depending on Projects

    PROBLEM Given, the following global config stored under ~/.gitconfig… When committing any code, the above user info will always be used. However, there are times you want to use a different user info depending on projects (ex: work projects, GitHub projects, etc) SOLUTION This is one of many ways to solve this problem. Let’s assume […] Read More…

About Author

This author has 20+ years of experience in software engineering and cloud engineering. In an industry where knowledge becomes obsolete in the next three months, he learns anything that crosses his path indiscriminately. He floats from one technology to another like a moth and stings the problem sets like a mosquito. This author codes Java while drinking Espresso and writes Spock specifications while listening to Groovy beats. He masters Google Cloud Platform just like how he masters the art of predicting the movement of dark clouds over his backyard, where 60% of the time, he is right every time.

This author suffers from the Dunning-Kruger effect, where he overestimates his competence and underestimates his ignorance. Technology buzzwords never faze him, for he does not know enough to be afraid of in the first place. GCP, GCS, GCR, GKE, GWT… everything sounds the same to him. He never fears acronyms, synonyms, or antonyms, for he has ChatGPT in his back pocket. This author is a jack of all trades but a master of none. He writes like he knows all the answers, yet he googles for better solutions from elsewhere. He fakes it until he makes it; if he doesn’t, that’s okay because he has the attention span of a squirrel. The blog posts are his buried walnuts, in case he needs them one day.

In conclusion, this author is full of something. He apologizes in advance if you are trying to solve your company’s real problems with his shitty solutions. There, he has successfully written paragraphs of nonsense because every professional blogging website needs a section about the author, with a too-cool-to-smile portrait staring sideways into the abyss.