嵌入式常用工具

日常使用工具

1. Linux下载工具axel,多线程,断点续传功能

sudo apt-get install axel 
axel -n 10 -av http://www.image-net.org/challenges/LSVRC/2012/nnoupb/ILSVRC2012_img_train.tar

2. VMWare回收硬盘空间

sudo vmware-toolbox-cmd disk shrink /

3. git

  • GIT是一个分布式版本控制工具
    分布式版本控制系统设有“中央服务器”,每个人的电脑上都是一个完整的版本库,这样工作的时候,无需要联网了,因为版本库就在你自己的电脑上。多人协作只需要各自的修改推送给对方,就能互相看到对方的修改了。
    在这里插入图片描述

  • GIT工作流程图
    在这里插入图片描述

    • clone(克隆):从远程仓库中克隆代码到本地仓库
    • checkout(检出):从本地仓库中检出一个仓库分支然后进行修订
    • add(添加):在提交前先将代码提交到暂存区
    • commit(提交):提交到本地仓库。本地仓库中保存修改的各个历史版本
    • fetch (抓取): 从远程库,抓取到本地仓库,不进行任何的合并动作,一般操作比较少
    • pull (拉取): 从远程库拉到本地库,自动进行合并(merge),然后放到到工作区,相当于fetch+merge
    • push(推送):修改完成后,需要和团队成员共享代码时,将代码推送到远程仓库
  • 仓库、暂存区、工作区三者关系
    在这里插入图片描述

  • 常用命令

# 工作区->暂存区
git add .
# 暂存区->仓库
git commit -m 'commit message 01'
# 工作区->仓库
git commit -am 'commit message 01'
# 查看状态
git status
# 查看提交记录
git 1og
gitlog  # gitlog是gitlog的别名: alias gitlog='git log --pretty=oneline --all --graph --abbrev-commit'
# 版本回退
git reset --hard <commitID>
# 查看分支
git branch
# 创建并切换分支
git checkout -b 分支名
#分支合并
git merge 分支名  #首先切换到目标分支上
#远程仓库
git remote add
git push
git clone 
git fetch
git merge
git pull # git fetch + git merge

3.0 安装配置Git Server

C    代表创建,仅在通配符版本库授权是使用,用于指定谁可以创建与通配符匹配的版本库
R    RW    RW+    R为只读,RW为读写权限,RW+代表除了拥有读写权限,还可以强制执行推送
RWC    RW+C    
RWD    RW+D    D代表允许删除和正则匹配的引用
RWCD  RW+CD
  • 增加仓库和用户之后提交
git add conf
git add keydir
git commit -m "added foo, gave access to alice, bob, carol"
git push
apt-get install git
apt-get install openssh-server openssh-client
adduser git
git init --bare /srv/myfiles.git
chown -R git:git /srv/myfiles.git/
  • 使用公匙和私匙实现免密效果
# 客户端
ssh-keygen -t rsa
##########################
# 服务器端
##########################
# 把文件「id_rsa.pub」拷贝到服务端,并使用如下命令进行设置:
mkdir /home/git/.ssh
cp /home/currentuser/Desktop/id_rsa.pub /home/git/.ssh/authorized_keys
chown -R git:git /home/git/.ssh

# 如果 authorized_keys 文件不存在,可以使用 cp 命令,否则请使用 cat 命令追加,比如:
cat /home/currentuser/Desktop/id_rsa.pub >> /home/git/.ssh/authorized_keys

# 为了保证配置生效,还需要查看 /etc/ssh/sshd_config 文件中的如下设置是否开启:
AuthorizedKeysFile %h/.ssh/authorized_keys

3.1 创建仓库

git init --bare /home/git/server/xx.git

3.2 clone仓库

git clone git@192.168.3.251:/home/git/server/xx.git

