0%

vscode

目录树/搜索排除

修改/.vscode/settings.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
/*以下文件不搜索*/
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
},
/*以下文件不在左侧目录显示*/
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
}
}

头文件路径

Crtl+Shift+P C/C++: Edit configurations(JSON)

Makefile

模板

module

KERNELDIR := /home/xxx
CURRENT_PATH := $(shell pwd)

obj-m := xxx.o

build: kernel_modules

kernel_modules:
    $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) modules
clean:
    $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) clean

自动化变量

自动化变量 描述
$@ 规则中的目标集合,在模式规则中,如果有多个目标的话,“$@”表示匹配模式中定义的目标集合。
$% 当目标是函数库的时候表示规则中的目标成员名,如果目标不是函数库文件,那么其值为空。
$< 依赖文件集合中的第一个文件,如果依赖文件是以模式(即“%”)定义的,那么“$<”就是符合模式的一系列的文件集合。
$? 所有比目标新的依赖目标集合,以空格分开。
$^ 所有依赖文件的集合,使用空格分开,如果在依赖文件中有多个重复的文件,“$^”会去除重复的依赖文件,值保留一份。
$+ 和“$^”类似,但是当依赖文件存在重复的话不会去除重复的依赖文件。
$* 这个变量表示目标模式中”%”及其之前的部分,如果目标是 test/a.test.c,目标模式为 a.%.c,那么“$*”就是 test/a.test。

docker

cmd

创建容器(共享文件夹):docker run -it (ubuntu) bash
为已创建容器增加运行参数:docker container update (option) (container_id)
参数:
指定容器名称:–name (container_name)
设置共享文件夹:-v (local_path/file):(/dest_path/file)
拥有真root权限(可执行mount): –privileged

删除容器: docker rm (container_id)

修改容器名: docker rename (old_name) (new_name)

启动容器:docker start (container_id)
停止容器: docker stop (container_id)

进入容器:docker exec -it (container_id) bash
退出容器:ctrl+d

git&repo

git常用指令

用户名/邮箱:

1
2
3
4
5
6
7
8
设置用户名:  
git config --global user.name your_name
设置邮箱:
git config --global user.email your_email_address
查看用户名:
git config user.name
查看邮箱:
git config user.email

远端管理

1
2
3
4
5
6
7
8
9
10
11
增加远端:  
git remote add remote_name url

建立本地分支与远端分支的跟踪关系:
git branch --set-upstream-to=remote_name/remote_branch_name local_branch_name

删除远端:
git remote remove remote_name

清理无效的远程追踪分支:
git remote prune remote_name

分支管理:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
查看分支:  
git branch -vva (显示所有本地及远端分支并展示两者之间的跟踪关系)

分支重命名
git branch -m old_branch_name new_branch_name

创建本地分支:
git checkout -b new_branch_name
在本地创建基于远端的分支(不会建立跟踪关系):
git fetch remote_name remote_branch_name:local_branch_name
推送本地分支到远端(创建远端分支)并建立跟踪关系:
git push -u remote_name local_branch_name:remote_branch_name

切换分支:
git checkout branch_name

删除本地分支:
git branch -d branch_name
删除远端分支:
git push remote_name :remote_branch_name (local_branch_name为空)

历史管理:

1
2
3
4
显示每个提交所在的分支及其分化衍合情况:  
git log --graph
回退:
git reset --hard commit id

submodule管理:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
clone submodule到当前仓库:(如果clone的是无push权限的仓库,先fork)  
git submodule add url local_path

提交对submodule的修改:
进入submodule路径push,退回本地仓库路径push

删除submodule:
git submodule deinit submodule_name
git rm --cached submodule_name
删除submodule目录
删除.gitmodules .git/config .git/module/* 中submodule相关内容

clone含有submodule的仓库:
git clone url
git submodule init && git submodule update
或者
git clone url --recursive

patch管理:

1
2
3
4
5
6
7
8
9
生成patch:  
git format-patch start_commit_id..end_commit_id
使用patch:
git am patch_path/*
解决冲突:
step1:git apply --reject patch_name
step2:根据.rej文件手动修改源码
step3:git add .
step4:git am --continue

repo指令

分支管理:

1
2
3
4
查看:repo branch   
创建:repo start branch_name --all(对所有工程)
切换:repo checkout branch_name
删除:repo abandon branch_name

对所有工程执行脚本

repo forall -c 'git checkout branch_name'  

github

参考教程 https://www.liaoxuefeng.com/wiki/896043488029600/900937935629664

git国内下载站 https://github.com/waylau/git-for-win

生成SSH-KEY: ssh-keygen -C “email”

  1. install nodejs  

  2. install hexo  

  3. 发布  

    1
    2
    hexo g 
    hexo d
  4. hexo页面无法正常显示

    1
    2
    3
    4
    npm install hexo-renderer-swig
    #npm install hexo-renderer-ejs
    #npm install hexo-renderer-marked
    #npm install hexo-renderer-stylus
  5. 更换环境

    1
    2
    3
    4
    5
    6
    7
    git clone xx
    cd xx
    npm install hexo
    npm install

    // hexo环境配置好后,继续像之前一样
    hexo new post_name

https://hexo.io/zh-cn/docs/