2022年3月29日 星期二

Azure storage queue API return "The value for one of the HTTP headers is not in the correct format."

The cause was possible backward incompatible issue. After the view researching, it could be resolved by changed the request header 'x-ms-version' from the one your library used to old one "2019-07-07"

2022年3月25日 星期五

How to trigger a kubenetes schedule job manually

kubectl create job --from=cronjob/[cronjob name] [new job] -n [namespace]
sometimes you may encounter the error such as
"error: unknown object type *v1beta1.CronJob"
it was caused by the kubectl is different version. you can download the old one to resolve issue

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"c285e781331a3785a7f436042c65c5641ce8a9e9", GitTreeState:"clean", BuildDate:"2022-03-16T15:58:47Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.15", GitCommit:"0f9140665765825f8a4187cefd055e4b350b4a36", GitTreeState:"clean", BuildDate:"2021-09-17T23:04:02Z", GoVersion:"go1.15.15", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.23) and server (1.19) exceeds the supported minor version skew of +/-1

for me, my kubectl client is v1.23.5, but server is older version wiht v1.19.15, therefor I downgraded to the older one to resolve the issue
curl -LO https://dl.k8s.io/release/v1.19.15/bin/linux/amd64/kubectl

2022年3月20日 星期日

以銅為鏡可以正衣冠;以史為鏡可以知興替;以人為鏡可以明得失

人類總來都沒進步到哪裡去,歷史總是一而再再而三地重演,不管是俄侵烏發動的戰爭,或者現在政治上的紛亂,總是逃離不開歷史的重演

2022年3月9日 星期三

How to convert the ^M linebreak in a bash script

Use vim to edit the file and convert it to the unix format
:set ++ff=dos ==> ms-dos format
:set ff=unix ==>.unix format

2022年3月6日 星期日

How to group Ankiweb deck

use "::" to separate it
for example:

  • group1::sub1
  • group1::sub2

it will group decks "sub1" and "sub2" in folder "group1"

How to generate Anki Decks

1.use iphone to take a picture

  • you can choice use iphone to take OCR or directly take picture and covert it by yourself (From .HEIC format to png format)

2022年3月4日 星期五

如何判斷server 是否有使用load blance

如何判斷server 是否有使用load blance

使用hping2. 來看packets loss 或者 是否有使用load blance ,可以看到要是回應的id 有兩組號碼區間在回覆,吉表示有兩組server 在後段服務

`sudo hping2 -c 10 -i 1 -p 443 -S google.com

HPING google.com (en0 142.251.43.14): S set, 40 headers + 0 data bytes
len=52 ip=142.251.43.14 ttl=55 id=15396 sport=443 flags=SA seq=0 win=65535 rtt=9.1 ms
len=52 ip=142.251.43.14 ttl=119 id=39684 sport=443 flags=SA seq=1 win=65535 rtt=7.5 ms
len=52 ip=142.251.43.14 ttl=119 id=47763 sport=443 flags=SA seq=2 win=65535 rtt=9.8 ms
len=52 ip=142.251.43.14 ttl=55 id=3033 sport=443 flags=SA seq=3 win=65535 rtt=9.5 ms
len=52 ip=142.251.43.14 ttl=118 id=61592 sport=443 flags=SA seq=4 win=65535 rtt=7.5 ms
len=52 ip=142.251.43.14 ttl=119 id=62460 sport=443 flags=SA seq=5 win=65535 rtt=10.2 ms
len=52 ip=142.251.43.14 ttl=119 id=4097 sport=443 flags=SA seq=6 win=65535 rtt=7.5 ms
len=52 ip=142.251.43.14 ttl=119 id=15781 sport=443 flags=SA seq=7 win=65535 rtt=10.6 ms
len=52 ip=142.251.43.14 ttl=119 id=4205 sport=443 flags=SA seq=8 win=65535 rtt=7.5 ms
len=52 ip=142.251.43.14 ttl=55 id=65346 sport=443 flags=SA seq=9 win=65535 rtt=8.4 ms`

MTU大小問題

一班正常MTU 用1500 但vpn 可能可以設定1444
原則就是盡量不要讓封包被拆成兩個
可以指定封包大小來測試MTU設定是否適當
`

ping -c 1 -D -s 1500 8.8.8.8

`

Obsidian 插件介紹:Text Generator

Text Generator 是 Obsidian 的一個插件,它可以根據給定的提示自動生成文本。這個插件使用 GPT-3 語言模型,能夠產生類似人類的文本,非常適合編寫故事、文章、電子郵件和其他類型文本。 主要功能: **生成文本:**根據提示生成各種長度的...