3.3 常用命令

  1. 设置个人用户信息 (换成自己的名字)
   # 设置用户信息
   git config --global user.email "luohj@qq.com"
   git config --global user.name "luohj"
   
   # 查看用户信息
   git config --global user.email
   git config --global user.name  
  • 增加当前目录及子目录下的所有文件
   git add .
  • 提交到本地仓库
   git commit -am "描述修改内容“ 
  • 把本地仓库同步到服务器
   git push
  • 把服务器同步到本地仓库
   git pull
  • 查看修改了哪些文件
   git status
  • 查看提交日志
   git log
  • 查看git服务器路径
   git remote -v
  • 版本回退
    git reset --hard CommitID # CommitID可通过git-log或git log查看
    git reflog                # 查看所有的CommitID
	git reset --hard
	git reset --hard HEAD # 表示回退到当前版本, HEAD指向当前版本.
                     	  # 如果你修改了一些代码,想去除,就可以使用 
                          # git reset --hard HEAD一次性去除.
	git reset --hard HEAD^ #表示回退到上一个版本.
	git checkout commit id #也可以回退到指定的版本(之前的提交还在)
	
  • 每次修改的文件列表
	git whatchanged 
  • 打tag
	git tag v1.5.5.0 -m “version features changed or status”
  • 把所有tags及与tags相关的代码都同步到远端仓库
	git push --tags
  • 删除未跟踪文件
# 删除 untracked files
git clean -f
 
# 连 untracked 的目录也一起删掉
git clean -fd
 
# 连 gitignore 的untrack 文件/目录也一起删掉 (慎用,一般这个是用来删掉编译出来的 .o之类的文件用的)
git clean -xfd
 
# 在用上述 git clean 前,墙裂建议加上 -n 参数来先看看会删掉哪些文件,防止重要文件被误删
git clean -nxfd
git clean -nf
git clean -nfd
  • 在~/.bashrc中设置别名
alias git-log='git log --pretty=oneline --all --graph --abbrev-commit'
  • 添加文件至忽略列表
