Adding SSH Key Login and Troubleshooting

1. Steps to add a key 1.1 Client-side generation of ssh key There are two formats of keys: The old format, the private key starts with -----BEGIN RSA PRIVATE KEY-----. 1 ssh-keygen -m PEM -t rsa -b 4096 -C "mail@chenshaowen.com" New format, private key starts with -----BEGIN OPENSSH PRIVATE KEY-----. 1 ssh-keygen -t rsa -b 4096 -C "mail@chenshaowen.com" Since some older systems do not support the new format of the Key, it is recommended to generate the old format of the Key.

The one thing that makes React18 better than the old React

React18 has entered the RC (release candidate) phase, only one step away from the official version. Today, instead of talking about new features, we’ll talk about a detail that makes v18 better than the old version: v18 may have fewer component renders. Where does the state come from? In the following components. 1 2 3 4 function App() { const [num, update] = useState(0); // ...省略

Pulsar Repeat Consumption

I recently helped a colleague troubleshoot a problem where the same message was being consumed repeatedly when using Pulsar. Troubleshoot I was skeptical when he told me about this phenomenon, based on my previous experience with Pulsar, which is explained in the official documentation and API. Only when the ackTimeout for consumption is set and the consumption timeout is timed out will the message be recast, which is off by default and really not on by looking at the code.

Flink JobManager HA on Kubernetes

This article introduces the idea of implementing Flink’s JobManager HA on top of Kubernetes. flink 1.12 is not yet released, but we have seen this piece in the development plan. But this post is mainly about our internal implementation. 0. Flink HA HA stands for HighAvailability and is used in many distributed systems to solve the SPOF (single point of failure) problem. For example, the NameNode of HDFS, the distributed

Replace grep with ripgrep

grep is pre-installed on *nix systems and is a tool that programmers often use in their daily work. My recent work involves a lot of large text processing, and grep doesn’t work very fast. So I used ripgrep, a tool that runs much faster. This article is mainly excerpts from the use of their usual may be used. Install Just find your corresponding system command in the GitHub Repo guide

Build container images in the pipeline using the docker in pod method

docker has been criticized in the Kubernetes community for being a CRI, but it’s important to understand that CRIs are only part of docker’s functionality. There are still many areas that rely heavily on docker for local development testing or CI/CD streamline image builds. For example, docker’s official build-push-action is the preferred method for building container images on GitHub. Even docker’s rivals podman + skopeo + buildah are using docker

Redis Multi-Threaded Network Model

Redis has become the de facto standard for high-performance caching solutions in current technology selection, and as a result, Redis has become one of the basic skill trees for back-end developers, and the underlying principles of Redis are logically a must-learn. Redis is essentially a web server, and for a web server, the network model is the essence of it. If you understand the network model of a web server,

Python passed a proposal to remove "dead batteries" from the standard library

A Python Enhancement Proposal (PEP) 594, proposed by Python contributors Christian Heimes and Brett Cannon, to remove obsolete and unmaintained modules from the Python standard library, has been approved. -0594) has been approved for adoption. This proposal was originally submitted in 2019, but was only recently (March 11) approved for Python 3.11. With this PEP, Python 3.11 will mark certain modules as deprecated, and Python 3.12 will be the last release to include them.

Linux I/O Principles and Zero-copy Technology

Today’s network applications have shifted from CPU-intensive to I/O-intensive, and most of the network servers are based on the C-S model, i.e., the Client-Server model, which requires a lot of network communication between the client and the server, which also determines the performance bottleneck of modern network applications: I/O. The standard I/O interface of the traditional Linux operating system is based on data copy operations, i.e. I/O operations result in

Go's distributed transaction framework - seata

