Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

4. Reference

Jeffrey edited this page Oct 7, 2023 · 22 revisions

4.1 Main

4.2 Others

4.3 Proxy

4.3.1 cpanm

cpanm -n App::cpanminus --mirror http://mirrors.163.com/cpan --mirror-only
npm config rm registry
npm config set proxy=http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890
npm config list
# 如果需要取消代理
npm config delete proxy
npm config delete https-proxy

# 或者直接运行
npm install --registry=https://registry.npm.taobao.org -g bash-language-server

4.3.2 gem

gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/

4.3.3 github

[http "https://github.com"]
	# no need to setup https for github
	# http proxy 
	proxy = http://127.0.0.1:7890
	# or can use socks5 proxy
	#proxy = socks5://127.0.0.1:7891
[https]
	proxy = https://127.0.0.1:7890

#https://raw.githubusercontent.com/double12gzh/dotfiles/main/ssh/.ssh/config
#https://raw.githubusercontent.com/double12gzh/dotfiles/main/git/.config/git/config
#https://gist.github.com/laispace/666dd7b27e9116faece6
https://stackoverflow.com/questions/70603564/windows-ssh-proxycommand-usr-bin-bash-line-0-exec-nc-not-found-on-git-bash

4.3.4 ssh

add the following to ~/.ssh/config and run cmd ssh -vvv -T git@github.com with debug

Host github.com
  User git
  Port 443
  Hostname ssh.github.com
  # http proxy
  #ProxyCommand connect -S 127.0.0.1:7890 %h %p
  #socks5 proxy
  ProxyCommand nc -X 5 -x 127.0.0.1:7891 %h %p
  IdentityFile ~/.ssh/id_rsa
  TCPKeepAlive yes

Host ssh.github.com
  User git
  Port 443
  Hostname ssh.github.com
  TCPKeepAlive yes
  IdentityFile ~/.ssh/id_rsa
  PreferredAuthentications publickey
  # http proxy
  #ProxyCommand connect -S 127.0.0.1:7890 %h %p
  #socks5 proxy
  ProxyCommand nc -X 5 -x 127.0.0.1:7891 %h %p

Host *
  # 共享连接
  ControlMaster auto
  # 与上述 ControlMaster 同时使用时,指定连接共享的路径
  ControlPath ~/.ssh/master-%r@%h:%p
  # 在后台保持打开
  ControlPersist yes
  ServerAliveInterval 60
  IdentityFile ~/.ssh/id_rsa
  HostKeyAlgorithms +ssh-dss
  # http proxy
  #ProxyCommand connect -S 127.0.0.1:7890 %h %p
  #socks5 proxy
  ProxyCommand nc -X 5 -x 127.0.0.1:7891 %h %p

# http://man.openbsd.org/ssh_config.5
# https://gist.github.com/laispace/666dd7b27e9116faece6
# https://gist.github.com/evantoli/f8c23a37eb3558ab8765

4.3.5 安装 Fire Code Font

在 Ubuntu 上安装 Nerd Fonts,你可以按照以下步骤操作:
打开终端。
‎
下载你想要的 Nerd Font。例如,如果你想要下载 Fira Code Nerd Font,你可以运行以下命令:
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip
‎
3. 解压下载的字体文件:
unzip FiraCode.zip
‎
4. 创建一个 .fonts 目录(如果还没有的话)并将字体文件移动到这个目录:
mkdir -p ~/.fonts
mv *.ttf ~/.fonts/
‎
5. 更新字体缓存:
fc-cache -fv
‎
6. 现在,你应该可以在你的终端或文本编辑器的字体设置中看到新安装的 Nerd Font 了。
注意:你需要将上述命令中的 FiraCode.zip 替换为你实际下载的字体文件的名称。你可以在 Nerd Fonts 的 GitHub 仓库的 "Releases" 页面找到所有可用的字体。

4.3.6 macOS 安装 Fire Code Font

Nerd Fonts 是一种特殊的字体集,它包含了一些常用的符号和图标,如 FontAwesome、Devicons、Octicons、Weather Icons 等。这些字体非常适合在终端、编辑器和 IDE 中使用。
‎
要在 macOS 上安装 Nerd Fonts,你可以使用 Homebrew。以下是具体步骤:
‎

如果你还没有安装 Homebrew,你可以在终端中运行以下命令来安装:
‎
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
‎
2. 安装 Homebrew 的字体管理器 cask:
‎

brew tap homebrew/cask-fonts
‎
3. 使用 cask 安装 Nerd Fonts。例如,如果你想安装 Fira Code Nerd Font,你可以运行以下命令:
‎

brew install --cask font-fira-code-nerd-font
‎
4. 安装完成后,你可能需要重启你的终端或者整个系统,以便系统能够识别新安装的字体。
‎
5. 最后,你需要在你的终端模拟器的设置中选择 Nerd Font。具体的步骤取决于你使用的终端模拟器。通常,你需要打开终端模拟器的设置,找到字体设置,然后选择 Nerd Font。
‎
注意:Nerd Fonts 包含了很多种字体,你可以在 Nerd Fonts 的官方网站上查看所有可用的字体,并选择你喜欢的字体进行安装。

4.3.7 lua/modules/utils/icons.lua

https://gist.github.com/double12gzh/8647b7094a8d102d06e33c84052ee057

4.3.8 lua/modules/configs/ui/alpha.lua

https://gist.github.com/double12gzh/5072df0351052ab150877a74b781d373

Clone this wiki locally