Hunter的大杂烩 技术学习笔记

2020-04-22

安装 python的 Windows嵌入版本

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

参考:https://dev.to/fpim/setting-up-python-s-windows-embeddable-distribution-properly-1081

 

理论上嵌入式版本不能单独作为运行环境,但是本人一向不喜欢安装.exe,怕环境被污染,参考网上一些文章之后,初步能运行起来,还未详细调试

(more…)

install v2ray at centos8

Filed under: 技术话题 — hunter @ 8:28 pm
  1. install dependencies
    1. yum install nginx
    2. yum install wget
  2. open firewall
    1. firewall-cmd –permanent –zone=public –add-port=http/tcp
    2. firewall-cmd –permanent –zone=public –add-port=https/tcp
    3. firewall-cmd –reload

(more…)

2020-04-11

build php 5.6 in cenos 7

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

[code language=”bash”]

LDFLAGS=’-lfreetype’ CFLAGS="-O3 -I/usr/include/freetype2" CXXFLAGS="-O3 -I/usr/include/freetype2" ./configure \
–with-apxs2=/usr/local/httpd24/bin/apxs –prefix=/usr/local/php –with-zlib –with-gd \
–enable-mbstring –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config\
–with-pdo-mysql=/usr/local/mysql –with-config-file-path=/usr/local/php –with-iconv –with-libxml-dir –with-png-dir \
–with-freetype-dir –with-openssl –with-curl

[/code]

依赖项:

(more…)

2020-04-09

sed 正则表达式处理 json数据

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

有类似如下的单行json数据,希望提取其中的 add 字段

[code language=”json”]

[{”:False,’host’:”,’path’:”,’id’:’replace_yourself’,’tls’:”,’v’:’2′,’net’:’tcp’,’add’:’1.1.1.1′,’type’:’none’},{”:False,’host’:”,’path’:”,’tls’:”,’id’:’replace_yourself’,’v’:’2′,’aid’:’2′,’net’:’tcp’,’add’:’2.2.2.2′,’type’:’none’}]

[/code]

(more…)

2020-03-18

Python 2.7下的非阻塞tcp client实现

Filed under: 技术话题 — hunter @ 5:05 pm

因为要实现一个简单的网络服务性能测试工具,需要衡量TCP CONNECT环节耗时,发现目前网上对于python 2下的非阻塞connect/send/recv介绍很少,于是自己实现了一个

参考:

https://docs.python.org/2/howto/sockets.html#sockets

https://docs.python.org/2/howto/sockets.html#non-blocking-sockets

https://learnku.com/docs/pymotw/select-wait-for-io-efficiently/3429

https://stackoverflow.com/questions/8277970/what-are-possible-reason-for-socket-error-einprogress-in-solaris

https://www.cnblogs.com/MnCu8261/p/6403340.html

https://gist.github.com/hduffddybz/daa4c931f6ea0bd7ed93

(more…)

« Newer PostsOlder Posts »

Powered by WordPress