All Posts

How Go implement ReadWrite Deadline In TCP

When writing Go networking applications, there is a series of TCP connection methods that I use a lot: `SetDeadline`, `SetReadDeadline`, `SetWriteDeadline`. Their purpose is to wait for a read or write operation on a TCP connection, and if there is no read or write operation at the preset time point, the read method will ErrDeadlineExceeded` error, which is often used to determine if a connection has been lost. In this article, I'll describe how to use them and how Go implements them, and try to achieve a similar effect in C++.

Socket.IO Small Bug Introduce

Recently I took over a Web push gateway, the main function is actually through the Socket.IO protocol to receive the connection of the front-end, and then push the message to the corresponding front-end, however, during the debugging, we meet a issue that cann't connected successfully, and here we do a summary.

How to hide a linux process

Recently I came across a project: libprocesshider, which can be used to hide a Linux process, and for curious, I tried it out and found that it involves a few interesting points, so I’ll document it.

Edit Videos with FFMPEG

Often when watching or processing video, I have small, simple needs, such as intercepting a certain period of the video, or splitting a video into multiple videos according to the number of matches, because this need is so simple, it is not cost-effective to install a video processing software. So I tried to learn how to use it to process a simple video, and this article summarises the commands I used.

Go framework Gin: HTTP Handling

Gin is a popular HTTP framework and is used by a lot of people, but it is actually simple enough that there isn't much to say about it. However, although there is not much to talk about, there are some descriptions and ideas worth mentioning, and this is the first in a series of articles that will focus on how Gin handles HTTP requests. Since Gin essentially extends the native HTTP Server, there is not much to cover in terms of the network model, so this article focuses on some of Gin's main data structures and how they fit in with the native HTTP Server.

How Golang Detect Data Race

Yes, I do mean race, not static, and Go is popular for its simplicity and great concurrent development experience, but we often write code that has Data Race in it, but Go can often help us check it out, and this article will try to describe how Go does it.

Install/Configure Prometheus and Grafana

Because I am already familiar with Prometheus, some of my server software and small applications are usually monitored through Prometheus. I often build Prometheus environments, but I don't have a summary of them, so I need to run to various places to find the configuration (systemd, prometheus, nginx configuration, etc.). So recently I had a new environment and needed to rebuild it, so I took the opportunity to document the process of installing and configuring prometheus and grafana. Translated with (free version)

CentOS Install Node Exporter

Node Exporter is so widely used, but it doesn't seem to offer automatic installation by Yum, so here's how to install Node Exporter manually under CentOS and manage it with Systemd.

Alist Install and Usage

I recently saw someone introduce alist and found it to be a good option for building your own NAS, then I tried it on my own storage machine, and the features were fine, but some of the details were still rather wild.

Upgrade CentOS 8 Kernel

I previously wrote about upgrading the kernel on CentOS 7, but some of the actions no longer work on CentOS 8, so I’m putting together another version on CentOS 8.