# 创建 .gitignore
# 增加被忽略的文件名或通配符
# no .a files
*.a
# do track lib.a
!lib.a
# ignore all files in build/ directory
build/
# ignore doc/notes.txt, but not doc/server/arch.txt
doc/*.txt
build

3.4 分支管理

3.4.1 查看分支

git branch              # 列出本地已经存在的分支,并且当前分支会用*标记
git branch -r           # 查看远程版本库的分支列表
git branch -a           # 查看所有分支列表(包括本地和远程,remotes/开头的表示远程分支)
git branch -v           # 查看一个分支的最后一次提交
git branch --merged     # 查看哪些分支已经合并到当前分支
git branch --no-merged  # 查看所有未合并工作的分支

3.4.2 创建分支

  • 创建新分支
git branch new_branch_name
  • 切换分支
git checkout branch_name
  • 创建分支的同时,切换到该分支上
git checkout -b new_branch_name

3.4.3 从远程仓库pull(拉取)代码到本地分支

  • 指定远程分支,和本地分支
git pull origin 远程分支名称:本地分支名称  # origin是远程仓库连接默认的对象名称
  • 如果不写本地分支名称,则默认和远程分支同名
 git pull origin 远程分支名称
 git checkout -b PTZ origin/PTZ
 git checkout -b release/2.6 origin/release/2.6

3.4.4 将新分支推送到远程仓库

git push origin 分支名称
  • 假设本地创建了一个名为dev的分支,远程仓库还没有这个分支,推送的命令是
git push --set-upstream origin dev

3.4.5 删除分支

  • 删除本地分支(不能删除当前所在的分支,如果要删除,必须先切换到其他分支上)
git branch -d 分支名称
  • 如果删除时报错:error: The branch ‘分支名称’ is not fully merged. (意思是:分支未完全合并)。解决方法是使用 -D 强制删除,代码如下:
git branch -D 分支名称
  • 删除远程分支
git push origin :分支名称  # 分支名称前有个冒号,分支名前的冒号代表删除

3.4.6 合并分支

  • 假如我们现在位于分支dev上,刚开发完自己负责的功能,执行了下列命令:
git  add .
git  commit -m '某某功能已完成,提交到[分支名称]分支'
git  push -u origin 分支名称
  • 首先切换到master分支上
git checkout master
  • 如果是多人开发的话,需要把远程master分支上的代码pull下来
git pull origin master
  • 然后把dev分支的代码合并到master上
git merge 分支名称
  • 如果git merge的时候出现冲突,可以执行下面的命令取消merge:
git merge --abort:
  • 然后查看状态
git status
  • 最后一步,Push推送到远程仓库
git push origin master

3.5 开发规范

在这里插入图片描述

3.6 Git远程仓库

  • 安装GitLab创建自己的远程仓库
  • 初始化本地仓库,然后与远程仓库对接
# git remote add <远端名称> <仓库路径>   
# 远端名称默认为origin,取决于远端服务器设置
git remote add origin git@192.168.1.3:/home/git/test.git
  • 查看远程仓库 (即远端名称)
git remote
  • 推送到远程仓库
# 命令: git push [-f] [--set-upstream] [远端名称 [本地分支名][:远端分支名]]
# 若远端分支名与本地分支名相同,则可只写本地分支名
git push origin master

# --set-upstream 推送到远端的同时并且建立起和远端分支的关联关系
git push --set-upstream origin master
# 如果当前分支已经和远端分支关联,则可以省略分支名和远端名
git push #将master分支推送到已关联的远端分支

3.6.1 本地分支与远程分支的关联关系

  • 查看关联关系
git branch -vv

3.6.2 从远程仓库克隆

  • 如果已经有一个远端仓库,我们可以直接clone到本地。
  • 命令: git clone <仓库路径> [本地目录]
  • 本地目录可以省略,会自动生成一个目录

3.6.3 从远程仓库拉取

  • 拉取命令: git pull [远端名称] [远端分支名]
  • 拉取指令就是将远端仓库的修改拉到本地并自动进行合并,等同于fetch+merge0。
  • 如果不指定远端名称和分支名,则抓取所有并更新当前分支。

3.6.4 解决合并冲突

  • 在一段时间,A、B用户修改了同一个文件,且修改了同一行位置的代码,此时会发生合并冲突
  • A用户在本地修改代码后优先推送到远程仓库,此时B用户在本地修订代码,提交到本地仓库后,也需要推送到远程仓库,此时B用户晚于A用户,故需要先拉取远程仓库的提交,经过合并后才能推送到远端分支,如下图所示。
    在这里插入图片描述
  • 在B用户拉取代码时,因为A、B用户同一段时间修改了同一个文件的相同位置代码,故会发生合并冲突远程分支也是分支,所以合并时冲突的解决方式也和解决本地分支冲突相同相同.

3.7 IDEA常用Git操作入口

在这里插入图片描述
在这里插入图片描述

3.8 Git merge & rebase区别和用法

3.8.1 git merge

在这里插入图片描述

3.8.2 git rebase

在这里插入图片描述

3.8.3 二者区别

在这里插入图片描述
在这里插入图片描述

3.9 git pull

3.9.1 查看配置文件: 参数 --list, 简称 -l

查看仓库级的config:git config --local -l
查看全局级的config:git config --global -l
查看系统级的config:git config --system -l
查看当前生效的配置:git config -l 会显示最终三个配置文件后的配置信息

3.9.2 修改git pull为merge或rebase

  • git pull 命令默认是通过merge来合并代码的
  • 全局修改 pull 为rebase
git config --add pull.rebase true

git config pull.rebase false  # merge (the default strategy)
git config pull.rebase true   # rebase
git config pull.ff only       # fast-forward only

3.10 Git忽略本地的文件修改,保留其在远程仓库的状态

  • 在项目中有一些配置文件在远程仓库存在,但是本地的修改并不具有普适性,因此是不需要提交到远程仓库的
  • 各种忽略文件的方法对比
    • .gitignore 文件.
    • .git/info/exclude 文件
    • git update-index --assume-unchanged (官方文档)
    • git update-index --skip-worktree(官方文档)
  • 区别:
    • .gitignore
      • 说明:显式地阻止提交文件。
      • 优势:.gitignore 文件本身提交至远程仓库,全组共享忽略文件配置。
      • 局限:如果项目已经存在远程仓库,即使被加入 .gitignore,仍然可以进行修改并提交。本地的修改会显示在 git status 结果中。
    • .git/info/exclude
      • 说明:显式地阻止提交文件。
      • 优势:exclude 文件本身不会提交至远程仓库,因此适合放一些个人定制的 「gitignore」 项目。
      • 局限:和 .gitignore 存在同样地局限。文件若已存在远程仓库,则本地修改仍可以提交至远程仓库。本地的修改会显示在 git status 结果中。
    • assume-unchanged
      • 说明:声明本地、远程都不会修改这个文件
      • 优势:git 直接跳过这些文件的处理以提升性能。文件不会出现在 git status。
      • 局限:不适合本地或远程需要修改的文件。本地会忽略掉之后远程文件的修改。
    • skip-worktree
      • 说明:声明忽略文件的本地修改。
      • 优势:本地可以对文件做一些个人定制。文件不会出现在 git status。
      • 局限:拉取远程文件更新,或切换分支时有可能出现冲突,需要撤销忽略后手动解决冲突。
  • 忽略提交本地修改的文件
git update-index --assume-unchanged [file-path]
  • 取消标志,恢复版本控制
git update-index --no-assume-unchanged [file-path]
  • 如果忽略的文件多了,可以使用以下命令查看忽略列表
git ls-files -v | grep '^h\ '
  • 提取文件路径,方法如下
git ls-files -v | grep '^h\ ' | awk '{print $2}'
  • 所有被忽略的文件,取消忽略的方法,如下
git ls-files -v | grep '^h' | awk '{print $2}' |xargs git update-index --no-assume-unchanged  

3.11 Ubuntu20.04安装gitlab (需求和问题管理)

4. 加密芯片

5. 设置命令行VPN代理

  • Windows
set HTTP_PROXY=http://127.0.0.1:7081
set HTTPS_PROXY=http://127.0.0.1:7081
  • Linux
export HTTP_PROXY="http://127.0.0.1:7078"
export HTTPS_PROXY="https://127.0.0.1:7078"

6. Ubuntu系统及安装包

6.1 安装opencv

sudo apt install libopencv-dev python3-opencv

6.2 删除Unattended Upgrade

sudo apt remove unattended-upgrades
sudo apt update && sudo apt upgrade

6.3 解决"Could not get lock /var/lib/dpkg/lock-frontend“

6.4 查看和修改Linux的时间

  • 查看时间和日期
date
  • 将系统日期设定成2009年11月3日的命令
date -s 11/03/2009 
  • 将系统时间设定成下午5点55分55秒的命令
date -s 17:55:55
  • 将当前时间和日期写入BIOS,避免重启后失效
hwclock -w

7. 安装配置Samba

  • 安装Samba
sudo apt-get install samba
  • 配置:在root账户下执行:gedit /etc/samba/smb.conf,按下图修改:
    在这里插入图片描述
  • 增加Samba用户
sudo smbpasswd -a am # 密码:1
  • Windows可通过以下方式进行访问
       路径:\\ip\am 
       用户名:am
       密码:1

8. 安装配置NFS

  • 安装nfs
sudo apt install nfs-kernel-server
  • 创建共享目录
sudo mkdir -p /home/am/nfs
sudo chmod 777 /home/am/nfs
  • 编译 /etc/exports
/home/am/nfs *(rw,sync,no_subtree_check)
  • 重启
sudo systemctl restart nfs-kernel-server
  • 本机测试
sudo showmount -e localhost
# 如果输出中包括刚刚添加的共享目录(/home/am/nfs),表示共享设置已经生效。

9. 程序运行输出到文件

  • command:是程序,而不是脚本文件
  • 只输出到文件,终端不显示
    • 0 :标准输入
    • 1 :标准输出
    • 2 :标准错误
    • 2>&1:将标准错误(2) 重定向(&)到与标准输出(1)相同的文件
command > log.txt 2>&1 
  • 输出到文件,终端也显示
command | tee log.txt

10. VMWare回收硬盘空间

sudo vmware-toolbox-cmd disk shrink /

11. scp

  • 利用scp 远程上传下载文件/文件夹
  • 从服务器下载文件
scp root@192.168.1.101:/home/am/test.txt  /tmp/local_destination/
  • 上传本地文件到服务器
scp /home/test/test.txt  root@192.168.1.101:/home/am/ 
  • 从服务器下载整个目录
scp -r root@192.168.1.101:/home/am/test  /tmp/local_dir/
  • 上传目录到服务器
 scp -r test  root@192.168.1.101:/home/am/ 

12. Linux抓图工具

13. tar

  • 解压
tar xvf test.tar.gz
sudo tar -xvf test.tar.xz -C /opt
  • 打包
tar -czvf test.tar.gz test_dir

14. vim + ctags + taglist配置和使用

  • 参考1
  • 参考2
  • vim下结合cscope、ctags以及taglist插件基本上就可以搭建出一个和source insight差不多的代码编辑游览环境了。
  • ubuntu 22.04下安装ctags和taglist很简单,步骤如下:
sudo apt-get install exuberant-ctags

-下载最新版本的taglist plugin (taglist_46.zip)

mkdir ~/.vim
cp taglist_46.zip ~/.vim/
cd ~/.vim
unzip taglist_46.zip
  • 进入到源码根目录下执行生成tags文件
ctags -R *
  • ctags常用命令:
# shell 命令
$ ctags –R *             #($ 为Linux系统Shell提示符,生成tags文件)
$ vim –t func_name       #(请把tag替换为您欲查找的变量或函数名)

# vim 命令
:helptags .              # 配置帮助文件
:TlistToggle             # 来打开和关闭taglist窗口。
Ctrl + ]                 # jump to definition
Ctrl + T                 # jump to back
Ctrl + o                 # jump to back
  • 使用Ctrl 和两次w在侧窗口和主窗口之间进行切换

15. Linux网络诊断工具

15.1 ping不通

  • ping的过程是,输完命令后,根据目的ip,先查路由表,看目的主机ip是否走直连路由,是的话就去检查mac地址缓存表,看是否有该地址的mac地址缓存,没有的话,是用直连路由的一个本机接口去发出请求目的ip的mac地址的arp请求request消息,收到arp响应后,用这个mac地址封装二层数据,发出icmp协议的ping请求消息。mac地址缓存里有,直接封装ping的request消息。arp消息没有得到mac地址,不发出ping的request消息,回显端口不可达。
  • 查路由表发现不是直连路由和静态路由的话,走默认路由的话,就去查是否有默认网关的mac地址,没有去请求网关的mac地址,有就直接封装ping的request消息。

15.1.1 同一网段无法ping通

  • 执行如下命令看是否能获取到对应的ip地址(如:192.168.3.216)的mac,没有的话,应该是ping命令执行时,发出的请求对方的mac地址的arp消息没有得到应答,此时根本没有发出ping的request消息。这时,要检查对方是否开机?ip是否存在?有跨交换机vlan的话,检查对应的中间trunk链路是否导通?arp消息是否能到达目的ip侧?对方是否收到arp请求消息?最好能在对方pc上抓包,看arp请求消息是否到达目的地址的主机,再逐级排查。
arp -a | grep 192.168.3.216

15.2 查看工具

  • 查看所有活动网络接口
ifconfig
  • 查看所有网络接口
ifconfig -a
  • 启用和禁用网络接口
ifconfig eth0 up
ifconfig eth0 down
  • 跟踪路由
traceroute baidu.com
  • 查看路由表
route
  • 添加默认gateway到一个路由表
route add default gw <gateway-ip>
  • 查看网络连接
netstat
netstat -r  # 等同于route

15.3 网络包分析工具

  • 指定网卡,并存储抓取到的数据流到文件中
tcpdump -i eth1 -s 0 -w xxx.cap
  • 指定网卡,抓取指定IP的数据流
tcpdump -i eth1 src host 198.168.1.201 -s 0 -A
tcpdump -i eth1 dst host 198.168.1.201 -s 0 -A
  • 指定网卡,抓取指定port的数据流
tcpdump -i eth1 port 9000 -s 0 -A

16 调试信息

  • 带颜色输出
#define NONE "\033[m\n"
#define GREEN "\033[0;32;32m"
#define RED "\033[0;32;31m"
#define YELLOW "\033[1;33m"

#define DBG_INFO(fmt, args...) printf(GREEN "%s[%d]: " fmt NONE, __FUNCTION__, __LINE__, ##args);
#define DBG_ERR(fmt, args...) printf(RED "%s[%d]: " fmt NONE, __FUNCTION__, __LINE__, ##args);

17. 二维高斯曲面拟合法求取光斑中心及算法的C++实现

参考

18. 计算字符串表达式的值

参考

19. vscode

19.1 自动补全

参考
VS Code C/C++补全失效及解决方法
VsCode C++代码补全失效
VS Code自定义代码颜色
VSCode怎么自定义设置主题和代码颜色

  • settings.json
{
    "git.openRepositoryInParentFolders": "never",
    "cmake.configureOnOpen": false,
    "editor.tabSize": 2,
    "editor.fontFamily": "'Source Code Pro', 'Consolas', monospace",
    "security.workspace.trust.untrustedFiles": "open",
    "cmake.showOptionsMovedNotification": false,
    "C_Cpp.intelliSenseEngine":"Tag Parser",
    "[cpp]": {
        "editor.quickSuggestions": {
            "comments": "on",
            "strings": "on",
            "other": "on"
        }
    },
    "[c]": {
        "editor.quickSuggestions": {
            "comments": "on",
            "strings": "on",
            "other": "on"
        }
    },
    "editor.quickSuggestions": {
        "comments": "on",
        "strings": "on"
    },
    "C_Cpp.codeAnalysis.exclude": {
 
    },
    "files.hotExit": "off",
    "C_Cpp.intelliSenseEngineFallback": "enabled",
    "C_Cpp.autocompleteAddParentheses": true,
	"editor.tokenColorCustomizations": {
        "comments": "#75715E", 
        "keywords": "#4B9CC4", 
        "variables": "#F69720", 
        "strings": "#E0A83E", 
        "functions": "#A6E22E", 
        "numbers": "#A97BC8", 
        "types": "#4EC9B0",
        "textMateRules": [
            {
                "scope": "keyword.operator",
                "settings": {
                    "foreground": "#F92672"
                }
            },
            {
                "scope":"entity.name.type",
                "settings": {
                    "foreground": "#4EC9B0",
                }
            },
            {
                "scope":"entity.name.class",
                "settings": {
                    "foreground": "#4EC9B0",
                }
            }            
        ]

      }
}
  • C/C++函数注释
    • 安装插件:Cpp Comment Generator
    • 把光标放于函数的 “func() {” 的 ) {之间,按 Ctrl + Alt + Z

19.2 插入代码片断

{
    "Print to console": {
        "prefix": "chx",
        "body": [
            "/**",
            " * Copyright (c) 2019, Comvision Innovation, Inc.",
            " * All rights reserved.", 
            " * @Author: xxx xx",
            " * @Date: $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
            " * @Version: v0.0.1",
            " * @Brief: ",
            " * @Last Modified by: xxx xx",
            " * @Last Modified time: $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
            " * @FileName: ${RELATIVE_FILEPATH}",
            " */",
            "",
            "#ifndef ${RELATIVE_FILEPATH/([a-zA-Z0-9]+)([\\/\\.-_])?/${1:/upcase}_/g}",
            "#define ${RELATIVE_FILEPATH/([a-zA-Z0-9]+)([\\/\\.-_])?/${1:/upcase}_/g}", 
            "",
            "namespace com {",
            "namespace kscx {",
            "namespace ${TM_FILENAME_BASE} {",            
            "",
            "",
            "} // ${TM_FILENAME_BASE}",
            "} // kscx",
            "} // com",
            "#endif // ${RELATIVE_FILEPATH/([a-zA-Z0-9]+)([\\/\\.-_])?/${1:/upcase}_/g}",
        ],
        "description": "c/c++_head file template."
    }
	
}
  • C源文件代码片断 (cs+tab导入)
{
	"Print to console": {
			"prefix": "csx",
			"body": [
					"/**",
					" * Copyright (c) 2019, Comvision Innovation, Inc.",
					" * All rights reserved.", 
					" * @Author: Hejian Luo",
					" * @Date: $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
					" * @Version: v0.0.1",
					" * @Last Modified by: Hejian Luo",
					" * @Last Modified date: $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE",
					" * @FileName: ${RELATIVE_FILEPATH}",
					" * @Brief: ",
					" */",
					"",
					"",
					"namespace com {",
					"namespace kscx {",
					"namespace ${TM_FILENAME_BASE} {",            
					"",
					"",
					"} // ${TM_FILENAME_BASE}",
					"} // kscx",
					"} // com",
			],
			"description": "c/c++_source file template."
	}

}

