avatar
童琦杰
  1. 创建CA证书 生成rootCA私钥: rootCA-key.pem openssl genrsa -out rootCA-key.pem 2048 使用上面的私钥,生成rootCA证书: rootCA.pem openssl req -x509 -new -nodes -key rootCA-key.pem -sha256 -days 3650 -out rootCA.pem -subj "/O=Organization/OU=OrgUnit/CN=CommonName" 代理服务需要根据该rootCA证书生成域名证书 要实现中间人代理,该CA证书需要同时被连接代理服务器的客户端信任。 创建域名证书 生成域名私钥: _wildcard.example.org-key.pem openssl genrsa -out _wildcard.example.org-key.pem 2048 创建证书签名请求: _wildcard.example.org.csr openssl req -new -key _wildcard.example.org-key.pem -out _wildcard.example.org.
  2. 虚拟环境 python3 -m venv .venv # create virtual environment source .venv/bin/activate # load virtual environment 安装依赖 pip install -r requirements.txt windows激活虚拟环境报错activate : File \.venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
  3. 下载M3U8视频并存为MP4格式 ffmpeg -i [https://host/path/to/xxx.m3u8] [output.mp4] 将MP3格式转化为M3U8 ffmpeg -i [input.mp3] -c:a libmp3lame -b:a 128k -map 0:0 -f segment -segment_time 10 -segment_list [output.m3u8] -segment_format mpegts [%03d.ts] 将MP4格式转化为M3U8 ffmpeg -i [input.mp4] -f segment -segment_time 10 -segment_format mpegts -segment_list [output.m3u8] -c copy -bsf:v h264_mp4toannexb -map 0 [%04d.ts] 转成H264编码 ffmpeg -i [input.mp4] -c:v libx264 -preset faster -crf 32 -c:a copy [output.mp4]
  4. 安装 安装chromium npx playwright install chromium 仅安装chromium shell及系统依赖 npx playwright install --with-deps --only-shell chromium
  5. 大小写转换 转换为大写:Ctrl+Shift+u 转换为小写:Ctrl+Shift+l
  6. 图片指定宽长比 <div class="image"> <div> <img src="xxx" /> </div> </div> padding-top计算百分比的基数是容器的width,示例中宽高比为4:3 percentage: The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by writing-mode) of the containing block. Must be nonnegative. .image { width: 100%; padding-top: calc(3 / 4 * 100%); /* calc(Height / Width * Percentage%) */ position: relative; overflow: hidden; div { position: absolute; top: 0; left: 0; bottom: 0; right: 0; img { object-fit: cover
  7. You can generate a self-signed certificate for development purposes using tools like OpenSSL or PowerShell on Windows, or even .NET's own APIs if you’re building the certificate within your .NET code. Here’s how to generate a self-signed certificate using these methods: Method 1: Generate a Self-Signed Certificate with OpenSSL Prerequisites: Make sure you have OpenSSL installed on your system. Generate a Private Key: openssl genpkey -algorithm RSA -out private.key -pkeyopt rsa_keygen_bits:2048 Generate a Ce
  8. config git config --local user.name "tongqijie" git config --local user.email "tongqijie@hotmail.com" git config credential.helper store git config core.ignorecase false: 设置文件名大小写敏感 git config --local --unset user.password git config --local advice.detachedHead false git config --local http.sslVerify false pull git pull push git push clone git clone [remote-repository] [local folder] Chnages git status Stage untracked/modified files/folder git add [file|folder] stage specified single file or specified folde
  9. 在当前目录创建conda环境 conda create --prefix ./.venv python=3.12 激活当前目录下conda环境 conda activate ./.venv 退出当前目录下conda环境 conda deactivate 安装python依赖包(requirements.txt) pip install -r /path/to/requirements.txt
  10. RS256 PKCS1格式私钥生成 openssl genrsa -out rs256_private_key.pem 2048 生成的PKCS1格式私钥示例 //codefile:rs256_private_key.pem -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAnAUSXxqv7dsrb42IdwR8yJ+sYi0YCduTXbcNOurVLu9gOOQq 56ArwIwDKF7Tscd0oANRuYaNnPPJrM9D4drHITmK/V6zEerSs6UvJYJ4W+avaWnU DIV+jdQEXJRvflKN/4UdCqF/jdVIXutgkyXbGA3gkwWV0SDbeQPpbPiP5NYO5TI0 Tt1MwY0dWXE9t6GmD4i+k+ZrmMN2is8N7l4TEmBgs6HD+My+HQw2lpoS8rT4eJ76 eOEO6RSxeEc43Hn3e1oOgLj5EI7EaPT8IOtQdLK8qSwbbwc9ZXDN0DLzmCPHSF6B lu0mYE/P+MXQAdwO2bH/Qp3ho24V1KAeO8TCBQIDAQ
© 2015-2022 tongqijie.com 版权所有沪ICP备17000682号