How to install Pip on CentOS 8

Pip is a package management system that allows you to install, remove and manage packages written in Python. It can be used to install packages from the Python Package Index (PyPI) and other indexes. In this tutorial, we will explain how to install pip for Python 2 and 3 on CentOS 8, and cover the basics of how to use pip to manage Python packages. Installing pip on CentOS 8 As you know, there are two versions of Python under active development, Python 2 and Python 3.

Creating menus with Bash Select

In this tutorial, we will cover the basics of the select construct in Bash. The select construct allows you to generate menus. Bash select constructs The select construct generates a menu from a list of items. It has almost the same syntax as the for loop. 1 2 3 4 select ITEM in [LIST] do [COMMANDS] done [LIST] can be a series of strings separated by spaces, number ranges, command output, arrays, etc.

High Risk! Kubernetes New Container Escape Vulnerability Warning!

On January 18, 2022, Linux maintainers and vendors discovered a heap buffer overflow vulnerability in the legacy_parse_param function of the Linux kernel (5.1-rc1+) file system context function with the vulnerability ID number CVE-2022-0185, which is a high-risk vulnerability with a severity rating of is 7.8 . The vulnerability allows for out-of-bounds writes in kernel memory. Using this vulnerability, an unprivileged attacker could bypass the restrictions of any Linux namespace and

Javascript Object Signing and Encryption

The rise of mobile and the popularity of OAuth2 has led to JWT being a hot mess these past few years. Today we are going to introduce another specification set, JOSE, called Javascript Object Signing and Encryption, which has a lot to do with JWT. JOSE Introduction JOSE is a Javascript object signing and encryption protocol designed to provide a method for securely transmitting declarations (claims, such as authorization information) between communicating parties, purposely built on top of JSON and BASE64 for easy use in Web applications.

String builder in C# - StringBuilder

In everyday development StringBuilder must be used by everyone, even a lot. After all, we all know the unwritten norm that StringBuilder’s performance is higher than direct string splicing when a large number of strings need to be constructed at high frequencies, because using + or += directly will generate a new String instance, because String objects are immutable objects, which means that each time the string This means that

Python time processing standard library: time and datetime modules

Python has a number of built-in APIs for manipulating time, which are distributed in standard libraries such as time and datetime, and their usage can be confusing. The following article will introduce the main purpose, core objects, common methods, and uses of each module, and will end with an analysis and comparison, so if you already know these details, you can jump directly to the summary and comparison section at the end.

Understanding descriptors in Python

Descriptors are an advanced concept in Python and the basis for many of Python’s internal mechanisms, so this article will go into them in some depth. Definition of a descriptor The definition of a descriptor is simple; a Python object that implements any of the following methods is a descriptor. __get__(self, obj, type=None) __set__(self, obj, value) __delete__(self, obj) The meanings of the parameters of these methods are as follows. self

A deeper understanding of the git cherry-pick operation

In the previous articles on advanced Git usage, we’ve learned how Git works and how to use rebase, merge, checkout, reset, etc. Basically, you can use Git without fear, and you can comfortably modify your commit history without losing any You can change your commit history without losing anything. Today, we’re going to add the final piece to the puzzle and learn about the cherry-pick command, which is not used in many scenarios, but can work wonders.

How to use docker buildx to build multi-architecture Go images

Running applications on different operating systems and processor architectures is a common scenario, so it is a common practice to build separate distributions for different platforms. This is not easy to achieve when the platform we use to develop the application is different from the target platform for deployment. For example, developing an application on an x86 architecture and deploying it to a machine on an ARM platform usually requires preparing the ARM platform infrastructure for development and compilation.

Git rebase Usage Details and How it Works

I had no idea about the use of git rebase -i, but once I needed to merge multiple commits, I almost lost all my commits, but luckily I was able to recover them later. So let’s document the process of learning the rebase command. Understanding the Rebase Command The documentation for the git rebase command is Reapply commits on top of another base tip, which literally means reapply commits on

