Common instructions

Github Documents

1
2
3
4
5
6
git init
git add README.md
git commit -m "commit"
git branch -M main
git remote add re1 https://lingke.git
git push -u re1 main
  • 如果有冲突,先拉取pull合并在push
    1
    2
    git pull re1 main --rebase
    git push -u re1 main
    1
    2
    3
    git add .
    git commit -m "描述你的更改"
    git push origin 新分支名
    1
    2
    3
    进入文件夹,运行指令
    bundle exec jekyll serve -l -H localhost
    访问localhost:4000

LFS上传

1
2
3
4
5
6
7
8
9
10
git init
git lfs install
git remote add origin <github project link>

git lfs track "your file name"
git add .gitattributes
git add "your file name"
git commit -m "description"

git push origin main

查看分支,切换分支

1
2
git branch // 查看分支
git branch -M main // 切换分支到main

初始化,拉取代码

1
2
3
4
git init
git remote add origin https://XXXX.github
git branch -M main
git pull origin main --rebase

CMAKE编译相关

1
2
3
4
5
6
7
8
9
10
11
12
13
# gcc编译c,g++编译cpp

mkdir ProjectName-build-debug
cd ProjectName-build-debug
# 指定使用mingw编译器
cmake -G "MinGW Makefiles" ..
cmake --build .
.\可执行文件名.exe
# 接着查看输出即可

# 编译
g++ -std=c++17 helloworld.cpp -o helloworld -I D:/CPP_Third_Lib/include/boost-1_87 -L D:/CPP_Third_Lib/lib -lws2_32 -lwsock32

Hexo+next相关操作

1
2
3
4
hexo clean // 清空缓存
hexo g // 生成静态文件
hexo s // 本地预览 https://localhost:4000
hexo d // 部署到远程github

ubuntu常用指令

1
2
3
4
5
6
7
8
9
dir # 查看文件夹
ls

nvidia-smi # 显卡
free -h # 内存
top # 运行进程
lscpu # 查看CPU


conda

1
2
3
4
5
6
7
conda create -n my_env python=3.9
conda env list
conda deactivate
conda remove -n env_name --all
conda env export > environment.yml # 导出当前环境(生成环境文件)
conda env create -f environment.yml # 从环境文件创建环境

nvidia-jetson

1
2
cat /proc/device-tree/model # 查看硬件信息
# NVIDIA Jetson Xavier NX Developer Kit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl -LsSf https://astral.sh/uv/install.sh | sh # 安装uv(类似conda,环境管理器)
source $HOME/.local/bin/env # 添加uv到系统路径

uv venv ds --python 3.10 --seed # 创建环境
source ds/bin/activate # 激活
deactivate # 退出环境
rm -rf ds # 删除环境
uv pip install vllm # 安装vllm

jetson-containers run --name ollama $(autotag ollama) # 启动ollama容器
exit # 退出容器
docker stop ollama # 停止容器
sudo docker start ollama

sudo docker image ls # 查看docker容器列表