Blog

  • openssl 学习测试 ssl

    建立连接

    openssl s_client -connect jpuyy.com:443
    

    测试 cpu 计算时间

    openssl speed rsa
    Doing 512 bit private rsa's for 10s: 45248 512 bit private RSA's in 10.00s
    Doing 512 bit public rsa's for 10s: 615186 512 bit public RSA's in 9.98s
    Doing 1024 bit private rsa's for 10s: 14429 1024 bit private RSA's in 10.00s
    Doing 1024 bit public rsa's for 10s: 246314 1024 bit public RSA's in 9.99s
    Doing 2048 bit private rsa's for 10s: 2131 2048 bit private RSA's in 10.00s
    Doing 2048 bit public rsa's for 10s: 76749 2048 bit public RSA's in 10.00s
    Doing 4096 bit private rsa's for 10s: 315 4096 bit private RSA's in 10.02s
    Doing 4096 bit public rsa's for 10s: 21302 4096 bit public RSA's in 9.96s
    OpenSSL 1.0.2k-fips  26 Jan 2017
    built on: reproducible build, date unspecified
    options:bn(64,64) md2(int) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) 
    compiler: gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
                      sign    verify    sign/s verify/s
    rsa  512 bits 0.000221s 0.000016s   4524.8  61641.9
    rsa 1024 bits 0.000693s 0.000041s   1442.9  24656.1
    rsa 2048 bits 0.004693s 0.000130s    213.1   7674.9
    rsa 4096 bits 0.031810s 0.000468s     31.4   2138.8
    
  • mac 鼠标指针慢

    接了外接的 usb 鼠标后,会出现拖动无力的情况

    重置NVRAM 或 PRAM 之后,鼠标非常顺畅

    OPTION+Command+P+R+POWER

    Option-Command-P-R: Reset NVRAM or PRAM. If your Mac is using a firmware password, it ignores this key combination or starts up from macOS Recovery.

    https://support.apple.com/en-us/HT201255

    打开 System Report => 图像显示, 发现
    UI Looks like: 2560 x 1440 @ 29.00Hz
    想办法证它显示 4k 60Hz
    下载 SwitchResX4.zip,选 2560x1440x60Hz 在 DELL U2720QM Display 效果最好

  • Local ArgoCD playground

    $ brew install argocd

    $ argocd version

    $ kubectl port-forward svc/argocd-server -n argocd 8080:443

    $ kubectl get secret argocd-initial-admin-secret -n argocd -o json | jq “.data | map_values(@base64d)”

    “` reset password
    # bcrypt(xxxx)=$2b$12$H5jWbxxxxxxxxxxxxxxx.3aaA2xLQY4iZHZgI.y
    kubectl -n argocd patch secret argocd-secret \
    -p ‘{“stringData”: {
    “admin.password”: “$2b$12$H5jWbxxxxxxxxxxxxxxx.3aaA2xLQY4iZHZgI.y”,
    “admin.passwordMtime”: “‘$(date +%FT%T%Z)’”
    }}’
    “`

    argocd login –insecure –username admin –password xxxx –grpc-web 127.0.0.1:8080

    cat ~/.argocd/config

    command line
    https://argo-cd.readthedocs.io/en/stable/user-guide/commands/argocd/

  • macOS 鼠标 触控板

    鼠标设置,tracking speed / 双击以及滚动速度调到离最快 两格

    触控板
    勾选 Tap to click
    Click => light
    Track Speed => Fast

    三指拖拽
    https://support.apple.com/en-us/HT204609

  • VSCode Notes

    https://code.visualstudio.com/docs/setup/mac

    # 尽量用快捷键
    command + shift + E 浏览打开的代码及文件目录 反复按可切换

    # Are you using a screen reader to operate VS Code? (word wrap is disabled when using a screen reader)

    # Golang env:
    Go to View menu; select **Command Palette**
    command + shift + p, type

    Go: install/update tools => select all

    Tools environment: GOPATH=/Users/yang.yang/go
    Installing 8 tools at /Users/yang.yang/go/bin in module mode.
    gopkgs
    go-outline
    gotests
    gomodifytags
    impl
    goplay
    staticcheck
    gopls

    # shell
    # Golang env:
    Go to View menu; select **Command Palette**
    command + shift + p, type
    shell
    _”Install ‘code’ command in PATH”_

    # preferences
    command + shift + p, type

    preferences

    # install Gitlens

    Extentions
    Code Runner

    # Set tab indentation
    Settings, search `Tab Size`, set to 4

    # Improve the word spell, grammarly
    https://marketplace.visualstudio.com/items?itemName=znck.grammarly

    # Set max line width alert: 80, 120
    “editor.rulers”: [80, 120]

    # Set Word Wrap
    Editor: Word Wrap, use `wordWrapColumn`
    Editor: Word Wrap Column 80

    # collapse all the folders in the explorer
    Command +

  • microsoft desktop client

    For mac user Install Microsoft Remote Desktop. https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-clients

    beta version

    https://install.appcenter.ms/orgs/rdmacios-k2vy/apps/microsoft-remote-desktop-for-mac/distribution_groups/all-users-of-microsoft-remote-desktop-for-mac