共有 274 篇文章
SSH 密钥
2024-08-17 - 2024-09-18

Ed25519算法

1ssh-keygen -t ed25519 -C "your_email@example.com"

旧算法

1ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

设置文件权限

1chmod 700 ~/.ssh
2chmod 600 ~/.ssh/authorized_keys
Summary
2024-08-11 - 2024-09-18

Summary抽屉,可收起和展开

默认收起 A
  • AAA
默认展开 B
  • BBB
Disable IPV6
2024-08-03 - 2024-09-18

永久关闭IPV6

编辑grub配置文件/etc/default/grub

修改增加ipv6.disable=1属性

1GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
2GRUB_CMDLINE_LINUX="ipv6.disable=1"

使设置生效

1update-grub
New React Project
2024-07-27 - 2024-09-18

创建新 React 项目

使用create-react-app创建项目

1npx create-react-app

设置yarn版本

前置条件

1corepack enable # 安装完nodejs后只需要执行一次

设置版本

1yarn policies set-version 4.3.0

修改.yarnrc.yml配置

1nodeLinker: node-modules
2
3yarnPath: .yarn/releases/yarn-4.3.0.cjs

安装依赖

1yarn install
重复代码提醒/Duplicated code fragment
2024-07-06 - 2024-09-18

打开设置按照以下路径进入并关闭

Editor -> Inspections -> General -> Duplicated code fragment

搭建邮件系统
2024-06-26 - 2024-09-18

官方docker-compose文件生成

https://setup.mailu.io/2024.06/

参考博客

https://www.ywbj.cc/?p=929

测试服务器是否开启25端口

1telnet smtp.google.com 25 #谷歌邮箱地址
2# 或者
3telnet smtp.qq.com 25 #腾讯qq邮箱

如果已经开启则会显示Connected

1root@mail:~# telnet smtp.qq.com 25
2Trying 157.148.54.34...
3Connected to smtp.qq.com.
4Escape character is '^]'.
5220 newxmesmtplogicsvrsza9.qq.com XMail Esmtp QQ Mail Server.

如果未开启会显示一直在连接

页面加载完毕后执行 useEffect
2024-06-22 - 2024-09-18

一个参数

useEffect()本身是一个函数,由 React 框架提供,在函数组件内部调用即可。

举例来说,我们希望组件加载以后,网页标题(document.title)会随之改变。那么,改变网页标题这个操作,就是组件的副效应,必须通过useEffect()来实现。

型参提醒 Inlay hints
2024-06-22 - 2024-09-18
打开设置搜索Inlay Hints, 或进入Setting/Editor/Inlay Hints, 按照需要关闭
获取 Debian Version
2024-05-19 - 2024-09-18

lsb_release

1apt-get install lsb-release
2lsb_release -a

issue

1cat /etc/issue

os-release

1cat /etc/os-release

hostnamectl

1hostnamectl

uname

1uname

debian_version

1cat /etc/debian_version
Raspberry Pi 5 RTC Battery
2024-05-15 - 2024-09-18

检查电池电压

1vcgencmd pmic_read_adc BATT_V
搭建NTP服务器
2024-05-12 - 2024-09-18

为其他设备提供NTP授时服务

 1# 安装NTP服务
 2apt-get install ntp
 3# 编辑配置文件, pool 后替换为想要的ntp地址
 4vim /etc/ntpsec/ntp.conf
 5# 重启NTP服务
 6systemctl status ntp
 7systemctl restart ntp
 8# 检查NTP同步功能
 9ntpq -p
10# 开放UDP的123端口
1# 检查与NTP服务器的连接, 使用IP可以跳过dns解析
2ntpdate -q 13.113.25.87
1# 设置NTP服务器
2vim /etc/ntpsec/ntp.conf