Linux
Process
Networking
Commands
ss summary ss -s Total: 1785 TCP: 2635 (estab 1564, closed 1026, orphaned 23, timewait 1013) ...
tcpdump
Specify Port & Flags tcpdump -i lo -nn -s 0 tcp port 9004 and '(tcp[tcpflags] & (tcp-syn|tcp-rst...
VIP
背景 在使用 Ansible 安装 K8s 集群的时候,配置了 192.168.88.48 作为 VIP 的地址。 Errorscouldn't get current server API ...
IPVS
Scanner
Nmap Subfinder
Kernel Parameters
## 设置本地端口范围为 1024-65000 echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range ## 启用 TCP TIME...
POC Proxy
机器 poc-proxy 192.168.255.250 Nginx/etc/nginx/vhost IPTables iptables -t nat -L -n -v Chain PR...
netstat/lsof/ss
pgsql port is visible by lsof not netstat or ss k8s pod port is visible by netstat not lsof 这种差异主...
SSH Tunnel
本地端口转发 Localhost 访问本地 http://localhost:8080 会转发到 192.168.x.x 的 localhost:8080。 在本机执行ssh -NL 8080...
Rsync
Configuration /etc/rsyncd.conf ## /etc/rsyncd: configuration file for rsync daemon mode --- ##...
Traffic Stats
iftop apt-get update apt-get install iftop iftop -i eth1 -P tcpdump BytesMBtcpdump -i eth1 -n...
Latency
Time Cost curl -o /dev/null -s -w" time_namelookup: %{time_namelookup}s\n\ time_connect:...
Storage
Commands
iostat apt-get install -y sysstat iostat -x 1 iotop apt-get install iotop iotop -aoP lsblk ...
Logical Volume Manager
LVM 是 Logical Volume Manager(逻辑卷管理器)的缩写。 它是一种在 Linux 系统中管理磁盘存储空间的技术,主要功能包括: 把多个物理磁盘或磁盘分区(Physica...
growpart
阿里云扩容云盘 扩展硬盘 lsblk -f /dev/sda2 直接是 ext4 文件系统并挂载在根目录 /(非 LVM)。 NAME FSTYPE FSVER LABEL UU...
Packaging
Logging
Tricks
Clear File Content
Both methods can be used to clear a file's content, but they differ in implementation and details...
getent
If pod has no curl or nslookup, use getent instead. getent ahosts foobar.namespace.svc.cluster.lo...
System Profile
Centos echo -e "\n=== OS ===\n$(cat /etc/redhat-release)\n\n=== Kernel ===\n$(uname -r)\n\n=== C...
TCP Conn Test
code-praefect-86dc6b4f4f-ns6dj:~/code/code-gitaly# nc -zv code-gitaly-0-0 9999 code-gitaly-0-0 (1...
TCP/IP Pseudo Files in Bash
TCP/IP pseudo-files are a special feature in Bash that allow you to open network connections usin...
VIM
Paste Mode :set paste Space Tab set tabstop=4 " 设置 tab 键为 4 个空格 set shiftwidth=4 " 设置自动...
Troubleshooting
Inodes Are Exhausted
Errors Tabcannot create temp file for here-document: No space left on device docker exec -it f1...
Memory Pagesize
某些 ARM 机器的内存分页为 64K,会导致 C 语言编写的程序无法运行,因为一般编译的时候宿主机器的分页为 4K,可以使用下面的命令查看。 getconf PAGESIZE macOS 也...
NAT loopback
AWS NLB Troubleshooting Connections time out for requests from a target to its load balancer. Che...
NFS Mount Failed
背景 香蕉集群的 PV 持载 NFS 192.168.80.50 失败,报错。 Mounting arguments: -t nfs 192.168.80.50:/scan-download-...