原创 MacbookPro-Ubuntu-Settings

0x01 Background Now, I've got a new air book(m1), and the old mbp(mid2014) was totally useless. So, I installed Ubuntu o

原创 cpp-d05-C++20協程初探

0x00 雜記 看了幾天,雲裏霧裏。先做點筆記. 寫在最前面,協程不會帶來性能提升,相反,在drogon項目中實測,接口性能有所下降。(當然,有可能是寫法問題 同時,協程和調用方,是在同一個線程中。所以省去了線程切換成本。 好處,是爲了

原创 cpp-d03-drogon-web開發入門

排行來源:https://www.techempower.com/benchmarks/ 今天來學習一下由國人開發的瘋狂刷棒的api 框架:drogon 0x00 準備C++WEB開發環境 從源碼安裝,生成項目配置工具。 git clon

原创 cpp-d01

0x01 數據類型 cout << sizeof(char) << '\n' << sizeof(short) << '\n' << sizeof(int) << '\n' <<

原创 cpp-zlib-string-compress-uncompress

#include <iostream> #include <cstring> #include <zlib.h> #define CHUNK_SIZE 16384 int compressString(const std::string

原创 Linux-Cpp-D01-使用靜態庫

0x01 Cmake中使用.a庫 使用find_library 指定靜態庫變量,在target_link_libraries中使用變量。 cmake_minimum_required(VERSION 3.19) project(hello_

原创 Linux-C-Day6-線程

1.子線程創建 pthread_t pthread_create pthread_self // // Created by gorey on 2023/02/27. // #include <stdlib.h> #include <s

原创 Linux-C-Day4-curl

Mac環境配置 原本是想通過源碼編譯 curl, openssl, 發現各種小問題。 最後發現, 還是 `brew install curl` 一條指令搞定。 If you need to have curl first in you

原创 Linux-C-Day3-進程

進程 fork 進程複製,子進程依賴父進程執行時長 #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main(void) { pid_t pid;

原创 爲Pod指定服務的IP

spec: restartPolicy: Never hostAliases: - ip: "127.0.0.1" hostnames: - "foo.local" - "bar.local"

原创 Linux-C-Day1

相關函數 open close read write perror sleep // 秒 goto 相關宏 errno STDIN_FILENO STDOUT_FILENO #include <fcntl.h> // open(),

原创 Linux-C-Day2

目錄操作 opendir readdir closedir DIR * stuct dirent #include <dirent.h> #include <stdio.h> #include <stdlib.h> int main(

原创 nginx dns緩存問題修復

1.問題描述 如果在nginx中反代了一個域名請求,大概率會發生在使用一斷時間後,各種響應超時。 查nginx出錯日誌,很容易定位到問題,是因爲nginx在轉發請求的時候,使用了第一次解析的IP, 導致請求異常。 2.解決思路:禁用DNS

原创 使用kubeadm處理自建K8s證書過期問題

排查當前證書過期狀態 kubeadm certs check-expiration 在master節點,通過kubeadm進行證書升級 kubeadm certs renew all 重建kubectl客戶端訪問憑證 把mas

原创 kong 開啓 gzip

vim /usr/local/share/lua/5.1/kong/templates/nginx.lua http { gzip on; gzip_disable "msie6"; gzip_min_length