2250

Git实用操作备忘

克隆指定分支

git clone -b --depth=1 <分支名称> <仓库地址>

说明:--depth=1 表示只克隆最近一次commit的分支完整内容,这样克隆的项目就不会很大

关闭git输出信息分页器

git config --global --replace-all core.pager "less -F -X"

删除全局配置

git config --global --unset user.name

编辑全局配置

git config --global --edit

查看提交的具体内容

git show commit_id

删除所有远程标签

git show-ref --tag | awk '{print ":" $2}' | xargs git push origin

删除所有本地标签

git tag -l | xargs git tag -d
1988

Nvidia显卡数据获取

查看显卡列表

nvidia-smi -L

查看显卡显存

nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits

查看进程显存占用

nvidia-smi --query-compute-apps=pid,process_name,used_gpu_memory --format=csv,noheader,nounits
6109

Ubuntu系统将显示服务从Wayland切换到X11

前言

Ubuntu 为其用户提供了两个显示服务器:“Wayland”(默认显示服务器)和“Xorg”(也称为 X11 或简称“X”)。这两种显示服务器都位于物理、计算资源和与之交互的图形用户界面 (GUI) 之间的连接点。

虽然 Wayland 是一种现代、高效的显示服务器架构,但它并不与所有应用程序兼容。某些用户可能会遇到某些应用程序在 Wayland 下运行不佳或根本无法运行的情况。如果您属于此类,您可能希望切换到 X11 显示服务器。

切换

  • 使用 vim 打开 /etc/gdm3/custom.conf
vi /etc/gdm3/custom.conf
  • 将 WaylandEnable 设置为 false
WaylandEnable=false
  • 按 ESC ,输入 :wq 保存退出,并重启服务器
reboot
5985

麒麟V10系统安装Docker CE

前言

麒麟V10系统,存在两种发行版:基于Ubuntu 、基于CentOS

基于Ubuntu

软件可使用 Ubuntu 20.04 (focal) 的软件包

软件源采用阿里云软件源

apt源:https://mirrors.aliyun.com/ubuntu/dists/focal/
docker源:https://mirrors.aliyun.com/docker-ce/linux/ubuntu

创建Docker软件源

添加GPG key

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

添加软件源

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
2737

Windows下的 Git-bash 增加zip 和 unzip 工具

git-bash默认是没有zip和unzip命令的,我们可以通过手动安装方式,增加该命令。

  1. 下载zip以及bzip2,因为zip依赖bzip2.dll
  2. 将zip-3.0-bin.zip和bzip2-1.0.5-bin.zip解压,拷贝zip.exe 和 bzip2.dll 到 Git安装目录下的 \usr\bin 目录中

下载文件:
zip-3.0-bin.zip

bzip2-1.0.5-bin.zip