19.3 隐藏文件或文件夹

  • Ctrl+Shift+P打开显示所有命令,在输入框中输入settings回车
  • 进入User Settings页面搜索files.exclude
  • 增加需要隐藏文件或文件夹
    在这里插入图片描述

19.4 生成C++函数注释

  • 安装Doxygen Documentation Generator
  • 使用方法:在函数前面输入/**,然后回车
  • 增加配置信息:File–Preferences–Settings-- 中打开用户 setting.json文件
// The prefix that is used for each comment line except for first and last.
"doxdocgen.c.commentPrefix": " * ",

// Smart text snippet for factory methods/functions.
"doxdocgen.c.factoryMethodText": "Create a {name} object",

// The first line of the comment that gets generated. If empty it won't get generated at all.
"doxdocgen.c.firstLine": "/**",

// Smart text snippet for getters.
"doxdocgen.c.getterText": "Get the {name} object",

// The last line of the comment that gets generated. If empty it won't get generated at all.
"doxdocgen.c.lastLine": " */",

// Smart text snippet for setters.
"doxdocgen.c.setterText": "Set the {name} object",

// Doxygen comment trigger. This character sequence triggers generation of Doxygen comments.
"doxdocgen.c.triggerSequence": "/**",

// Smart text snippet for constructors.
"doxdocgen.cpp.ctorText": "Construct a new {name} object",

