- install dependencies
- yum install nginx
- yum install wget
- open firewall
- firewall-cmd –permanent –zone=public –add-port=http/tcp
- firewall-cmd –permanent –zone=public –add-port=https/tcp
- firewall-cmd –reload
2020-04-22
install v2ray at centos8
2020-04-11
build php 5.6 in cenos 7
[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]
依赖项:
2020-04-09
sed 正则表达式处理 json数据
有类似如下的单行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]
2020-03-18
Python 2.7下的非阻塞tcp client实现
因为要实现一个简单的网络服务性能测试工具,需要衡量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
2020-03-13
华硕梅林版下载大师与entware冲突的问题
路由器内自带的APP(比如下载大师)使用的是asusware套件,该套件安装到u盘后,会建立软链到 /tmp/opt ,而entware也要占用/tmp/opt 入口,所以两者不能同时安装。
如果不小心安装了APP,导致/tmp/opt 入口被 asusware占用,可以手动修改/jffs/addons/diversion/mount-entware.div 文件的24和26行:
[code lang=”bash”]
if [ "$opkgFile" ] && [ ! -f /opt/bin/opkg ]; then
mount_entware $1
elif [ "$opkgFile" ] && [ -f /opt/bin/opkg ]; then
logger -t Entware "Not starting Entware services on $1, Entware is already started"
[/code]
确保entware初始化时,能覆盖掉asusware的入口