● stackexchange.redis 抛出timeout异常
前言
最近在用.Net Core 做业务模块时,发现经常会出现TimeOut 超时的情况。然后看了官方的解释,说2.0版本之后维护了一个专用的线程池。我就打算阅读源码,看一下这个线程池的实现。
Read more →凡是过往,皆为序章。
最近在用.Net Core 做业务模块时,发现经常会出现TimeOut 超时的情况。然后看了官方的解释,说2.0版本之后维护了一个专用的线程池。我就打算阅读源码,看一下这个线程池的实现。
Read more →var culture = CultureInfo.CreateSpecificCulture("zh-CN");
var dateformat = new DateTimeFormatInfo
{
ShortDatePattern = "yyyy-MM-dd",
LongDatePattern = "yyyy-MM-dd hh:mm:ss"
};
culture.DateTimeFormat = dateformat;
var supportedCultures = new[]
{
culture
};
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture(culture),
SupportedCultures = supportedCultures,
SupportedUICultures = supportedCultures
});
Here is a working solution:
// main.js
ipcMain.on('open-file',(event,data)=>{
dialog.showOpenDialog(null, data).then(filePaths => {
event.sender.send('open-file-paths', filePaths);
});
});
// pager.js (render)
ipcRenderer.send('open-file',{
title: 'Title',
defaultPath: localStorage.getItem('defaultPath')
});
ipcRenderer.on('open-file-paths',(event,data)=>{
console.log(`Canceled? ${data.canceled}`);
console.log(`File Paths: ${data.filePaths.join(';')`);
});
From: https://stackoverflow.com/questions/70331707/how-do-i-use-showopendialog-withe-electron-s-ipc
因为最近工作量不是很大,所以开始对以前的项目进行优化升级,比如:「公司核心系统内存泄露排查」和一个本地备份工具(本地拖回服务器的备份进行再次备份),下图所示:
完成这些之后,又是一阵空虚。突然想起2021年春节后,公司做了一个xxx小车项目,当时遇到一个问题一直困扰着我。直到拿到公司一块RK3568开发板做测试,才解开这一年的疑惑(其实也应该怪自己抠门,贪便宜买了树莓派ZERO W的板子,没买带网口的树莓派4B)。
Read more →之前写了个系统监控的程序,在某次升级一个项目后,每隔2个月左右会收到服务器的监控提醒,使用top
命令查询发现一个核心asp.net core web api内存异常。
Raspberry Pi Zero W吃灰有一段时间了,想着能否废物利用,使用普通USB摄像头改成一个RTSP协议网络摄像头。
查看是否已识别USB摄像头:
lsusb -t
安装luvcview:
sudo apt-get install luvcview
Read more →
文章索引:
微信支付服务商(一、踩坑记录)
微信支付服务商(二、分账功能)
详细步骤可以参考接入流程: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter7_1_2.shtml
Read more →直播服务普遍采用了RTMP作为流媒体协议,FLV作为封装格式,H.264作为视频编码格式,AAC作为音频编码格式。FLV是RTMP使用的封装格式,H.264是当今实际应用中编码效率最高的视频编码标准,AAC则是当今实际应用中编码效率最高的音频编码标准。
RTSP无法直接在web端播放,需要转成RTMP。用到的摄像头为海康威视球形摄像头,型号DS-IPC-T11-1:
Read more →在face/FaceHelper.java
里看到这句:
public static final KFFaceM mFace = new KFFaceM();
public boolean FaceDetection(byte[] bArr, int i, int i2) {
synchronized (this.objectFaceDetection) {
if (bArr == null) {
return false;
}
ByteBuffer order = ByteBuffer.allocateDirect(3686400).order(ByteOrder.nativeOrder());
order.put(bArr);
float[] FindFace = mFace.FindFace(order, i, i2, true);
return FindFace.length > 1 && ((int) FindFace[0]) > 0;
}
}
Read more →
新增的忽略文件没有生效,是因为git是有缓存的,而之前的文件在缓存中,并不会清除掉,还会继续提交,所以更新.gitignore文件,要清除缓存文件
git rm -r --cached .
git add .
git commit -m 'update .gitignore'
在升级GitLab后,进行gitlab-ctl reconfigure的时候,碰到问题:
bash[migrate gitlab-rails database] (gitlab::database_migrations line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
Read more →
I got the whole thing up and running in debug. But when I went for our dotnet run, I got the following crash:
The type initializer for 'Gdip' threw an exception.
Read more →
第一次做安卓开发,研究mqtt通讯的APP debug过程中遇到提示:
W/System.err: MqttException (0) - java.net.SocketException: socket failed: EACCES (Permission denied)
Read more →
Error: Failure while executing; 'git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask' exited with 128.
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew update
如果还没解决,参考:https://blog.csdn.net/DuXiaoYu1111/article/details/114663146
Python安装支持库的过程中经常会遇到“Microsoft Visual C++ 14.0 is required”或者“unable to find vcvarsall.bat”的问题,安装vc++ 运行库无效
,此时就需要安装Visual C++ build tools生成工具,下载链接。但该安装包为在线安装包,安装过程需要连接网络下载完整安装包,在没有网络连接的环境下无法使用。
公司需要注册几个小程序,注册小程序需要邮箱,腾讯企业邮箱新账户需要绑定手机号和个人微信,不适合批量使用。昨天用turbomail搭建了邮件服务,功能很强大,但仅限于windows。因某些原因,服务器操作系统今天上午更改为Linux,所以需要重新搭建一套邮件服务。
Read more →调用学习完成的图像识别模型,通过摄像头实时监测识别结果,客户端显示识别结果并做提醒预警。
软件需要运行在Ubuntu Desktop 16.04,要么选择跨平台应用,要么选择html纯静态页面作为客户端。
1、上述语言目前我都完全不掌握😢 2、项目不是公司的主要方向,学习技术成本过高,用完后很可能会丢弃,没有学习的必要。
综上,在目前掌握的技术栈里,选择相应的技术是最快速、稳妥的方案。
Read more →Want to delete Microsoft AutoUpdate from a Mac? Perhaps you uninstalled Microsoft Office or some other Microsoft applications from the Mac and thus have no further need for Microsoft applications to automatically update themselves. In any case, you can remove the Microsoft AutoUpdate application from Mac OS.
Read more →对山东某充电桩服务的逆向分析(一) 对山东某充电桩服务的逆向分析(二)
上文中「猜测1」对「充电桩同时使用TCP和MQTT」描述不是很详细,现说明如下: 服务端中运行test.proc.CmdRecvBusiProcessor、test.server.ServerHandler、test.service.KafkaProducer等至少3个服务。
Read more →注:本文只是通过充电桩项目log里的服务包名对整体IoT服务进行技术猜想,可能与实际服务差距特别大。就像只知道某地铁站A为已知某节点,去猜测整个地铁线路一样,只是理想状态,实际可能会因为各种需求,做出很多妥协和改变。
对山东某充电桩服务的逆向分析(一) 对山东某充电桩服务的逆向分析(二)
Read more →服务 CPU 或 内存偶尔飙高是部署环境中经常遇到的问题,一般会采用记录日志的方式来诊断,不过有些情况靠日志可能并不能分析出个所以然,面对实在无头绪的问题也只能暂时使用重启大法先恢复。
为了尽可能精准的定位问题,掌握通过 dump 分析服务运行堆栈信息也是非常必要的,本文将分别介绍如何对 .NET Core 2.2 和 .NET Core 3.1 项目进行 dump 分析(这里只针对 Linux 下使用容器部署的方式)。
Read more →今天测试.net core 2.2到3.1时,顺便更新了EPPlus版本。导出excel时报错:
2021-03-31 20:51:27,481 [5] ERRORStaffController - OfficeOpenXml.LicenseException: Please set the ExcelPackage.LicenseContext property. See https://epplussoftware.com/developers/licenseexception
at OfficeOpenXml.ExcelPackage.get_Workbook()
at OfficeOpenXml.ExcelPackage.CreateBlankWb()
at OfficeOpenXml.ExcelPackage.ConstructNewFile(String password)
at OfficeOpenXml.ExcelPackage..ctor(FileInfo newFile)
at PartnerPlatform.Service.StaffExport.ExportExcelSingleWorksheets(IDbConnection dbConnection, String sWebRootFolder, String fileName, List`1 staff) in /Users/jinyazhou/Test/PartnerPlatform/Service/ExcelExport.cs:line 43
at PartnerPlatform.Controllers.StaffController.Export() in /Users/jinyazhou/Test/Controllers/ExcelController.cs:line 19
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.13/System.Runtime.Serialization.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
原因: EPPlus 5.0 以后的版本需要指定 商业证书 或者非商业证书。你需要在代码里指定证书或者降低EPPlus版本。在代码里面指定非商业证书:
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
How do I configure Apache HTTPD to listen on multiple ports under RHEL / Fedora / CentOS Linux Server?
Multiple ports can be configured via Listen directive under Apache web server. By default httpd listens on TCP port 80.
How to configure httpd to listen multiple ports? Open configure file /etc/httpd/conf/httpd.conf and modify the Listen directive tells the server to accept incoming requests on the specified port. Multiple Listen directives may be used to specify a number of ports to listen to.
Read more →进入桌面找到并连接WiFi。如果频繁断开或者无法连接,运行:
sudo systemctl restart dhcpcd.service
sudo systemctl restart networking.service
sudo reboot
Read more →
目前个人网站是使用MWeb写作,然后生成本地html,使用GoodSync通过FTP把本地html同步到网站服务器。
GoodSync功能强大,但是收费软件,过试用期会定期弹窗,且免费版不能同步超过100个文件。
所以我尝试自己写一个同步软件,满足以下功能即可:
未雨绸缪,公司IoT项目中可能会出现的情况:
自2018年7月起,谷歌浏览器开始将“ HTTP”网站标记为“不安全”。在过去的几年中,互联网已经迅速过渡到HTTPS,Chrome浏览器的流量超过70%,并且Web排名前100位的网站中有80多个现在默认使用HTTPS 当前Nginx作为最常见的服务器,广泛用于负载均衡(LB)、网关、反向代理。考虑到这一点,让我们看一下Nginx调优技巧,改善Nginx + HTTPS的性能以获得更好的TTFB和更少的延迟。
Read more →Unable to bind to https://localhost:5001 on the IPv4 loopback interface: 'HTTP/2 over TLS is not supported on macOS due to missing ALPN support.
Nginx是一款开源代码的高性能HTTP服务器和反向代理服务器,同时支持IMAP/POP3/SMTP代理服务
Nginx由内核和模块组成,完成工作是通过查找配置文件将客户端请求映射到一个location block(location是用于URL匹配的命令),location配置的命令会启动不同模块完成工作。
Read more →本文是Redis集群学习的实践总结(基于Redis 6.0+),详细介绍逐步搭建Redis集群环境的过程,并完成集群伸缩的实践。
##Redis集群简介 Redis集群(Redis Cluster) 是Redis提供的分布式数据库方案,通过 分片(sharding) 来进行数据共享,并提供复制和故障转移功能。相比于主从复制、哨兵模式,Redis集群实现了较为完善的高可用方案,解决了存储能力受到单机限制,写操作无法负载均衡的问题。
Read more →FastDFS is an open source high-performance Distributed File System. It manages files. Its main functions include: file storage, file synchronization, file access (file upload, file download), etc. It mainly solves the problem of massive data storage, especially for small and medium-sized files (recommended range: 4KB < file)_ Size < 500MB).
FastDFS system has three roles: tracker server, storage server and client.