Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

73 total results found

GAWK 2

Linux Command Line and Shell Scripting ... Text

Regular Expression gawk defaults to using ERE mode. Basic Usage First, create the foo text file. cat <<EOF > foo a1,a2,a3 b1,b2,b3 EOF gawk -F, '/1,a/{ print $1 }' foo a1 Here, the entire line is matched, equivalent to $0. Field-Specific Matching $2 ~ spec...

text
lclssb
linux
operating-system

Multi-Lines Text

Linux Command Line and Shell Scripting ... Text

Echo Command Using the -e option can create simple multi-line text. echo -e 'aa\nbb' aa bb Here Document Here Document (abbreviated as Heredoc) is a way of input redirection in Shell, allowing you to embed multi-line text within scripts or commands and pas...

text
lclssb
linux
operating-system

Regular Expression

Linux Command Line and Shell Scripting ... Text

Regular Expressions (regex) can be divided into the following categories based on different standards. Type Abbr Full Name Basic Regular Expressions BRE Basic Regular Expressions Extended Regular Expressions ERE Extended Regular Expressions Perl Reg...

text
lclssb
linux
operating-system

SED

Linux Command Line and Shell Scripting ... Text

Stream Editor, a stream text processor, authored by Lee E. McMahon. Basic Syntax sed [OPTIONS] 'command' file OPTIONS: Command options. command: Print, replace, delete, etc. file: The file to process; if omitted, reads from STDIN. Omitting file enters inter...

text
lclssb
linux
operating-system

Safely Delete

Linux Logging

WARNINGDO NOT DELETE THE PATH DIRECTLY. /var/log/journal/ Commands Get Disk Usage journalctl --disk-usage Archived and active journals take up 3.9G on disk. Delete by Days journalctl --vacuum-time=7d Delete by Size journalctl --vacuum-size=500M Single Fi...

delete
logging
linux
operating-system

POC Proxy

Linux Networking

机器 poc-proxy 192.168.255.250 Nginx/etc/nginx/vhost IPTables iptables -t nat -L -n -v Chain PREROUTING (policy ACCEPT 17M packets, 1432M bytes) pkts bytes target prot opt in out source destination 51238 3072K DNAT t...

networking
linux
operating-system
iptalbes
example

IPVS

Linux Networking

status
todo
ipvs
networking
linux
operating-system

netstat/lsof/ss

Linux Networking

pgsql port is visible by lsof not netstat or ss k8s pod port is visible by netstat not lsof 这种差异主要是因为 netstat 和 lsof 工作原理不同: netstat 的工作方式: 主要通过读取 /proc/net/ 下的网络相关文件 显示的是系统网络栈中的连接信息 更关注传统的网络连接和套接字 lsof 的工作方式: 显示所有打开的文件描述符 包括常规文件、目录、网络套接字等 能看到更底层的文件描述符信息 对...

lsof
ss
netstat
networking
linux
operating-system

Rsync

Linux Networking

Configuration /etc/rsyncd.conf ## /etc/rsyncd: configuration file for rsync daemon mode --- ## See rsyncd.conf man page for more options. --- ## configuration example: port = 873 uid = root gid = root use chroot = yes max connections = 50 strict modes...

rsync
networking
linux
operating-system

Scanner

Linux Networking

Nmap Subfinder

status
todo
scan
networking
linux
operating-system

VIP

Linux Networking

背景 在使用 Ansible 安装 K8s 集群的时候,配置了 192.168.88.48 作为 VIP 的地址。 Errorscouldn't get current server API group list: Get "https://kubernetes.example.local:6443/api?timeout=32s": dial tcp 192.168.88.48:6443: i/o timeout 辉哥:RFC 那么多保留地址任选一个也比这个C类好 VIP 用 C 类地址会有概率出问题,是...

load-balancing
lvs
vip
networking
linux
operating-system

Debian

Linux Packaging

Concept Software Source Configuration (/etc/apt/sources.list) Main Software Sources deb http://mirrors.aliyun.com/debian buster main non-free contrib deb-src http://mirrors.aliyun.com/debian buster main non-free contrib Description: deb: Binary package sour...

debian
packaging
linux
operating-system

OOM Score

Linux Process

修改 oom_score 可以在某些情况下有用,特别是在管理进程的内存回收优先级时。oom_score 是 Linux 内核用于选择哪个进程应该在内存不足时(触发 OOM Killer 时)被终止的一个指标。 oom_score 的作用 oom_score:表示进程被杀死的优先级。数值越高,表示该进程在 OOM(Out of Memory,内存不足)时被杀死的可能性越大。每个进程都有一个 oom_score 值,表示该进程在 OOM 情况下的杀死优先级。 值范围:0 到 1000,越高的值表示进程越容易被 O...

linux
oom
memory
process
operating-system

Logical Volume Manager

Linux Storage

LVM 是 Logical Volume Manager(逻辑卷管理器)的缩写。 它是一种在 Linux 系统中管理磁盘存储空间的技术,主要功能包括: 把多个物理磁盘或磁盘分区(Physical Volumes, PV)合并成一个大的存储池(Volume Group, VG)。 在这个存储池里创建和管理逻辑卷(Logical Volumes, LV),相当于虚拟分区。 方便灵活地调整磁盘容量,比如扩展(扩容)、缩小、快照备份等,而不用像传统分区那样受限。 简单说,LVM 可以让你更灵活地管理硬盘空间,动态调整磁...

resizing
partition
lvm
storage
linux
operating-system

Clear File Content

Linux Tricks

Both methods can be used to clear a file's content, but they differ in implementation and details: 1. : > file.log Explanation: : is a shell built-in null command that does nothing. > is the output redirection operator that redirects the null command's "out...

linux
operating-system
tricks

getent

Linux Tricks

If pod has no curl or nslookup, use getent instead. getent ahosts foobar.namespace.svc.cluster.local getent ahosts google.com

getent
tricks
linux
operating-system

System Profile

Linux Tricks

Centos echo -e "\n=== OS ===\n$(cat /etc/redhat-release)\n\n=== Kernel ===\n$(uname -r)\n\n=== CPU ===\n$(lscpu | grep --color=never -E 'Model name|CPU\\(s\\)|Socket')\n\n=== Memory ===\n$(free -h)\n\n=== Disk ===\n$(df -h)\n" echo -e "\n=== OS ===\n$(cat /e...

profile
tricks
linux
operating-system

TCP Conn Test

Linux Tricks

code-praefect-86dc6b4f4f-ns6dj:~/code/code-gitaly# nc -zv code-gitaly-0-0 9999 code-gitaly-0-0 (10.1.244.170:9999) open nc -zv code-gitaly-0-0 9999 用的是 nc(即 netcat)命令,常用于端口探测或测试连接,参数含义如下: z:只扫描端口,不发送数据("zero-I/O mode")。 v:verbose,显示详细输出。 code-gitaly-0-0:目标主...

tricks
nc
tcp
linux
operating-system

TCP/IP Pseudo Files in Bash

Linux Tricks

TCP/IP pseudo-files are a special feature in Bash that allow you to open network connections using file-like syntax. They're not real files in the /dev directory — rather, Bash internally interprets paths like /dev/tcp/host/port and /dev/udp/host/port to creat...

tricks
pseudo
tcp
networking
linux
operating-system

VIM

Linux Tricks

Paste Mode :set paste Space Tab set tabstop=4 " 设置 tab 键为 4 个空格 set shiftwidth=4 " 设置自动缩进的空格数 set expandtab " 将 tab 转换为空格 Kubectl Editor export EDITOR=/usr/bin/vim

vim
linux
operating-system