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 Feb 18, 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

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 -T git@github.com

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

Clone this wiki locally