Seata Introduction Seata is a distributed transaction service open source by Ali , currently provides users with AT, TCC, SAGA, XA transaction mode , the overall use of a two-phase commit protocol. go version of seata-golang currently seems to implement only mysql AT, TCC mode , the author is not much updated now . Seata has several core roles. TC(Transaction Coordinator) - Transaction coordinator. (Maintains the state of global and

Understanding of CAP theory

One of the major difficulties in distributed systems is how to synchronize the states between nodes, and CAP is a proven law in the field of distributed systems. The meaning of each letter is as follows. Consistency Availability Partition tolerance Here we use some simple examples to illustrate. Suppose our system is composed of two services:G1 and G2. G1 and G2 maintain the same record V0. G1 and G2 can communicate with each other, and an external client (Client) can invoke either service.

A troubleshooting process for frequent crashes in a kafka cluster

Overview Some brokers in a kafka cluster will restart randomly, and there is no pattern to the restart. broker restart is not perceptible to the client side at the usage level, but there are risks in data consistency and stability. broker restart, the connections connected to this broker will be reconnected to other normal brokers, increasing the pressure on the other This increases the pressure on other brokers in the cluster.

New feature reclaims 60% of space! Your Android phone can be smoother now!!!

Today’s smartphones are carrying more and more features, and naturally users need more and more storage space. But for users with low-end phones, storage space is stretched to the limit, and they often need to uninstall apps that are already installed on their phones in order to install some new apps, thus freeing up space on their phones. Google brought the feature of uninstalling unused apps to Android a few years ago, which prompts users to uninstall apps they haven’t used in a long time to free up space when the phone is running low.

Microsoft quietly tests ads in Windows 11 File Explorer

Recently, Twitter user Florian said: Microsoft has added some ads to the File Explorer in its Windows 11 Insider preview version. As the screenshot shows, Microsoft uses such ads to promote other Microsoft products and “write confidently in documents, email and on the web with advanced writing suggestions from Microsoft Editor. The old File Explorer was already a point of criticism for Windows, and Microsoft has worked hard to improve the ease of use and appearance of its default File Explorer, such as the recently added “tabs” feature that opens multiple folder tabs like a browser.

Go Concurrency-working pool mode

I read an article earlier: Handling 1 Million Requests per Minute with Go. Today I stumbled upon another article. The principle of the two articles is similar: there are a number of work tasks (jobs), through the work-pool (worker-pool) way, to achieve the effect of multiple worker concurrent processing job. There are still many differences between them, and the differences in implementation are quite big. Here is a picture, which

Use of iota in Go

Introduction The Go language doesn’t actually have direct support for the enumeration keyword. We generally implement enumeration capabilities via const + iota. One might ask, why do we have to use enums? There is a highly rated answer on stackoverflow. 1 2 3 4 5 You should always use enums when a variable (especially a method parameter) can only take one out of a small set of possible values. Examples

How to Spoof Go Mod?

Recently I was working on cortex optimization for prometheus ecosystem, and I came across a rather interesting go mod problem, which I’ll share here. Why do I call the title: How to cheat Go mod? This is quite interesting, so I’ll sell it here, but it does break Go mod-related features. Before we start this topic, we need to briefly introduce the cortex and thanos projects. Limitations of Prometheus When it comes to business development, you can’t do without a monitoring system.

Golang interface Principle - Type Conversion

In this article, I’ll take a look at the interface from the internal degree assignment + assembly perspective, to understand how the interface works. This article will focus on type conversions and related error-prone areas. eface 1 2 3 4 5 6 func main() { var ti interface{} var a int = 100 ti = a fmt.Println(ti) } This most common code now raises some questions. How to see if ti is eface or iface ?

How Go timers are scheduled

This article breaks down the content of Go timers. Timers are an important part of business development and infrastructure development, so you can see how important they are. AfterFun to initialize a timer, the timer will eventually be added to a global timer heap, which is managed by Go runtime. The global timer heap has undergone three major upgrades. Before Go 1.9, all timers were maintained by a globally unique

A simple analysis of how the ElasticSearch Operator works

ElasticSearch Operator The core features of the current ElasticSearch Operator. Elasticsearch, Kibana and APM Server deployments TLS Certificates management Safe Elasticsearch cluster configuration & topology changes Persistent volumes usage Custom node configuration and attributes Secure settings keystore updates Installation Installing ElasticSearch Operator is very simple, based on ‘all in one yaml’, quickly pulling up all the components of Operator and registering the CRD. 1 kubectl apply -f https://download.elastic.co/downloads/eck/1.1.2/all-in-one.yaml CRD Operator has registered three main CRDs: APM, ElasticSearch, Kibana.