2022年9月21日

systemd 自定义开机启动服务

摘要: # 对于那些支持 Systemd 的软件,安装的时候,会自动在/usr/lib/systemd/system目录添加一个配置文件。(以httpd.service为例) systemctl enable httpd # 上面的命令相当于在/etc/systemd/system目录添加一个符号链接,指向 阅读全文

posted @ 2022-09-21 16:48 Karlkiller 阅读(339) 评论(0) 推荐(0) 编辑

2021年9月5日

error: object file .git/objects/...

摘要: cd .git find . -type f -empty -delete -print tail -n 2 .git/logs/refs/heads/master git show xxxx(版本号) git update-ref HEAD xxxx(版本号) git fsck 以上步骤执行完后, 阅读全文

posted @ 2021-09-05 04:27 Karlkiller 阅读(190) 评论(0) 推荐(0) 编辑

2021年7月22日

python3 用multiprocessing模块传递多个参数

摘要: from datetime import datetime from time import sleep import numpy as np import multiprocessing # from multiprocessing.dummy import Pool as ThreadPool 阅读全文

posted @ 2021-07-22 15:45 Karlkiller 阅读(739) 评论(0) 推荐(0) 编辑

2021年6月29日

python3 多线程

摘要: from multiprocessing import Pool def f(x): sleep(1) print(1) sleep(1) print(2) return x*x if __name__ == '__main__': plist = [1, 2, 3, 4, 5, 6] with P 阅读全文

posted @ 2021-06-29 17:24 Karlkiller 阅读(31) 评论(0) 推荐(0) 编辑

2021年6月10日

python3 spider [ urllib.request ]

摘要: # # 导入urllib库的urlopen函数 # from urllib.request import urlopen # # 发出请求,获取html # html = urlopen("https://www.baidu.com/") # # 获取的html内容是字节,将其转化为字符串 # ht 阅读全文

posted @ 2021-06-10 16:00 Karlkiller 阅读(45) 评论(0) 推荐(0) 编辑

2021年5月11日

ubuntu 20.04 发邮件配置

摘要: 安装sendmail后,发邮件一直没有成功,因此卸载sendmail后,安装heirloom-mailx。 # unbuntu 18.04和20.04移除了heirloom-mailx,需要另外配置软件源 vim /etc/apt/sources.list # 加入 deb http://cz.ar 阅读全文

posted @ 2021-05-11 16:15 Karlkiller 阅读(1998) 评论(0) 推荐(0) 编辑

2021年4月24日

English learning

该文被密码保护。 阅读全文

posted @ 2021-04-24 14:44 Karlkiller 阅读(0) 评论(0) 推荐(0) 编辑

2021年4月23日

python获取邮件信息

摘要: 在项目的Terminal中注册模块pypiwin32 python -m pip install pypiwin32 import win32com.client outlook = win32com.client.Dispatch("Outlook.Application").GetNamespa 阅读全文

posted @ 2021-04-23 15:36 Karlkiller 阅读(257) 评论(0) 推荐(0) 编辑

2021年4月7日

python 函数装饰器

摘要: # 使用一个函数来装饰另一个函数,不使用@ def a_new_decorator(a_func): def wrapTheFunc(): print("Do sth. before a_func()") a_func() print("Do sth. after a_func()") return 阅读全文

posted @ 2021-04-07 11:15 Karlkiller 阅读(48) 评论(0) 推荐(0) 编辑

2021年4月1日

Abbreviation

摘要: CSPF, Cross-Site Request Forgery, 跨域请求伪造 CGI, Common Gateway Interface, 通用网关接口 WSGI, Python Web Server Gateway Interface, Web服务器网关接口 【基于http协议,不支持WebS 阅读全文

posted @ 2021-04-01 14:27 Karlkiller 阅读(275) 评论(0) 推荐(0) 编辑

导航