A deeper understanding of git merge operations

Merging is a very common operation in Git: you can merge changes between branches, or perform pull and push operations on remote branches. However, the git merge command can be a bit daunting for newcomers, because you can get different results from running merge in different situations. This uncertainty about the results has kept me from actively using it for a long time, and I’ve relied on visual interfaces like GitHub’s Pull Request or GitLab’s Merge Request to merge manually.

Metaclass in Python 3

In the Python programming language, most classes are used to generate objects: when you call these classes, they return an Instance of the class to the caller. For example, if you call a Student class that defines the various actions required of a student, we get a new instance of Student, which seems very natural. One of the core ideas of the OOP language is inheritance, i.e. if I had

HTTP Host Header Attack - Study Notes

1. HTTP Host header attacks Starting with HTTP / 1.1, the HTTP Host header is a required request header. It specifies the domain name that the client wants to access. For example, when a user accesses https://example.net/web-security, their browser will compose a request containing the Host header, as follows. 1 2 GET /web-security HTTP/1.1 Host: example.net In some cases, such as when a request is forwarded by a proxy, the

How to set up an ftp server on ubuntu 20.04 using vsftpd

This article describes how to install and configure the FTP server you use to share files between devices on Ubuntu 20.04. FTP (File Transfer Protocol) is the standard network protocol used to transfer files to a remote network. There are several open source FTP servers available for Linux. The most famous and widely used ones are pureftpd, Proftpd, VSFTPD. We will install VSFTPD (VSFTPD daemon), a stable, secure and fast FTP server.

JavaScript Garbage Collection: Browser and Server

We all know that garbage collection (GC) is important for modern application development. It depends on your programming language and many developers have little idea how it is done. Garbage collection always releases memory that is no longer in use. The strategies and algorithms to achieve this vary from one language to another. For example, JavaScript does this in some interesting ways, depending on whether you’re on a browser or a Node.

Decorators and metadata reflection API in TypeScript: from novice to expert

An in-depth understanding of the implementation of TypeScript’s modifiers, which make it possible for JavaScript to implement reflection and dependency injection. The tutorial is divided into four main parts Part 1: Method modifiers Part I: Property modifiers & class modifiers Part III: Parameter Modifiers & Modifier Factories Part IV: Type serialization & metadata reflection API In this article we will learn Why our JavaScript needs reflection The metadata reflection API

How to compile Android WebRTC source code

WebRTC name comes from the abbreviation of Web Real-Time Communication, an API that supports real-time voice or video conversations in the browser. it was open-sourced on June 1, 2011 and included in the W3C standards with support from Google, Mozilla, Opera. In this tutorial, I assume you are using Linux and understand webrtc and android development. android webrtc source code compilation is only supported under Linux. This includes how to install Chromium depot_tools development tool, check out Android webrtc source code using gclient, build webrtc .

NGINX proxy gRPC requests

My blog server has two ports open, one for serving HTTP requests and one for serving gRPC requests from clients. Later, after learning more about gRPC, I found out that the underlying transport layer protocol is actually based on HTTP/2. At the same time, I saw the official NGINX gRPC support. So I wanted to use NGINX to proxy gRPC requests so that I wouldn’t have to think about the

How to install Python 3.8 on Debian 10

Python is one of the most widely used programming languages in the world. With its easy-to-learn syntax, Python is a popular choice for beginners and experienced developers alike. Python is quite a versatile programming language. It can be used to build all kinds of applications, from simple and complex machine learning algorithms. Debian 10 includes Python version 3.7, which can be installed or updated using the apt tool. At the time of writing, Python 3.

Python range function

The Python range type generates a sequence of integers by defining the start and end points of a range. It is typically used with a for loop to iterate over a sequence of numbers. range() works differently in Python 2 and 3. In Python 2, there are two functions that allow you to generate sequences of integers range and xrange. These functions are very similar, the main difference being that range returns a list and xrange returns an xrange object.