加速github文件下載


加速github文件下載
github文件下載加速

github.com/hunshcn/gh-proxy.git 是我們要下載的地址,前綴https://去掉  

git clone https://gitclone.com/github.com/hunshcn/gh-proxy.git

go get 超時, 使用以下方法解決

#linux 下
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
go get -u -v github.com/gin-gonic/gin

win10無法打開gihthub.com

https://www.cnblogs.com/liweimu/p/github_Access.html
1.電腦打開CMD窗口
2.ping github.com
3.復制其域名對應的IP,如 140.82.114.4
4.nodepad++打開: C:\Windows\System32\drivers\etc\hosts
添加如下代碼
#github related website
140.82.114.4 github.com
140.82.114.4 gist.github.com
5.打開cmd輸入ipconfig/flushdns刷新dns緩存
6.重新打開網站即可

http和rpc的區別

HTTP 就是一種 RPC,你通過一定的方法去調用 HTTP 服務器上的某個 procedure,執行完以后把結果返回給你。 
有的時候我們嫌標准 HTTP 太慢/太復雜/不適合特定場景,那么就自己發明一個新的。 

Python約瑟夫圓環的解法
現在有13個人圍成一個環,從1開始報數,數到3的人離開,寫出程序計算最后剩下的是誰

def josephus(alist, k=1, m=3):
   # alist: 要循環的列表 [1, 2,3, 4,5]
   # k: 從編號為k的人開始
   # m: m為報數
   if len(alist) > 1:
       index, step = k - 1, m
       index = (index + step -1) % len(alist)
       alist.pop(index)
       return josephus(alist, index+1, m)
   else:
       return alist[0]

斐波那契數列

def fib(num):
    a, b = 0, 1
    for i in xrange(num):
        yield b
        a, b = b, a+b

解決zsh: command not found: swag方法
問題:zsh: command not found: swag
方法:export PATH=$PATH:$HOME/go/bin

pip豆瓣源

[global]
timeout = 60
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com

rm 遞歸刪除某個文件夾下的.pyc文件
rm 遞歸刪除test文件夾下的所有.pyc文件

find test/ -name *.pyc| xargs rm -rf


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM