chenxin's blog

如何使得 sysctl 配置永久生效

解决方案就是:配置放到 /etc/sysctl.conf 文件中去。

2025-01-09 19:08

Unhandled exception. System.IO.IOException: The configured user limit (128) on the number of inotify instances

2025-01-06 10:51
只需要利用 timeShift 函数加上或者减去指定的时区差值就可。
2024-12-26 22:46

asp.net core 利用 systemd unit 启动,并且调用matlab 运行时,如果出现 /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.12/mclmcrrt9_8.dll: cannot open shared object file: No such file or directory,

那么在unit 文件中[service] 节设置matlab运行时环境变量即可解决,

如下:

[Service]

Environment=LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Runtime/v98/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v98/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v98/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v98/extern/bin/glnxa64

linux 下LD_LIBRARY_PATH 的说明如下:

https://blog.csdn.net/SoaringLee_fighting/article/details/78758318

2024-12-25 14:55
今天开车跟人家抢行了,还是不够稳重,开车心态有待提高,开车永远要把安全放在第一位,载着一家人,没有什么比安全更重要,该死的坏心态。
2024-12-22 13:57


asp.net core grpc server ubuntu 20.04上部署后,应用本地连接提示:

 IOException: An HTTP/2 connection could not be established because the server did not complete the HTTP/2 handshake. HttpProtocolException: The HTTP/2 server closed the connection. HTTP/2 error code 'HTTP_1_1_REQUIRED' (0xd).",

其实官方文档说了,如果不用https连接,那么必须将kestrel协议设置为http2协议。

代码如下:

builder.WebHost.ConfigureKestrel((context, serverOptions) =>

{

    serverOptions.ListenAnyIP(0, m =>

    {

        //需要将端点的默认协议设置为http2

        m.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2;

    });

});


以下内容来自asp.net core 官方文档,加粗部分就是解决上述问题的方案,有时候阅读理解官方文档真的很重要。

Protocol negotiation

TLS is used for more than securing communication. The TLS Application-Layer Protocol Negotiation (ALPN) handshake is used to negotiate the connection protocol between the client and the server when an endpoint supports multiple protocols. This negotiation determines whether the connection uses HTTP/1.1 or HTTP/2.

If an HTTP/2 endpoint is configured without TLS, the endpoint's ListenOptions.Protocols must be set to HttpProtocols.Http2. An endpoint with multiple protocols, such as HttpProtocols.Http1AndHttp2 for example, can't be used without TLS because there's no negotiation. All connections to the unsecured endpoint default to HTTP/1.1, and gRPC calls fail.

For more information on enabling HTTP/2 and TLS with Kestrel, see Kestrel endpoint configuration.


微软官方文档关于该部分内容说明:https://learn.microsoft.com/en-us/aspnet/core/grpc/aspnetcore?view=aspnetcore-7.0&tabs=visual-studio

2024-12-19 18:44

nlog 动态设置日志目录路径可以用:NLog.GlobalDiagnosticsContext.Set("logDirectory", "C:/Temp/"); 的方式,然后在nlog.config中添加 配置,然后在target引用的时候使用${gdc:logDirectory} 即可。

2024-12-18 14:07

1 docker load -i  镜像.tar 加载从windows上的压缩包出现问题时,请用 docker save -o 镜像名.tar iamge1 image2 ,也就是用-o参数。

2 docker compose 中的定义的服务镜像,统一用 docker save -o 镜像名.tar image1 image2这种形式。

3 compose.yaml 复制到linux 上后,要将应用构建的定义改为引用app镜像,和其他镜像一样。

2024-12-15 13:56
2024-12-13 07:53
{{item.shareTime}}
1 2 3 下一页 末页 共41页
正在加载,请稍后... 已经到底啦~~~
文章归档 网站地图 闽ICP备2020021271号-1 百度统计