随笔分类 -  技巧

在编写代码过程中有用的小技巧
嵌入式开发debug工具(2)——core文件
摘要:当测试程序出现崩溃时,如出现segmentation fault (core dumped),可生成core文件后使用gdb进行debug # 启用输出core文件,大小不限 ulimit -c unlimited # 查看 ulimit -c # 如果core文件不在当前目录怎么查看位置 cat 阅读全文
posted @ 2025-08-29 14:13 CharXL 阅读(38) 评论(0) 推荐(0)
两台主机传输数据文件命令操作(scp/rsync/sftp/http)
摘要:scp: # 从主机A拷贝文件到主机B scp /path/to/file user@remote_host:/path/to/destination # 从主机B拷贝文件到主机A scp user@remote_host:/path/to/file /path/to/local rsync: # 阅读全文
posted @ 2025-08-29 14:07 CharXL 阅读(30) 评论(0) 推荐(0)
git版本管理全流程命令操作
摘要:git完整使用流程: # 1. 从远程仓库拉取代码 git clone <repo link> # 2. 从mian分支创建其他分支 git checkout -b <my_branch> # 3. 查看main分支最新提交,但不合并(pull会合并merge) git fetch origin # 阅读全文
posted @ 2025-08-29 14:05 CharXL 阅读(68) 评论(0) 推荐(0)
便捷vi:在Linux上将`Caps`设置为`Ctrl`(点按)和`Esc`(长按)
摘要:// 交换 ctrl 和 caps // 修改/etc/default/keyboard中的XKBOPTIONS XKBOPTIONS="ctrl:swapcaps" // 安装xcape sudo install xcape sudo pacman -Sy xcape // 添加自启动文件 sud 阅读全文
posted @ 2024-12-13 11:32 CharXL 阅读(107) 评论(0) 推荐(0)
docker换源
摘要:docker源配置文件是 /etc/docker/daemon.json docker可用源地址:https://www.fre321.com/docker_proxy_list 将如下内容复制进去,可修改地址 { "registry-mirrors": [ "https://dockerpull. 阅读全文
posted @ 2024-12-13 11:28 CharXL 阅读(291) 评论(0) 推荐(0)
服务器换源
摘要:软件源配置文件是 /etc/apt/sources.list 先备份在编辑 mv /etc/apt/sources.list /etc/apt/sources.list.bakup sudo vim /etc/apt/sources.list # 默认注释了源码镜像以提高 apt update 速度 阅读全文
posted @ 2024-12-13 11:27 CharXL 阅读(67) 评论(0) 推荐(0)
Linux后台运行终端(远程终端断开连接还能跑)
摘要:-S 加终端名字创建一个虚拟终端 screen -S lsz1 ctrl + a + d 退出屏幕 -ls 显示有多少虚拟终端被创建 screen -ls -r进入虚拟终端 screen -r 强制回复screen screen -d -r FRL-1 删除虚拟终端 screen -X -S 123 阅读全文
posted @ 2024-12-13 11:26 CharXL 阅读(51) 评论(0) 推荐(0)
训练模型时保存/读取模型参数
摘要:保存模型参数 # 保存方式1,模型结构+模型参数 torch.save(vgg16, "vgg16_method1.pth") # 保存方式2,模型参数(官方推荐) torch.save(vgg16.state_dict(), "vgg16_method2.pth") 读取模型参数 # 读取方式1- 阅读全文
posted @ 2024-12-13 11:25 CharXL 阅读(70) 评论(0) 推荐(0)