技术
-
How to encrypt a file
We can use Zip with password but sometimes we just want to encrypt it or decrypt it directly. There is OpenPGP standard we can use. In Mac we can use https://www.gnupg.org/. Encryption with a password:
-
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:
-
Issues to switch to Xfinity Gateway (Router Changes)
There are several things we need to do to make things easier when change router You will run into following issues: Next time, if I want to change router, most of smart device would just work but I need to: Notes Limitation on the Xfinity Gateway Pending issue
-
MySQL cheatsheet
Save password in .mylogin.cnf
-
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.
-
Linux command – Cheatsheet
Line number Sort slow query log Find lines start with specific characters Exclude characters
-
Handy Bash Command
It always very handy to know a little bit bash to do file operation. E.G. generate SQL by csv. Convert csv to a SQL: Input Script Output Notes: Generate UUID and convert big case to small case
-
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…
-
Work Suggestion: Don’t hesitate to take leave
Some people are afraid of taking vacation because they worry that it would impact their performance. If you look at how we evaluate people it really about two things: Most of cases, taking leave would help you perform better.
-
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