<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[sehn_的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/sehn_</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; sehn_]]></copyright><item><title><![CDATA[自动清理超过指定大小的文件——shell脚本]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107944205</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107944205</guid><author>sehn_</author><pubDate>Tue, 11 Aug 2020 21:28:14 +0800</pubDate><description><![CDATA[需求：查找某个目录下的所有超过一定大小的文件并清除
思路：查找此目录下的所有文件并判断其大小，超过一定大小则使用echo语句清空
方案：
使用du命令实现：
生成几个测试文件
[root@localhost cache]# dd if=/dev/zero of=testfile1 bs=1M count=50
50+0 records in
50+0 records out
52428800 bytes (52 MB) copied, 0.145185 s, 361 MB/s
[root@localhost]]></description><category></category></item><item><title><![CDATA[实时保存用户历史命令——shell脚本]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107922752</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107922752</guid><author>sehn_</author><pubDate>Mon, 10 Aug 2020 21:59:39 +0800</pubDate><description><![CDATA[实时保存linux系统下用户的历史命令
脚本如下
[root@k8s-master ~]# cat history.sh
#!/bin/bash
#sehn
USER_IP=`who -u am i 2&gt;/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
HISTDIR=/var/log/.history  #历史命令保存目录
if [ -z $USER_IP ];then
USER_IP=`hostname -I`
fi
if [ ! -d $HISTD]]></description><category></category></item><item><title><![CDATA[批量ping主机，批量检测ip可用性——shell脚本]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107920327</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107920327</guid><author>sehn_</author><pubDate>Mon, 10 Aug 2020 19:55:06 +0800</pubDate><description><![CDATA[需求：对192.168.200.0/24网段的ip进行检查，检查哪些ip现在被占用，哪些没有被占用，可以通过ping命令来检查，脚本如下:
[root@master ~]# cat ip_check.sh
#!/bin/bash
#sehn
. /etc/init.d/functions
for i in {1..254};
do
ip=192.168.200.$i
ping -c2 $ip &gt; /dev/null 2&gt;&amp;1
if [ $? -eq 0 ]; then
action "$]]></description><category></category></item><item><title><![CDATA[判断目录是否被修改——shell脚本]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107883296</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107883296</guid><author>sehn_</author><pubDate>Sat, 08 Aug 2020 19:07:38 +0800</pubDate><description><![CDATA[此脚本用于检测linux系统重要文件是否被改动，如果发生改动则发送邮件通知进行报警
#!/bin/bash
FileDir='/var/CheckFile' #定义验证文件所在目录
HostName=$(hostname) #获取主机名或自己定义

Mail_Smtp="smtp.163.com" #smtp地址，我这里用的网易邮箱
Mail_User="xxx@163.com" #用户
Mail_Pass="USRMVWXLCUQTAYCK" #授权密码
Mail_From="xxx@163.com" #]]></description><category></category></item><item><title><![CDATA[部署Kubernetes集群-1.18.6版本]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107823058</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107823058</guid><author>sehn_</author><pubDate>Wed, 05 Aug 2020 19:24:12 +0800</pubDate><description><![CDATA[Kubeadm 部署 Kubernetes1.18.6 集群
一、环境说明




主机名
IP地址
角色
系统




k8s-master
192.168.182.150
k8s-master
Centos7.6


k8s-node-1
192.168.182.160
k8s-node
Centos7.6


k8s-node-2
192.168.182.170
k8s-node
Centos7.6



注意：官方建议每台机器至少双核2G内存，同时需确保MAC和product_uuid唯一（参考下面]]></description><category></category></item><item><title><![CDATA[CentOS7环境下搭建 rsyslog 日志服务器，rsyslog+loganalyzer]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107578888</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107578888</guid><author>sehn_</author><pubDate>Sat, 25 Jul 2020 17:33:09 +0800</pubDate><description><![CDATA[1.系统环境部署




ip
hostname




192.168.200.182
web


192.168.200.184
rsyslog-mysql


关闭防火墙、selinux、下载epel源
[root@web ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/f]]></description><category></category></item><item><title><![CDATA[关于zabbix5.0页面出现中文乱码解决方案，已解决]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107455885</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107455885</guid><author>sehn_</author><pubDate>Mon, 20 Jul 2020 09:05:38 +0800</pubDate><description><![CDATA[页面乱码如图，有小方块，影响监测

Windows10字体路径，选择想更换的字体

将zabbix默认字体修改为自己想换的字体
[root@zabbix-server fonts]# pwd
/usr/share/zabbix/assets/fonts   //zabbix5.0字体文件目录
[root@zabbix-server fonts]# ls
graphfont.ttf
[root@zabbix-server fonts]# mv graphfont.ttf graphfont.ttf.bak
[]]></description><category></category></item><item><title><![CDATA[shell脚本，俄罗斯方块，亲测可玩]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107394660</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107394660</guid><author>sehn_</author><pubDate>Thu, 16 Jul 2020 21:59:22 +0800</pubDate><description><![CDATA[忘了什么时候在哪薅下来的俄罗斯方块脚本
今天突然翻到了，直接复制粘贴一跑居然能玩，分享一下
#!/bin/bash

APP_NAME="${0##*[\\/]}"
APP_VERSION="1.0"

#颜色定义
iSumColor=7			#颜色总数
cRed=1				#红色
cGreen=2			#绿色
cYellow=3			#黄色
cBlue=4				#蓝色
cFuchsia=5			#紫红色
cCyan=6				#青色(蓝绿色)
cWhite=7			#白色

#位置与大小
marginL]]></description><category></category></item><item><title><![CDATA[Centos环境下搭建zabbix监控系统, zabbix5.0最新版]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/107392332</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/107392332</guid><author>sehn_</author><pubDate>Thu, 16 Jul 2020 21:23:44 +0800</pubDate><description><![CDATA[Zabbix 是一个基于 WEB 界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。zabbix 能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题
zabbix的优点：
开源,无软件成本投入


Server 对设备性能要求低


支持设备多,自带多种监控模板


支持分布式集中管理,有自动发现功能,可以实现自动化监控


开放式接口,扩展性强,插件编写容易


当监控的 item 比较多服务器队列比较大时可以采用被动状态,被监控客户]]></description><category></category></item><item><title><![CDATA[抽奖，生成随机数——shell脚本]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/106692492</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/106692492</guid><author>sehn_</author><pubDate>Thu, 11 Jun 2020 17:01:00 +0800</pubDate><description><![CDATA[抽奖shell小脚本
原理就是生成随机数，取数字最大的前5名
写的比较low，尝试写了注释，欢迎讨论交流
#!/bin/bash
#zou

/tmp/name.txt
random() {
#生成随机数
random=“KaTeX parse error: Expected 'EOF', got '}' at position 18: …RANDOM%100))"
 }̲
 name() {
    …name” = “exit” ]; then
#输入exit后退出程序
break
fi
#将输出结果重]]></description><category></category></item><item><title><![CDATA[判断输入的键值是否为数字——shell脚本]]></title><link>https://blog.youkuaiyun.com/sehn_/article/details/106534275</link><guid>https://blog.youkuaiyun.com/sehn_/article/details/106534275</guid><author>sehn_</author><pubDate>Wed, 03 Jun 2020 22:34:56 +0800</pubDate><description><![CDATA[上课写的小脚本
  #!/bin/bash
  #zou
  read -p "请输入：" num
  if [[ "$num" =~ ^[0-9]+$ ]]; then
      echo "输入的数字是$num"
 else
      echo "输入的不是数字"
  fi


]]></description><category></category></item></channel></rss>