Command mode (Command)

Alias Action Transaction Definition Command is a behavioral design pattern that converts a request into a standalone object that contains all the information related to the request. This transformation allows you to parameterize methods based on different requests, delay or queue requests, and implement undoable operations. Foreword 1. Question Suppose you are developing a new […]

Kirin KYLINOS command line to set system mute

Original link: Kirin KYLINOS command line to set system mute Hello, everyone, today I will bring you an article on how to use the command line to adjust system mute on Kylin KYLINOS. Sometimes you need to make a template, so you can use this method. Without further ado, let’s take a look. 1. View […]

WEB Security (Command Execution) Note 2

Foreword A command execution vulnerability is a security vulnerability that allows an attacker to execute malicious system commands. This vulnerability typically occurs when an application or system does not properly validate user input, allowing the user to execute system commands by entering specific data. The occurrence of vulnerabilities is usually related to the following factors: […]

Linux: linux getopt_long() function (command line parsing) (getopt, getopt_long_only) (short option -, long option –)

Foreword In Linux, various commands are often needed, usually with various parameters. How are these parameters parsed? Usually the functions getopt, getopt_long, and getopt_long_only functions provided by GNU C are used to parse command line parameters. 1. About command line parameters Command line parameters can be divided into two categories, one is short options, and […]

Redis command (3)

Redis Set command Redis Set is an unordered collection of string type Redis set set members are unique, which means that duplicate data cannot appear in the set. Redis set is implemented through a hash table, so the complexity of adding, deleting, and searching is O(1) The maximum number of members of a Redis set […]

[ Linux Busybox ] flash_eraseall command analysis

Article directory Related structures flash_eraseall function implementation flash_eraseall implementation flow chart File path: busybox-1.20.2/miscutils/flash_eraseall.c Related structure MTD related information structure struct mtd_info_user {<!– –> __u8 type; // MTD device type __u32 flags; // MTD device attribute flags __u32 size; //The size of the mtd device __u32 erasesize; //The erase unit size of the MTD device, […]

Simulation implementation of Linux-Shell command line interpreter

Introduction: This article is mainly about simply implementing a shell command line interpreter, which can support basic common Linux commands, support built-in named echo and cd, and also support redirection operations! 1. Code analysis 1. Header file introduction: Because the code is implemented under Linux, most of the header files introduced are Linux system calls, […]