在 Linux 中查看文件夹权限(包括 数字权限 755 / 644 这种形式)

代码老兵 技术 2026年3月19日 41
1. 使用 ls -ld最常用的方法:ls -ld /var/www输出示例:drwxr-xr-x 5 root root 4096 Mar 17 10:00 /var/www解释:d rwx r-x r-x│ │ │ ││ │ │ └── others│ │ └────── group│ └────────── owner└──────────── d = directory对应数字权限:rwx...

在 MySQL 中查看数据表大小

代码老兵 技术 2026年3月19日 49
查看当前数据库所有表大小SELECT table_name AS `Table`, ROUND(data_length / 1024 / 1024, 2) AS `Data Size (MB)`, ROUND(index_length / 1024 / 1024, 2) AS `Index Size (MB)`, ROUND((data_length + index_length) / 1024...

在 Google Search Console 里使用 Domain(域名)验证添加资源

代码老兵 技术 2026年3月17日 42
在 Google Search Console 里使用 Domain(域名)验证添加资源
在 Google Search Console 添加网站是有两种方式:Domain 和 URL prefix,推荐:Domain(覆盖所有子域)例如:agingcoder.cnwww.agingcoder.cnblog.agingcoder.cn全部自动覆盖。1. 在 Search Console 获取 TXT 记录打开https://search.google.com/search-consol...

PHP 调用 openssl_pkey_get_private 之后 Redis (SSL连接) 出现错误

代码老兵 技术 2026年3月16日 51
之前是一直没问题的,后来修改 Redis 为 SSL 连接,就出现如下错误:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag error:0D06C03A:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 error error:0D08303A:asn1...

MySQL root用户无法密码登录

代码老兵 技术 2026年3月12日 53
在Ubuntu下安装了 MySQL 8, 未设置密码,root 用户下直接 mysql 命令就能登录# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.45-0ubuntu0.24.04.1 (Ubuntu) Copyri...

Another Redis Desktop Manager 连接错误 Client On Error: ReplyError: invalid secret Config right?

代码老兵 技术 2026年3月11日 52
非常肯定用户名和密码是没问题的,以为在 redis-cli 中是可以登录的redis-cli -h myhost.cn -p 6379 -a username@password但同样的配置在 Another Redis Desktop Manager 连接就会出现这个错误 Client On Error: ReplyError: invalid secret Config right?命令行有一个...

用 rsync 同步本地和服务器之间的文件

代码老兵 技术 2026年3月11日 47
rsync 是 Linux / macOS 上最常用的文件同步工具,可以把 本地文件同步到远程服务器,也可以同步服务器文件到本地,速度快且支持断点续传。它属于 rsync。下面是最常见的用法。一、同步命令把本地目录同步到服务器:rsync -avz ./local_dir/ user@server:/path/to/remote_dir/示例:rsync -avz ./website/ root@...

OpenAI 对话输入里 role 的含义

代码老兵 技术 2026年3月6日 68
在 **OpenAI 的对话式 API 中,role 用来标识一条消息在对话中的“身份”。模型会根据不同 role 来理解上下文、优先级和行为规则。常见 role 有 4 种:role含义谁提供优先级system系统级指令(行为规则、人格、限制)开发者最高developer开发者指令(新版 API 中替代 system 的部分用途)开发者高user用户输入用户中assistant模型输出模型低不同...

程序员最常用的 Docker 命令

代码老兵 技术 2026年3月6日 42
一、镜像(Image)相关命令说明docker images查看本地镜像docker pull <image>拉取镜像docker push <image>推送镜像到仓库docker build -t <name:tag> .构建镜像docker rmi <image>删除镜像docker tag <image> <name:tag...

git merge --squash 和 git merge 的区别

代码老兵 技术 2026年3月5日 41
区别git merge --squash 会把一个分支的所有提交“压扁成一次提交”,但不会保留分支历史;git merge 会完整保留分支上的每一次提交和分支结构。区别对比表对比点git mergegit merge --squash提交历史保留全部 commit不保留原 commit是否生成 merge commit通常 ✓(除 fast-forward)不生成提交作者信息原作者全部保留只保留...