Ubuntu中设置开机自启动脚本
Ubuntu 24.04 LTS 使用systemd作为服务管理器,开机自启动脚本可以通过systemd来管理一个服务,通过设置该服务来执行脚本,早些的做法是把自启动脚本通过rc.local文件来进行设置,但是在ubuntu中,管理这个文件的服务默认是不开启的,所以必须先配置rc-local.service,然后再建立rc.local文件来实现目的。步骤1:修改 rc-local.service文件
首先,需要编辑 /lib/system...
在CentOS 7上限制UDP访问仅允许国内IP要在CentOS 7上配置防火墙仅允许国内IP访问UDP端口,同时阻止海外访问,可以使用firewalld结合ipset来实现。以下是具体步骤:方法一:使用firewalld和ipset安装必要工具(如果尚未安装):yum install -y ipset firewalld
systemctl enable firewalld
systemctl sta...
一、选择一种桌面环境并安装1. XFCE 桌面$ yum install -y epel-release
$ yum groupinstall -y "Xfce"
$ ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target...
CONFIG GET dir
CONFIG GET dbfilename
config set dir /opt/redis
CONFIG set dbfilename dump.rdb
在redis.conf最后面追加
# 禁用 FLUSHDB 命令
rename-command FLUSHDB "...
一、关闭firewalld,安装iptables过程:
停止并禁用firewalld:
systemctl stop firewalld
systemctl disable firewalld
安装iptables-services:
yum -y install iptables-services
设置开机启动:
systemctl enable iptables...
通过iptables实现IP端口数据包转发服务配置VPS会经常使用到端口转发,以解决不同网络之间互联互通问题。例如我们的laxA-QN机房对联通更好,laxB-C3机房对电信更好。这时如果有一台VPS用作中转,这样就能达到稳定且快速的效果。这里,我们介绍一个使用iptables来进行中转的教程。使用iptables的好处就是不用额外装东西,且同时支持tcp及udp。关于CentOS 7系统:需要删除firewalld装回iptables.# 安装命令(已默认安装):syste...
CentOS系统运行时/var/log/cron频繁输出FAILED to authorize user with PAM (Module is unknown)错误
重启下定时任务 /etc/init.d/crond restart
重启下系统日志服务/etc/init.d/rsyslog restart
再次查看日志tail -f /...
参数说明net.core.rmem_default默认的socket数据接收窗口大小(字节)。net.core.rmem_max最大的socket数据接收窗口(字节)。net.core.wmem_default默认的socket数据发送窗口大小(字节)。net.core.wmem_max最大的socket数据发送窗口(字节)。net.core.netdev_max_backlog当内核处理速度比网卡接收速度慢时,这部分多出来的包就会被保存在网卡的接收队列上。该参数说明了这个队...
项目地址https://github.com/jlyo/tcping安装git clone https://github.com/jlyo/tcping.gitcd tcpingmake install使用tcping -p 端口 服务器地址tcping -p 端口 服务器地址 -c ping次数tcping -p 端口 服务器地址 -i 间隔(秒)加时间脚本cat tcping.sh
#!/bin/bash
while true;&n...
1、查看当前#最大值
[shnne@localhost ~]$ cat /proc/sys/net/core/rmem_max
212992
[shnne@localhost ~]$ cat /proc/sys/net/core/wmem_max
212992
#初始值
[shnne@localhost ~]$ cat /proc/sys/net/core/rmem_de...