Hunter的大杂烩 技术学习笔记

2019-12-09

Python 记录log中文报错IOError: [Errno 0] Error

Filed under: 技术话题 — hunter @ 11:56 pm
  1.  WINDOWS下命令行执行报错,可以输入以下2条命令解决
chcp 65001
set PYTHONIOENCODING=utf-8
  1. 写日志时报错,说明变量有些字符是utf8,可以用下面方法解决

logging.error(“some log:” + unicode(input, ‘utf-8’))

2019-12-01

免费APACHE SSL证书安装

Filed under: 技术话题 — hunter @ 3:41 pm

参考:
https://letsencrypt.org/zh-cn/getting-started/
https://www.cnblogs.com/stulzq/p/8628163.html


yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
yum install certbot python2-certbot-apache
certbot certonly -d 你的域名 -d *.你的域名 --manual --preferred-challenges dns

(more…)

2019-11-30

apache安装ssl证书

Filed under: 技术话题 — hunter @ 11:13 pm

从证书服务商得来的压缩包里,只有一个公钥crt和一个证书链文件,缺少私钥key文件,百思不得其解,最后只能自己手动在服务器上生成一个csr和key文件,重新向证书服务商请求Rekey,用新得来的crt文件配置上apache了:

[code language=”bash”]
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
[/code]

2019-11-29

新mysql安装参数

Filed under: 技术话题 — hunter @ 10:40 pm

mysqld –initialize-insecure -u mysql

2019-11-16

不同进程操作共享内存内数据指针的三种方法

Filed under: 技术话题 — hunter @ 11:25 pm

一、参考IBM方式,重载new方法,见:https://www.ibm.com/developerworks/cn/linux/l-shared/index.html
二、类似IBM,自定义new方法的alloc参数,自定义内存分配,
译文参见:http://www.cppblog.com/doing5552/archive/2010/07/24/121197.aspx
原文:http://www.ddj.com/cpp/184401639
三、高大上用BOOST
参见:http://lday.me/2017/12/17/0019_boost_share_memory_ipc/

« Newer PostsOlder Posts »

Powered by WordPress