126

Git设置代理克隆Github代码

http方式克隆

git clone -c https.proxy="127.0.0.1:7890" <仓库地址>

ssh方式克隆

编辑配置文件~/.ssh/config,加入如下配置

Host github.com
        HostName github.com
        User git
        ServerAliveInterval 60
        # 走 HTTP 代理
        ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=7890
        # 走 socks5 代理 linux
        #ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
        # 走 socks5 代理 windows
        #ProxyCommand connect -S 127.0.0.1:7890 %h %p

然后,直接克隆代码即可

152

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
163

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
490

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
543

麒麟V10系统安装Docker CE

前言

麒麟V10系统,软件可直接安装CentOS 7的软件包。

软件源采用清华大学软件源

yum源:https://mirror.tuna.tsinghua.edu.cn/centos-vault/centos/7/extras
docker源: https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/7

创建Docker软件源

编辑软件源

vi /etc/yum.repos.d/docker-ce.repo

输入以下内容