Skip to main content

· One min read

ref: Install from a package

wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/containerd.io_1.6.9-1_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_24.0.2-1~ubuntu.18.04~bionic_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_24.0.2-1~ubuntu.18.04~bionic_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-buildx-plugin_0.10.5-1~ubuntu.18.04~bionic_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-compose-plugin_2.18.1-1~ubuntu.18.04~bionic_amd64.deb && \
dpkg -i containerd.io_1.6.9-1_amd64.deb \
docker-ce_24.0.2-1~ubuntu.18.04~bionic_amd64.deb \
docker-ce-cli_24.0.2-1~ubuntu.18.04~bionic_amd64.deb \
docker-buildx-plugin_0.10.5-1~ubuntu.18.04~bionic_amd64.deb \
docker-compose-plugin_2.18.1-1~ubuntu.18.04~bionic_amd64.deb

如果安装失败, 执行 apt --fix-broken install

· 2 min read
Alan

一般个人项目和公司项目要用不用的 user.nameuser.email,一般情况下每次clone新项目,都要在项目根目录执行以下命令设置项目的邮箱账号信息:

git config --local user.name xxxx
git config --local user.email xxxx@yyy.com

· One min read

打开运行(Win + R) 输入 netplwiz 打开以下对话框, 取消勾选 要使用本计算机,用户必须输入用户名和密码 并点击 确定:

netplwiz

· One min read
@echo off
SET /A delay = 1
:start
.\frpc.exe --config config.ini
SET /A delay = %delay% + %delay%
timeout /t %delay%
goto start

· 2 min read

将 webm 格式转换成 mp4 格式命令:

# 默认使用的是最高质量的转换设置
ffmpeg -i input.webm output.mp4

# 如果你想要更小的文件大小,可以通过添加比特率参数来降低质量, -b:v 是视频比特率,-b:a 是音频比特率
ffmpeg -i input.webm -b:v 1M -b:a 192k output.mp4

如果上述命令返回以下错误:

[libx264 @ 0x558605199840] height not divisible by 2 (1364x1015)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

是由于视频的宽度或高度不能被2整除。H.264 编码(在 MP4 文件中常用)需要视频的宽度和高度都能被2整除。为了修复这个错误,你可以在FFmpeg命令中加入-vf "pad=ceil(iw/2)2:ceil(ih/2)2"来强制视频的宽度和高度都是偶数。 这个设置将自动将宽度和高度调整到最接近的偶数。命令如下:

ffmpeg -i input.webm -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" output.mp4

· 15 min read

在 Chrome 浏览器中使用以下代码:

document.body.addEventListener("touchmove", (e) => {
console.log(e);
})

会在控制台看到一个警告信息:

[Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952