安装根证书:certutil.exe -addstore -f Root path\to\file.cer 查询网卡IP地址:ip addr show,hostname -I 重启:poweroff,shutdown now,reboot -p 查端口:sudo lsof -i :80,sudo ss -tulnp | grep 80

curl -x socks://127.0.0.1:40000 ifconfig.me curl ifconfig.me curl ipinfo.io curl httpbin.org/ip curl 2023.ip138.com -H “User-Agent: iPhone”

tasklist |findstr “30524”

kill -9 $(ps -ef | grep java | grep chat-cloud-gateway.jar | grep -v grep | awk '{print $2}')

在 Linux 系统中,用于控制系统服务的命令主要有以下几个:

  1. service 这个命令通常用于 SysVinit 系统(比如 CentOS 6 及之前版本),用来启动、停止、重新启动和管理系统服务。

    # 启动服务
    service servicename start
    # 停止服务
    service servicename stop
    # 重新启动服务
    service servicename restart
    # 查看服务状态
    service servicename status
    
  2. systemctl 这是一个更为强大且现代的命令,用于管理 Systemd 系统(包括大多数现代的 Linux 发行版,如 CentOS 7+、Ubuntu 16.04+ 等)的服务。

    # 启动服务
    systemctl start servicename
    # 停止服务
    systemctl stop servicename
    # 重新启动服务
    systemctl restart servicename
    # 查看服务状态
    systemctl status servicename
    # 启用开机自启动
    systemctl enable servicename
    # 禁用开机自启动
    systemctl disable servicename
    

需要根据具体的 Linux 发行版和所使用的初始化系统(SysVinit 或 Systemd)来选择正确的命令来管理系统服务。随着 Linux 技术的发展,越来越多的发行版已经迁移到了 Systemd,因此 systemctl 成为了更常用和更为强大的系统服务管理工具。

iops测试

apt-get install fio -y
fio --name=testfile --size=1G --filename=/root/testfile --rw=randread --bs=4k --iodepth=64 --runtime=30s --time_based
fio --name=job --filename=/root/testfile --ioengine=sync --rw=randread --bs=4k --numjobs=1 --iodepth=64 --runtime=30s --time_based --do_verify=0 --direct=1
fio --name=job --filename=/root/testfile --ioengine=sync --rw=randwrite --bs=4k --numjobs=1 --iodepth=64 --runtime=30s --time_based --do_verify=0 --direct=1

配置免密登录

ssh-keygen -t rsa
scp %USERPROFILE%\.ssh\id_rsa.pub root@182.92.120.139:~/.ssh/authorized_keys
scp %USERPROFILE%\.ssh\id_rsa.pub root@47.94.229.60:~/.ssh/authorized_keys
scp %USERPROFILE%\.ssh\id_rsa.pub root@39.106.76.208:~/.ssh/authorized_keys

禁止密码登录

vi /etc/ssh/sshd_config
#PasswordAuthentication no
#PubkeyAuthentication yes
systemctl restart sshd

跳板: OpenSSH ProxyJump ssh -J user@B_server_IP user@C_server_IP

netstat -anop | grep pid:系统正在和哪些外部接口通信

测速 apt-get install iperf -y 服:iperf -s 客:iperf -c 192.168.0.100

ubuntu server 如何查询具体进程使用了多少MB内存 systemctl stop rabbitmq-server systemctl stop mysql systemctl stop redis-server

ps aux | grep jenkins | awk ‘{print $6/1024 " MB"}’ ps aux | grep mysql | awk ‘{print $6/1024 " MB"}’ ps aux | grep erlang | awk ‘{print $6/1024 " MB"}’ ps aux | grep redis | awk ‘{print $6/1024 " MB"}’