raynix 筆記

raynix 筆記

  • Home
  • WordPress Hosting
  • Side Quests
Illustration of a bird flying.
  • How to Replace Characters in MongoDB

    TL; DR: As of MongoDB 6.0, this is how I learned to replace some characters in a field in all documents. In the example below all “.” characters in field_name will be replaced by “_” character: The backstory is when using MongoDB with MongoEngine, there’s an issue when a key in a dictionary field contains…

    May 30, 2023
    Systems Admin
    MongoDB
  • How to Sort Lines in YAML

    I asked myself this question and it turns out that I don’t need to write a script to do this, yq has the answer already. More on array sorting and map sorting 🙂

    April 28, 2023
    Opensource
    yaml
  • Sample Terraform Code to Manage Temporary Access to GCP

    TL; DR: This is a way to grant a temporary access to some GCP resources using Terraform’s time_static and google_project_iam_member resources. 🙂

    April 20, 2023
    Systems Admin
    GCP, IAM, Terraform
  • Solved: Uninstallation of config-connector Got Stuck in ArgoCD

    The Kubernetes Config Connector is another level of IaC(Infrastructure as Code): It wraps Google Cloud resources like a Cloud Load Balancer with Kubernetes CRDs(Custom Resource Definition) so instead of writing Terraform HCL I can write YAML to manage GCP infrastructure. However when there’s a need to uninstall a config-connector, it got stuck in ArgoCD As…

    April 11, 2023
    Systems Admin
    ArgoCD, kubernetes
  • SAUS: Such A URL Shortener

    TL; DR: It’s a simple but effective URL shortener I wrote in Python + Django, I consider it stable now. Also added QR code generator for mobile applications. Source code is in Github. 🙂

    April 11, 2023
    Opensource, Python & Frameworks
    SAUS, URL
  • How to Serve QR Images from Memory with Django

    TL; DR: I used SpooledTemporaryFile with FileResponse to server generated QR images directly from memory, no disk IO involved. Please see my code sample with notes: 🙂

    March 29, 2023
    Opensource
    Django, Python
  • Django DB Migration Job with ArgoCD

    A Job in Kubernetes is a one-off and immutable task to be carried out during deployment. But what if a job needs to run for each deployment? A new job with the same name can’t be deployed on top of the existing one, given it in completed or failed state. Since Kubernetes 1.23, A TTL(Time…

    March 28, 2023
    Systems Admin
    ArgoCD, Django, kubernetes
  • Caching in Python with Redis + @Decorator

    TL;DR: Here’s a simple Python decorator I wrote which can cache function results with Redis. Prerequisites The Python Decorator What’s a decorator in Python? Here’s a very easy-to-understand explanation just for the question. Below is my code of the decorator with notes: Done 🙂

    March 19, 2023
    Opensource, Python & Frameworks
    Python, redis
←Previous Page
1 … 6 7 8 9 10 … 109
Next Page→
  • Eric Lin’s Blog
  • Eddie Wang’s Blog at WP
  • GoalKeeper’s Blog

raynix 筆記

Just another WordPress blog

  • Facebook
  • Twitter
  • Instagram

Proudly powered by WordPress