某些时候由于nfs服务卡住或者网络问题导致umount -f也无法卸载时,可以临时使用umount -l模式完成卸载 -l, --lazy Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it […]
作者: mowblog
crc/md5/sha1碰撞数据
为了校验功能,从网上搜罗到的一组碰撞数据 crc32: b5a7b602ab754d7ab30fb42c4fb28d82 d19f2e9e82d14b96be4fa12b8a27ee9f md5: 0x0e306561559aa787d00bc6f70bbdfe3404cf03659e704f8534c00ffb659c4c8740cc942feb2da115a3f4155cbb860749738 […]
psrecord监控单个进程的cpu和内容实用情况
某些时候,我们需求有针对性的健康单个进程的cpu和内存使用情况,并且能自动绘制出折线图,这是用psrecord应该算是一个比较好的选择。 只要系统能访问pip,部署也相对比较简单 python3 -m pip install --upgrade pip python3 -m pip install matplotlib python3 -m pip install psrecord 使用方法 ps […]
Mac从x86迁移到M3平台后gcc报错“xcrun: error: unable to load libxcrun”
背景: 用迁移助理从x86迁移到M3之后,gcc返回错误: gcc -v xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): tried: '/Library/Developer/CommandLineTools/usr/ […]
wireshark获取tls协商中的证书并查看
数据流就选择有certificate标识的 导出的文件是der格式,使用openssl可以指定格式查看 openssl x509 -noout -text -inform der -in test.cer
nginx设置七层和四层代理配置模版
普通七层代理 在http层添加配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
server { listen 8080; listen [::]:8080; server_name _; root /usr/share/nginx/html; include /etc/nginx/default.d/*.conf; error_page 404 /404.html; location = /404.html {} error_page 500 502 503 504 /50x.html; location = /50x.html {} location / { proxy_pass http://10.12.1.8:8080; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { listen 8081 ssl; listen [::]:8081 ssl; server_name _; root /usr/share/nginx/html; ssl_certificate "/etc/nginx/ca.crt"; ssl_certificate_key "/etc/nginx/ca.key"; include /etc/nginx/default.d/*.conf; error_page 404 /404.html; location = /404.html {} error_page 500 502 503 504 /50x.html; location = /50x.html {} location / { proxy_pass https://10.12.1.8:8081; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } |
四层代理: 四层代理需要stream模块,默认可能没有安装,如果是centos系列,可以直接yum将所有模块都安装上 yum install nginx-all-modules 在nginx.conf最上层添加配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
stream { upstream http { server 10.12.1.8:8080; } upstream https { server 10.12.1.8:8081; } server { listen 8080; proxy_connect_timeout 3s; proxy_timeout 3s; proxy_pass http; } server { listen 8081; proxy_connect_timeout 3s; proxy_timeout 3s; proxy_pass https; } } |
vscode压缩json插件json-tools
JSON格式化:Ctrl(Cmd)+Alt+M JSON压缩:Alt+M for JSON
[转载]Python中@property和@setter的用法
原文地址:https://www.cnblogs.com/yeer-xuan/p/13488291.html 问题引出 在业务处理时经常需要在数据的读取和存入前对数据进行预处理,通过@property和@*.setter两个装饰器就可以方便的实现。 @property python中的@property装饰器可以总结为两个作用: 让函数可以像普通变量一样使用 对要读取的数据进行预 […]