Another Linux-based operating system comes to the Microsoft Store

The AlmaLinux OS Foundation has made AlmaLinux available on the Microsoft Store and users can install AlmaLinux on Windows based on WSL. AlmaLinux is an open source, community-driven project compiled from the source code of Red Hat Enterprise Linux (RHEL).AlmaLinux is fully binary compatible with RHEL 8 and was built by the creators of CloudLinux OS.The AlmaLinux team is committed to making the AlmaLinux operating system available for free, forever. The project is permanently open source without any restrictions, without any fees, and is supported until 2029.

Machine learning environment build: WLS2+Ubuntu+CUDA+cuDNN

I recently bought a new laptop, and the first thing I had to do after getting the computer was to configure the machine learning environment. Some mistakes were made in the middle, so they were sorted out for those who might need them. Installing Windows Subsystem WLS2 The main reasons for updating from WSL 1 to WSL 2 include improved file system performance. Support for full system call compatibility. WSL

Flutter/Layout: Thoroughly figure out how Align is aligned

We will often use the Align component in our development to position the child components. Usually we use several common relative positions, such as alignment: Alignment.bottomRight, bottom-right corner. Recently, the official documentation about alignment: Alignment(x, y) in Align seems to be a little bit wrong, and then combined with the relevant source code, we finally figured it out. Then I found that most of the tutorials on the Internet are wrong, so I’ll share my understanding of Align’s alignment principle below.

An HTTP application running on Kubernetes

As Kubernetes becomes more and more functional and code-heavy, it may become relatively more complex. I sometimes wonder what users of Kubernetes should care about and what they should not care about. For a newbie, the first thing you should do when starting out is to figure out the basic workflow. Of course, if you look directly at the Kubernetes documentation, there are a lot of dazzling concepts that can be confusing and confusing.

Kubernetes External Service Mapping

Applications within a cluster sometimes need to invoke external services, and we know that internal service invocations within the cluster are accessed through Service, so is it possible to keep using Service uniformly for external services as well? The answer is yes, accessing external services through Service can bring other benefits besides the unified way. For example, if the same application in different environments (spaces) accesses the external database in different environments, the configuration of both sides can be unified through Service mapping, so that different applications in different spaces can access different external databases through the same Service Name.

Customizing Kubernetes CRD

1. Theoretical Overview We know that Kubernetes provides a CRD mechanism to scale resources, and in some scenarios we can use CRD to scale resources stored through Kubernetes, i.e., use Kubernetes as storage. According to the official statement CRD + Controller = Operator, kubebuilder can generate such a code framework, and can be customized to generate Controller or not. The client-related code can be generated by code-generator, which generates informer,

Kubernetes Access Control

As shown above, this is a typical Kubernetes cluster component diagram, through which we can see that all Kubernetes components use APIServer as a gateway to communicate. For security purposes, the APIServer is generally exposed to the public through TLS authentication, and cluster components need the corresponding TLS certificate to access the APIServer. The following figure shows the access control process of the APIserver. The complete access control requires three

Pathlib Tutorials

For Python based file, directory and path operations, we generally use the os.path module. pathlib is its replacement, which is a wrapper around os.path, objectizing paths, making the api more general, easier to use, and more in line with programming habits. The pathlib module provides a number of classes that use semantic representation of file system paths, which are suitable for a variety of operating systems. The path classes are

Time zones in Django

Django’s settings configuration has a USE_TZ item with a default value of True. Many people are not quite sure what this configuration item does, except that it has to do with time zones. Let’s talk about it in detail. First, we need to understand what offset-aware and offset-navie are. offset-aware and offset-navie In Python, there is a datetime module that I’m sure you’re familiar with. But few people know that this module’s time can also be divided into the following two types.

A confusing piece of code that uses the walrus operator

It’s interesting to share an example of using walrus operators that I saw on Twitter, the code looks like this: 1 2 3 4 >>> (a := 1) >>> (a, b := 2, 3) >>> print(f'a={a}, b={b}') a=1, b=2 The sentence (a, b := 2, 3) is particularly confusing, especially if you’ve written Go, and it’s likely that you intuitively think this expression is fine. But you can see through