// Smart text snippet for destructors.
"doxdocgen.cpp.dtorText": "Destroy the {name} object",

// The template of the template parameter Doxygen line(s) that are generated. If empty it won't get generated at all.
"doxdocgen.cpp.tparamTemplate": "@tparam {param} ",

// File copyright documentation tag.  Array of strings will be converted to one line per element.  Can template {year}.
"doxdocgen.file.copyrightTag": [
  "@copyright Copyright (c) {year}"
],

// Additional file documentation. One tag per line will be added. Can template `{year}`, `{date}`, `{author}`, `{email}` and `{file}`. You have to specify the prefix.
"doxdocgen.file.customTag": [],

// The order to use for the file comment. Values can be used multiple times. Valid values are shown in default setting.
"doxdocgen.file.fileOrder": [
  "file",
  "author",
  "brief",
  "version",
  "date",
  "empty",
  "copyright",
  "empty",
  "custom"
],

// The template for the file parameter in Doxygen.
"doxdocgen.file.fileTemplate": "@file {name}",

// Version number for the file.
"doxdocgen.file.versionTag": "@version 0.1",

// Set the e-mail address of the author.  Replaces {email}.
"doxdocgen.generic.authorEmail": "you@domain.com",

// Set the name of the author.  Replaces {author}.
"doxdocgen.generic.authorName": "your name",

