https://www.gravatar.com/avatar/ecd1e184bdf4016f24c818bde9e65b3d?s=240&d=mp
记录点滴、留住时光

Python程序打包技术学习笔记

相关备忘点

编译

1
python setup.py build

安装

1
python setup.py install

开发模式安装

1
python setup.py develop

在修改代码后可以立即使用,不用重新安装

打一个源码包

1
python setup.py sdist

生成funniest-0.1.tar.gz的源码包

从源码包安装

1
2
tar -zxvf funniest-0.1.tar.gz
python setup.py install

若报错error: can't create or remove files in install directory·,是因为没有权限改安装命令为sudo python3 setup.py install即可

Git常用

修改全局名称及邮箱

当发现提交时的用户名不对时,用下面的指令修改

1
2
git config --global user.name "prehisle"
git config --global user.email prehisle@gmail.com

git commit message编写

1
2
3
4
5
<type>(<scope>): <subject>
// 空一行
<body>
// 空一行
<footer>
1
2
3
4
5
6
7
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动

参考:Commit message 和 Change log 编写指南

Python备忘

报error: invalid command ‘bdist_wheel’

1
pip install wheel

时间转换

Python获取秒级时间戳与毫秒级时间戳

ubuntu18.04使用pip安装某包时报错

https://note.youdao.com/yws/public/resource/41112cc5871c7abf8ae2c90c3f174804/xmlnote/image-20200401153406748_4d9d6a45b0f34a249060fa6f5ce92a44/23489

1
2
3
4
prehisle@ubuntu:~/tmp/tyoudaoimg$ pip install -i https://pypi.org/simple youdaopic==0.0.9
Collecting youdaopic==0.0.9
  Could not find a version that satisfies the requirement youdaopic==0.0.9 (from versions: 0.0.1)
No matching distribution found for youdaopic==0.0.9

改用pip3安装成功

Ipsec基础知识

名词解释

AH

IPsec Authentication Header IPsec 认证头协议(IPsec AH)是 IPsec 体系结构中的一种主要协议,它为 IP 数据报提供无连接完整性与数据源认证,并提供保护以避免重播情况。

ESP

IPsec Encapsulating Security Payload 封装安全负载,且ESP加密采用的是对称密钥加密算法,能够提供无连接的数据完整性验证、数据来源验证和抗重放攻击服务

Openssl知识点

文件格式

只有pfx格式的数字证书是包含有私钥的,cer格式的数字证书里面只有公钥没有私钥

.pfx
  • 存放公钥和私钥
  • 主要用于windows平台,浏览器可以使用,也是包含证书和私钥,获取私钥需要密码才可以
.der
  • 二进制编码的证书
  • DER扩展用于二进制DER编码证书。这些文件也可能带有CER或CRT扩展名
  • 经常使用.cer用作扩展名,所有类型的认证证书和私钥都可以存储为DER格式
.pem
  • ASCII(Base64)编码的证书
  • 有类似"—–BEGIN CERTIFICATE—–" 和 “—–END CERTIFICATE—–“的头尾标记
  • PEM格式通常用于数字证书认证机构(Certificate Authorities,CA),扩展名为.pem, .crt, .cer, and .key
.cer,.crt
  • 证书文件,可以是DER编码,也可以是PEM编码。CRT是微软型式的证书