git 配置
- git 设置全局用户名密码
- git 解决每次pull push 都输入用户名密码
- git 默认编辑器模式为vim
- git 修改终端指令显示英文
- bash 显示git 当前分支
- git 把一个初始化gitlab 迁移到github并上传
- miniconda python 环境不生效
- 安裝cuda 关闭代理
- 编辑 sudo vim ~/.bashrc
- 安裝cudnn 关闭代理
- cudnn 版本错了,
- wsl 使用
- wsl 慎用这个指令!!!这个会直接把虚拟盘数据全部删除且不可恢复
- cudnn so 文件找不到,执行下面指令生效
- change pip yuan
- 装了一个钉钉,因为换了系统
- ssh 免密登录
- git 设置alias 快捷指令
git 设置全局用户名密码
git config --global user.name "your name"
git config --global user.email "your@mail.sdu.edu.cn"
git 解决每次pull push 都输入用户名密码
git config --global credential.helper store
git 默认编辑器模式为vim
git config --global core.editor vim
git 修改终端指令显示英文
git config --global i18n.commitencoding utf-8 # 设置提交信息编码为 UTF-8
git config --global i18n.logoutputencoding utf-8 # 设置日志输出编码为 UTF-8
git config --global i18n.logoutputencoding utf-8 # 设置日志输出编码为 UTF-8
git config --global i18n.commitencoding utf-8 # 设置提交信息编码为 UTF-8
git config --global i18n.logoutputencoding utf-8 # 设置日志输出编码为 UTF-8
git config --global gui.encoding utf-8 # 设置图形界面编码为 UTF-8
bash 显示git 当前分支
编辑~/.bashrc 文件, 追加内容如下
function git_branch {
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
if [ "${branch}" != "" ];then
if [ "${branch}" = "(no branch)" ];then
branch="(`git rev-parse --short HEAD`...)"
fi
echo " ($branch)"
fi
}
export PS1='\[\e[32;40m\]\u@\h: \[\033[01;36m\]\W\[\033[01;32m\]$(git_branch)\[\033[00m\] \$ '
最后执行 source ~/.bashrc
git 把一个初始化gitlab 迁移到github并上传
cd /path/to/your/local/repo
# 如果之前初始化过这个项目先执行下面的指令。否则,忽略这条
sudo rm -r .git
# 执行下面指令
git init
git remote add origin https://github.com/username/repository.git
git add .
git commit -m "Initial commit"
git push -u origin master -f
miniconda python 环境不生效
安裝cuda 关闭代理
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
sudo sh cuda_12.1.1_530.30.02_linux.run
编辑 sudo vim ~/.bashrc
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64
安裝cudnn 关闭代理
最新版本
wget https://developer.download.nvidia.com/compute/cudnn/9.2.0/local_installers/cudnn-local-repo-ubuntu2204-9.2.0_1.0-1_amd64.deb
sudo dpkg -i cudnn-local-repo-ubuntu2204-9.2.0_1.0-1_amd64.deb
sudo cp /var/cudnn-local-repo-ubuntu2204-9.2.0/cudnn-*-keyring.gpg /usr/share/keyrings/
旧版本: 旧版本下载
最后执行下面指令
sudo apt update
sudo apt install libcudnn8
sudo apt install libcudnn8-dev
sudo apt install libcudnn8-samples
cudnn 版本错了,
sudo dpkg -l |grep cudnn
sudo apt-get purge cudnn9-cuda-12-5 # 删除不要的
wsl 使用
# 看下有哪些系统
wsl -l -v
# 先停止
wsl --terminate Ubuntu-22.04
# 备份 导出
wsl --export Ubuntu-22.04 D:\wslubuntu\ubuntu2204.tar
# 导入
wsl --import Ubuntu-22.04 C:\WSL D:\temp\Ubuntu-22.04.tar
wsl 慎用这个指令!!!这个会直接把虚拟盘数据全部删除且不可恢复
wsl --unregister Ubuntu-22.04
cudnn so 文件找不到,执行下面指令生效
ldconfig -p | grep cud #查看lib依赖
export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH
change pip yuan
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# file path: /home/shiyou/.config/pip/pip.conf
装了一个钉钉,因为换了系统
ssh 免密登录
ssh-keygen -t rsa
1ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip
git 设置alias 快捷指令
sudo vim ~/.gitconfig
alias gst='git status'
alias gcm='git commit'
alias gp='git pull'
alias gad='git add'
保存即可