// Set the style of the author tag and your name.  Can template {author} and {email}.
"doxdocgen.generic.authorTag": "@author {author} ({email})",

// If this is enabled a bool return value will be split into true and false return param.
"doxdocgen.generic.boolReturnsTrueFalse": true,

// The template of the brief Doxygen line that is generated. If empty it won't get generated at all.
"doxdocgen.generic.briefTemplate": "@brief {text}",

// The format to use for the date.
"doxdocgen.generic.dateFormat": "YYYY-MM-DD",

// The template for the date parameter in Doxygen.
"doxdocgen.generic.dateTemplate": "@date {date}",

// Decide if you want to get smart text for certain commands.
"doxdocgen.generic.generateSmartText": true,

// Whether include type information at return.
"doxdocgen.generic.includeTypeAtReturn": true,

// How many lines the plugin should look for to find the end of the declaration. Please be aware that setting this value too low could improve the speed of comment generation by a very slim margin but the plugin also may not correctly detect all declarations or definitions anymore.
"doxdocgen.generic.linesToGet": 20,

// The order to use for the comment generation. Values can be used multiple times. Valid values are shown in default setting.
"doxdocgen.generic.order": [
  "brief",
  "empty",
  "tparam",
  "param",
  "return",
  "custom"
],

// Custom tags to be added to the generic order. One tag per line will be added. Can template `{year}`, `{date}`, `{author}`, `{email}` and `{file}`. You have to specify the prefix.
"doxdocgen.generic.customTags": [],

