1. 下载历史版本的Git:
      https://registry.npmmirror.com/binary.html?path=git-for-windows/

    2. 支持多个代码版本控制系统:

      vim .git/config

      [remote "origin"]

      url = git@github.com:testuser/testrepo.git

      url = git@gitee.com:testuser/testrepo.git

      fetch = +refs/heads/:refs/remotes/origin/

      [branch "main"]

      remote = origin

      merge = refs/heads/main

    3. Kubectl 命令补全:

      yum install -y bash-completion
      source /usr/share/bash-completion/bash_completion
      source <(kubectl completion bash)
      echo "source <(kubectl completion bash)" >> ~/.bashrc

    4. VMware Fusion 虚拟机网络在桥接模式下,如果是 dhcp 模式,远程 ssh 会显得非常的慢,解决办法是将 IP 获取方式改为 static。

    5. HDD 磁盘两个维度的指标基本上是恒定的,IOPS 大概在 120~150 左右,带宽大概在 150~200M 左右。

    6. 解决 Mac 下 Homebrew 安装软件较慢的问题:
      /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

    7. 如何在Mac系统下使用Git全局忽略隐藏文件.DS_Store?
      echo ".DS_Store" >> /Users/iuskye/.gitignore_global
      git config --global core.excludesfile /Users/iuskye/.gitignore_global

      其中iuskye换成你的用户名
    8. 解决Mac连接外接显示器发热问题:
      禁止'聚焦'索引文件:
      sudo mdutil -a -i off
      如果需要再次使用,可以通过以下命令重新开启:
      sudo mdutil -a -i on

    9. git log --pretty=oneline filename ## 通过文件查commitid
      git show commitid ## 通过commitid查提交详情

    10. 启用UEFI:
      https://support.microsoft.com/zh-cn/windows/windows-11-%E5%92%8C%E5%AE%89%E5%85%A8%E5%90%AF%E5%8A%A8-a8ff1202-c0d9-42f5-940f-843abef64fad
      Dell启用UEFI:
      https://www.dell.com/support/kbdoc/zh-cn/000190116/%E5%A6%82-%E4%BD%95-%E5%90%AF%E7%94%A8-%E6%88%B4%E5%B0%94-%E8%AE%BE%E5%A4%87%E7%9A%84-%E5%AE%89%E5%85%A8-%E5%90%AF%E5%8A%A8-%E5%8A%9F%E8%83%BD
      启用TPM2.0:
      https://support.microsoft.com/zh-cn/windows/%E5%9C%A8%E7%94%B5%E8%84%91%E4%B8%8A%E5%90%AF%E7%94%A8-tpm-2-0-1fd5a332-360d-4f46-a1e7-ae6b0c90645c
      Dell启用TPM2.0:
      https://www.dell.com/support/kbdoc/zh-cn/000189676/windows-10-%e5%a6%82%e4%bd%95-%e5%90%af%e7%94%a8-tpm-%e5%8f%97%e4%bf%a1%e4%bb%bb%e7%9a%84-%e5%b9%b3%e5%8f%b0-%e6%a8%a1%e5%9d%97

    11. 内存溢出 out of memory,指程序要求的内存超出了系统所能分配的范围,出现 out of memory;比如申请一个 int 类型,但给了它一个 int 才能存放的数,就会出现内存溢出,或者是创建一个大的对象,而堆内存放不下这个对象,这也是内存溢出。

      内存泄露 memory leak,是指程序在申请内存后,无法释放已申请的内存空间(指分配出去的内存无法被gc回收)。一次内存泄露危害可以忽略,但内存泄露堆积后果很严重,无论多少内存,迟早会被占光。

    12. MySQL主从配置:
      主:
      grant replication slave on *.* to 'rep'@'172.23.6.230' identified by '123456';
      flush privileges;
      show master status;
      从:
      stop slave;
      change master to master_host='172.23.6.59',master_user='rep',master_password='123456',master_log_file='mysql-bin.000001',master_log_pos=xxxx;
      start slave;

    13. JDK安装:
      update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_151/bin/java 300
      update-alternatives --install /usr/bin/javah javah /opt/jdk1.8.0_151/bin/javah 300
      update-alternatives --install /usr/bin/javap javap /opt/jdk1.8.0_151/bin/javap 300
      update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_151/bin/javac 300
      update-alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_151/bin/jar 300
      update-alternatives --set java /opt/jdk1.8.0_151/bin/java
      update-alternatives --set javah /opt/jdk1.8.0_151/bin/javah
      update-alternatives --set javap /opt/jdk1.8.0_151/bin/javap
      update-alternatives --set javac /opt/jdk1.8.0_151/bin/javac
      update-alternatives --set jar /opt/jdk1.8.0_151/bin/jar
      卸载:
      update-alternatives --remove java /opt/jdk1.8.0_151/bin/java
      update-alternatives --remove javah /opt/jdk1.8.0_151/bin/javah
      update-alternatives --remove javap /opt/jdk1.8.0_151/bin/javap
      update-alternatives --remove javac /opt/jdk1.8.0_151/bin/javac
      update-alternatives --remove jar /opt/jdk1.8.0_151/bin/jar

    14. 查看服务器品牌:
      grep 'DMI' /var/log/dmesg

    15. Mac 打开应用程序报 『你没有权限来打开应用程序"XXX"』的解决办法:
      sudo xattr -rd com.apple.quarantine /Applications/iTerm.app
      后面跟应用程序的路径。

    16. Openssl证书查看证书信息:
      openssl x509 -in certificate.pem -noout -text

    17. 生成SSL证书:
      openssl genrsa -out privatekey.key 2048 -days 3650
      openssl req -new -key privatekey.key -out certrequest.csr -days 3650
      openssl x509 -req -in certrequest.csr -signkey privatekey.key -out certificate.pem -days 3650
      生成JKS证书:
      openssl pkcs12 -export -out Cert.pfx -in certificate.pem -inkey privatekey.key
      keytool -importkeystore -v -srckeystore Cert.pfx -srcstoretype pkcs12 -destkeystore client.jks

    18. 已有标准分区的磁盘如何扩展到LVM格式?
      pvcreate /dev/sdb1
      vgextend centos /dev/sdb1
      lvextend -l +100%FREE /dev/centos/root
      xfs_growfs /dev/centos/root

    19. mac zsh 显示 git 分支的方法:
      vim ~/.zshrc
      function parse_git_branch() {

      git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'

      }
      setopt PROMPT_SUBST
      export PROMPT='%F{grey}%n%f %F{cyan}%~%f %F{green}$(parse_git_branch)%f %F{normal}$%f '

    20. Ubuntu终端显示代码库分支名:
      ~/.bashrc

      force_color_prompt=yes
      color_prompt=yes
      parse_git_branch() {

      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'

      }
      if [ "$color_prompt" = yes ]; then

      PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '

      else

      PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(parse_git_branch)\$ '

      fi
      unset color_prompt force_color_prompt