leelongcrazy's blog

Python一行代码建立HTTP服务

在Python语言中有一条可在本机快速建立http服务的命令,可实现与他人分享存在你电脑的上的文件。

python -m SimpleHTTPServer
# 默认开启8000端口,后面可跟数字指定端口
Serving HTTP on 0.0.0.0 port 8000 ...

浏览器打开,IP:Port即可实现该目录下的浏览,文件下载。


今天配置.ssh/config文件时候还犯了一个可笑的错误。在config文件中配置管理密钥的格式如下:

Hostname github.com
User git
IdentityFile ~/.ssh/github

Host aliyun
Hostname xx.xx.xx.xx
User xxx
IdentityFile ~/.ssh/aliyun

Host linux
Hostname localhost
Port 9999
User root
IdentityFile ~/.ssh/linux

我将IdentityFile错误的打成了IdentifyFile,结果一直爆下面的错误:

.ssh/config: line 40: Bad configuration option: identifyfile
.ssh/config: terminating, 1 bad configuration options

在网上搜索了好多结果,最终看到一文章提示有可能将单词打错导致的,才得以修正过来。原来identity身份的意思, identify鉴定,辨认的意思。配置中需要的是 身份文件,而不是我理解的鉴定文件