python打包器
访问 `https://pypi.org/project/pyinstaller/#files` 下载 Python 3 Windows x86-64
pip install pyinstaller-6.14.1-py3-none-win_amd64.whl
打包对应的文件, 注意没有图标就移除图标参数, 不然打包后的程序无法使用
pyinstaller --onefile --windowed --icon=icon.ico uncode_vwechat.py 访问 `https://pypi.org/project/pyinstaller/#files` 下载 Python 3 Windows x86-64
pip install pyinstaller-6.14.1-py3-none-win_amd64.whl
打包对应的文件, 注意没有图标就移除图标参数, 不然打包后的程序无法使用
pyinstaller --onefile --windowed --icon=icon.ico uncode_vwechat.py # 关闭gzip
gunzip on;
gzip_disable ".";
# 转发内容全局替换
proxy_redirect off;
sub_filter_once off; # off为多次替换,默认值为on仅仅替换一次
sub_filter_types *; # 替换的content-type类型
sub_filter "hometree-ts.oss-cn-shanghai.aliyuncs.com" "hometree-ts.oss-accelerate.aliyuncs.com";
sub_filter "oss-ts.jiayuanshu.net" "hometree-ts.oss-accelerate.aliyuncs.com";
sub_filter "hometree.oss-cn-shanghai.aliyuncs.com" "hometree.oss-accelerate.aliyuncs.com";
sub_filter "oss.jiayuanshu.net" "hometree.oss-accelerate.aliyuncs.com";
sub_filter "hometree.oss.jiayuanshu.net" "hometree.oss-accelerate.aliyuncs.com";
sub_filter 指令
sub_filter string replacement。将string替换成replacement,不区分大小写。
sub_filter_last_modified on | off。默认:off,防止缓存。是否在Response header中写入Last-Modified,控制缓存。
sub_filter_once on | off。默认: on,只执行一次。sub_filter指令是执行一次,还是重复执行。
sub_filter_types mime-type …。默认: text/html。指定类型的MINE TYPE,如果所有类型,则使用:*。location /online_api1/ {
proxy_set_header Authorization 'Bearer eyJ0eXJ9.eyJpc3MiiA';
proxy_pass https://api.test.cn/;
} # 访问 /*/aaa 实际请求 http://localhost:9501/aaa
location /abcd/ {
proxy_pass http://localhost:9501/;
}
location ~ /abcd(/|$)(.*) {
proxy_pass http://localhost:9501/$2;
}
# 访问 /*/aaa 实际请求 http://localhost:9501/aaa
location ~ /[a-z_0-9]+(/|$)(.*) { # 为列出来的都转发到该接口
if ($query_string = ''){
proxy_pass http://t.wuloves.com/$2;
}
proxy_pass http://t.wuloves.com/$2?$query_string;
}location ^~ /abc {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8081/;
}location /callback/ {
proxy_pass http://www.baidu.com/;
}
# 网上有人说https协议不能访问, 测试实际访问是http, 配置中转发到https转发正常, 同样实际测试转发的域名是无法将域名替代为ip通过https访问的
# 当前被访问的为https未测试
location /https/ {
proxy_pass https://www.baidu.com/;
}
# 重点,转发websocket需要的设置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $connection upgrade; auto_start_nginx.bat 并放入启动目录taskkill /f /im nginx.exe
d:
cd "D:\s\nginx-1.18.0\"
start "" "nginx.exe"hide_php_cgi.bat 并放入启动目录set ws=WScript.CreateObject("WScript.Shell")
ws.Run "D:\s\php\php-cgi.exe -b 127.0.0.1:9000",0taskkill /f /im nginx.exe
nginx.exe .
├── Dockerfile
│ └── config
│ └── swoole_tracker.ini
├── swoole_tracker74.so
├── push_docker.sh 编译并推送镜像
└── run_dockerfile.sh 编译并运行
DockerfileFROM hyperf/hyperf:7.4-alpine-v3.13-swoole
# FROM hyperf/hyperf:8.0-alpine-v3.13-swoole
# COPY config /var/www/config
# RUN rm /etc/php7/php.ini -f && ln -s /var/www/config/php.ini /etc/php7/php.ini
# ADD swoole_tracker74.so /usr/lib/php7/modules/swoole_tracker.so
# COPY config/swoole_tracker.ini /etc/php7/conf.d/98_swoole_tracker.ini
COPY composer.phar ./
# RUN wget https://www.wuloves.com/d/composer.phar && chmod u+x composer.phar \
# RUN wget https://wuloves.oss-cn-shanghai.aliyuncs.com/d/composer.phar \
RUN chmod u+x composer.phar \
&& cp composer.phar /usr/local/bin/composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer \
&& composer -v
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ gnu-libiconv=1.15-r3
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
push_docker.sh#!/bin/bash
pwd
docker login --username=root --password=123456 registry.cn-shanghai.aliyuncs.com
docker build -t hyperf:v20220406 .
docker tag h4 registry.cn-shanghai.aliyuncs.com/wuloves/hyperf-report:1.0
docker push registry.cn-shanghai.aliyuncs.com/wuloves/hyperf-report:1.0run_dockerfile.sh#!/bin/bash
pwd
# 构建镜像
docker build -t h4 .
# 启动镜像
docker run -v /data:/data -p 9501:9501 -it h4swoole_tracker.ini[swoole_tracker]
extension=swoole_tracker.so
;打开总开关
apm.enable=0
;采样率 例如:100%
apm.sampling_rate=100
;开启内存泄漏检测时添加 默认0 关闭状态
apm.enable_memcheck=1
;Leak检测开关
apm.enable_malloc_hook=1 # 查询当前全局配置, 尝试修改全局配置, 如果没有全局配置权限, 可以修改当前连接的配置
SELECT @@global.group_concat_max_len;
SET GLOBAL group_concat_max_len=102400;
SET group_concat_max_len=1024;