Posts
Export resources and reconstruct resources in azure
My credit of Visual Studio Professional Subscription azure is $50. In the past two days, I activated my subscription. I didn’t go IaC way to setup my POC environment as I did’t have enough time to do that. After I setup more services, the 10 credit is used. It can be quickly used up if resources are kept running. I know there is a way to import existing resources as I used terraform in the past.
Posts
Run anki in wsl2+ubuntu 22.04
I daily use anki to review things. However I have issues to run it in wsl2+ubuntu 22.04 environment. The only solution for me is below.
The workable version is 2.1.66 Qt5 with the following environment variable
export QTWEBENGINE_CHROMIUM_FLAGS="--disable-seccomp-filter-sandbox"
Posts
Install selinux and disable it
After thrice attempts, I finally successfully completed the task Selinux Installation at https://engineer.kodekloud.com/practice. Since it is not straightforward, I posted here.
> sudo yum install -y selinux* > # SELINUX=disabled > # change SELINUX in /etc/selinux/config > cat /etc/selinux/config | grep SELINUX # SELINUX= can take one of these three values: SELINUX=disabled # SELINUXTYPE= can take one of three values: SELINUXTYPE=targeted
Posts
Ways to improve performance within budget constraints
Say in a situtation where budget is fixed, what will you do to improve system performance?
I came out several solutions to this at first, later I came out with more thoughts. I list them here for later reference.
create selective indexes
partition tables
materialized view
asynchrous processing: put non real-time operations as a job queue, spread jobs to non business hours, non peak loading time etc.
Posts
error handling in api idempotency: timeout and retry
In stripe doc, Stripe explain how it works as following quoted contet. Other places only mentions that the processes will be only once.
Stripe's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Then there is an interesting question how to handle timeout and retry cases?
Posts
API idempotency
I leant API idempotency many years ago when I worked in Asia Fusion Technologies. At that time, I was involved in integration with payment systems and games from different vendor. That gave me a chance to read a lot of API documents and evalute them. During that time, one interesting characteristic of API got my attention. It is API idempotency. That time, there is no much information of idempotency how to implement etc.
Posts
My tilt asciinema cast
Today I read agones site and noticed it play asciinema cast in its home page. I wondered if I can put my asciinema cast into my blog. Here is my one.
AsciinemaPlayer.create('/casts/497308.cast', document.getElementById('497308'), { }); The cast is about how to use titl for local micro-service development based on kubernetes.
Posts
Kubernetes while redirection into a file
My first attemp to resolve "Kubernetes Time Check Pod" in https://engineer.kodekloud.com is not successful. The exercise doesn’t allow to open an editor to edit a yaml file. I had to resort to cat. I attempted several times to resolve it on my local cluster, still no luck even I tried different combination such as command, args,string in string, avoiding expansion. This one from stackoverfow gave me a clue how to resolve my issue.
Posts
Faster way to restart static pods after configuraiton changes
In the past several days, I practiced several exercises for my coming CKS exam. I noticed that it takes a while to get static pods restart after configuraiton changes. I was curious if there is any faster way to make that happen. I think the following ways definitely will be faster than waiting 3 minutes after I used them for a while. The observable time is shorter than 3 minutes
Posts
Convert statistics information columns to rows in sql
I encountered an issue how to get detailed information based on statistics information such as minimum and maximum values in a dataset. The traditional way might be use case expression,coalese functions etc to archive the goals, However I felt it is quite clumsy.
How do it in a neat way? In SQL standard, there is a way using unpivot to transform columns to rows. It is a good fit for this situation to get a neat SQL statement to resolve the issue.