// The template of the param Doxygen line(s) that are generated. If empty it won't get generated at all.
"doxdocgen.generic.paramTemplate": "@param {param} ",

// The template of the return Doxygen line that is generated. If empty it won't get generated at all.
"doxdocgen.generic.returnTemplate": "@return {type} ",

// Decide if the values put into {name} should be split according to their casing.
"doxdocgen.generic.splitCasingSmartText": true,

// Array of keywords that should be removed from the input prior to parsing.
"doxdocgen.generic.filteredKeywords": [],

// Substitute {author} with git config --get user.name.
"doxdocgen.generic.useGitUserName": false,

// Substitute {email} with git config --get user.email.
"doxdocgen.generic.useGitUserEmail": false,

// Provide intellisense and snippet for doxygen commands
"doxdocgen.generic.commandSuggestion": true,

// Add `\\` in doxygen command suggestion for better readbility (need to enable commandSuggestion)
"doxdocgen.generic.commandSuggestionAddPrefix": false
    

19.5 去除所有空行

  • 按Ctrl+H
  • 输入以下表达式, 选择.*, 然后按全部替换
^\s*(?=\r?$)\n

20. ProtoBuf 入门教程

ProtoBuf 入门教程
Proto与Json相互转换

21. RTSP协议

流媒体协议之RTSP详解
基于FFmpeg_v4l2_live555的RTSP网络摄像头方案分析

