linux
virtualenv安装+虚拟环境创建
pip3 install virtualenv --upgrade
virtualenv --system-site-packages ~/env/tensorflow
激活虚拟环境/退出虚拟环境
source ~/tensorflow/bin/activate
deactive
# 19.12.02 update
source ./venv/bin/activate
deactivate
创建目录/删除目录
mkdir test1
mkdir -p test2/test22
rm -rf 目录名字
scp
scp /opt/soft/nginx-0.5.38.tar.gz root@10.10.10.10:/opt/soft/scptest
// 从tk传到服务器
scp ./stc/CAFE-MORL-BottomUp-2metrics/logs/rho_mid/ tk@xxx:
cuda/cudnn 版本
cat /usr/local/cuda/version.txt # cuda 如果有多个cuda可能显示不出来
nvidia-smi
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 # cudnn
git
git init # init it as a repository
git add filename1 # add file 1 to repository
git add filename2 # add file 2 to repository
# add操作只是把文件存到'暂存区'
git commit -m "notes" # add commit to repository
# commit后会把'暂存区'(stage)的文件提交到'仓库'即分支(master)
git diff filename # the difference between file's old version and current version
git status # current status of the repository
git log # log
远程仓库(github)
https://www.liaoxuefeng.com/wiki/896043488029600/896954117292416
第一步
ssh-keygen -t rsa -C "youremail@example.com" # 创建SSH key, 一路回车
可以在用户主目录里找到.ssh目录,里面有id_rsa和id_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥,可以放心地告诉任何人。
第二步
登录github -> Settings -> SSH and GPG keys -> New SSH key -> title随意, key复制id_rsa.pub的内容
使用
关联本地已有库到远程库
先在github上建立一个新的库比如test
git remote add origin git@github.com:shutongcs/test.git # 关联
git push -u origin master # 关联后,第一次推送master分支的所有内容
git push origin master # 之后,每次本地提交(add+commit)后,推送最新修改
从建库开始的操作:
git init
git remote add origin git@github.com:shutongcs/SIGCOMM.git
git pull --rebase origin master # 如果github的库里有本地没有的文件直接push会报错,需要先把远程库的文件pull下来
git add <name> # 可以添加单个文件或文件夹
git commit -m 'notes' # 添加描述
git push origin master # 将本地文件push到远程库
git push -u origin master # 如果远程库是空的,第一次push需要加-u
从远程库克隆至本地
远程库比如test
git clone git@github.com:shutongcs/test.git
分支管理
https://www.liaoxuefeng.com/wiki/896043488029600/900003767775424
利用分支进行版本控制修改,在分支上完成功能,再提交到主分支
git branch <name> # 创建分支
git switch <name> # 切换分支
git branch # 查看分支
git merge <name> # 合并分支name到当前分支
git branch -d <name> # 删除分支
git tag <name> # 向当前branch打标签
git tag # 查看所有标签
来源:CSDN
作者:justw2
链接:https://blog.csdn.net/justw2/article/details/101927396