The best way to use pip

A while back, Ned Batchelder, a well-known Python developer, posted a tweet on twitter that sparked a lively discussion: That is, instead of using pip install, use python -m pip install to install the package. Both beginners and experienced developers encounter this problem. It can be confusing when you install a package using pip, but when you call it, it says you can’t import it: for newcomers you’ve probably read some old tutorials, for veteran developers you’re probably still used to the old way of using it.

Python converts dictionaries to member variables

When we write a class in Python, how do we do it if some of the member variables need to be named and assigned with a dictionary? This scenario is most common when reading a dictionary variable from a file (such as json, npz, etc.) into memory and assigning it to a class member variable, or an instance variable that has been generated. Defining member variables with dict The method __dict__.

Python3 Accessing and Modifying Local Variables via Strings

When a function is defined in Python, the variable space is divided into global and local variables. If it is defined in a member function of a class, then there is additional member variable (self) space. So, is there a way to separate these different variable spaces if you want to do it in practice? Reading and modifying local variables First, let’s look at reading local variables. There are generally locals(), vars() and sys.

Principle of Go channel

Section1 channel use 1.1 make channel A channel with cache and a channel without cache are created as follows. 1 2 3 4 // buffered ch := make(chan Task, 3) // unbuffered ch := make(chan int) buffered channel If we create a channel with a buffer, the underlying data model is as follows. When we write data to the channel, it will be directly stored in the circular queue(send). When

Golang's memory allocation

The Go language has a built-in runtime (that is, runtime) that abandons the traditional way of allocating memory in favor of autonomous management. This allows for autonomous implementation of better memory usage patterns, such as memory pooling, pre-allocation, etc. This way, you don’t need to make a system call for every memory allocation. The Golang runtime memory allocation algorithm is derived from Google’s TCMalloc algorithm for C. The core idea

Golang Escape Analysis

Golang’s garbage collection mechanism allows automatic memory management to make our code cleaner and less likely to leak memory. However, the GC periodically stops and collects unused objects, so it still adds overhead to the program. The Go compiler is smart enough to decide, for example, whether a variable needs to be allocated on the heap or the stack, and unlike an allocation on the heap, a variable on the stack is reclaimed at the end of the function that declared it.

Govc User Guide

I recently needed to do some parameter configuration, virtual switch/net creation, virtual machine creation, VIB installation, PCI direct access, virtual machine creation, etc. on ESXi host for work reasons. So I took the time to sort out some of the pitfalls I encountered while using govc. govc govc is a wrapper implementation of the official VMware govmomi library. It can be used to perform a number of operations on ESXi

Golang's efficient string concatenation method

String concatenation is indispensable in everyday coding, and the most commonly used is the native concatenation method (+=). However, its performance is fine for a small number of splices, but for a large number of string splices, other more efficient methods should be used. This article first lists several string concatenation methods commonly used in Golang, and then benchmarks them, so that after reading this article, we can have a basic understanding of the applicability of various concatenation methods.

Compile and install PostgreSQL on CentOS

PostgreSQL is an open source Object-Relational Database Management System (ORDBMS), based on the original POSTGRE source code from the University of California, Berkeley, which supports most SQL standards and offers many modern features. PostgreSQL uses a C/S architecture. The server-side process (called postgres) manages the database files, receives connections from the client, and performs database operations on behalf of the client; the client-side process initiates connections to the server and

Golang entity framework Ent supports distributed database TiDB

Recently, Facebook’s open source Golang entity framework, Ent, completed support for TiDB databases. Ent is an easy framework for building and maintaining applications and big data models. It has the following features. Schema as code : the ability to model any database table as a Go object. Easy to traverse any graph : can easily run queries, aggregation and traversal of any graph structure . Static Types and Explicit APIs: Use code to generate static types and explicit APIs for easier querying of data.