21.1 live555 IPC框架

在这里插入图片描述

在这里插入图片描述

21.2 低延迟

  • 不要使用VLC测试延迟,VLC为了流畅,延迟较大
  • 使用ffplay测试延迟
ffplay rtsp://192.168.3.201:554/meta
ffplay --fflags nobuffer rtsp://192.168.3.201:554/meta
ffplay -fflags nobuffer -flags low_delay -framedrop -strict experimental rtsp://192.168.3.9:555/horizonStream
  • 延迟测试方法:Camera拍摄在线时钟,Camera图像与在线时间在同一屏幕,截图便可计算延时
  • 视频编码不要有B帧
  • 接收视频buffer至少3个
  • 拉流端的处理

22. JSON与JavaScript对象对比

在这里插入图片描述

23. 截图贴图工具

  • Windows:snipaste
  • Ubuntu: flameshot
 sudo apt-get install flameshot 

24. Linux获取USB Camera vid和pid

  • /sys/class/video4linux/xxxx/device/modalias文件,其中xxxx为video0或video1等
  • /proc/bus/input/devices
  • 参考

25. 查找字符串grep

  • 参考
  • 在当前目录及子目录下查找完整字符串
grep -n -r -w "whole_word" *
grep -n -r -w "whole_word" *.cpp

26. OpenPrinting CUPS

  • CUPS:Common Unix Printing System
  • CUPS 使用 Internet Printing Protocol (“IPP”)
  • CUPS 3.x 的架构发生了巨大变化,是全 IPP,仅支持无驱动 IPP 打印机,不再支持 PPD 文件和经典 CUPS 驱动程序。
  • PPD:PostScript Printer Description
    • PPD文件给CUPS提供了如何把需要打印的文件转换成打印机能识别的文件的信息
    • PPD文件通常需要相应的filter(解释器)才能运作

26.1 支持的打印机

27. Ubuntu安装docker及image

27.1 配置 Docker 以便不需要使用 sudo 命令

  • 添加 docker 组
sudo groupadd docker
  • 将当前用户添加到 docker 组
sudo usermod -aG docker $USER

27.2 Dokcer安装redmine

27.3 Docker安装部署taiga项目

28. Ubuntu安装部署Gitlab

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值