技术

  • 性能,  技术,  网络

    How to debug slowness of remote calls?

    This is a good article: https://blog.cloudflare.com/a-question-of-timing/ This is my .curlrc file: --write-out "dnslookup: %{time_namelookup} | connect: %{time_connect} | appconnect: %{time_appconnect} | pretransfer: %{time_pretransfer} | starttransfer: %{time_starttransfer} | total: %{time_total} | size: %{size_download}\n" Run this curl Return:

  • database,  技术

    Database Basis

    Normalize & Denormalize Normalization is the technique of dividing the data into multiple tables to reduce data redundancy and inconsistency and to achieve data integrity. On the other hand, Denormalization is the technique of combining the data into a single table to make data retrieval faster.

  • 技术,  网络

    How TLS handshake works

    This chart is based on the article here: https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/ It would be much clear to be able to show it in a sequence chart. The key point is in each step what client/server has to generate sessionKey. The premasterSecret is the key factor here. it got generated in the client side by using the pubic key generated in server side. In this way, client side has it’s value (since it generated in client side) and the server side can get it by using private key to decrete it. Sequence diagram source code: mTLS mutual TLS is enhanced TLS which server side needs to verify the identity on the client side…

  • Linux,  工具,  技术

    Mac command line cheat sheet

    Behavior Command Comment go to the beginning of the line ctrl+a go to the end of the line ctrl+e Save a output of a command to a env variable principle_arn=$(aws –profile perAdmin sts get-caller-identity –query Arn –output text) use a env variable ${principle_arn} replace character sed -e “s|PRINCIPAL_ARN|${principle_arn}|g” \assume-role-policy-template.json > assume-role-policy.json The delimiter of choice is a forward slash (/), which is the most commonly used delimiter. However, sed can use any character as a delimiter. In fact, it will automatically use the character following the s as a delimiter-e means you can use the followed scripts multiple times.https://unix.stackexchange.com/questions/33157/what-is-the-purpose-of-e-in-sed-command

  • 工具,  技术

    Kibana Query cheatsheet

    Example Query Result DSL message:”a test” 1 match phase message: a test 1, 2 match message.keyword: “a test” none match phase message.keyword: “this is a test” 2 match phase KQL got converted to DSL before sending to the server: We can check the related DSL by clicking “inspect” button in UI. Reference: https://xeraa.net/blog/2021_kibana-map-kql-url-elasticsearch-query/