![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
号角响起
这个作者很懒,什么都没留下…
展开
-
shell脚本生成一个简单的计算器
[root@nginx scripts]# cat calculator.sh #!/bin/bash#DATE:2015-6-19#Author:devon#Functions: a calculator for integer operators "+,-,*,/,%,** "usage1() {echo -n "sorry,you have input a原创 2015-06-19 16:31:07 · 2446 阅读 · 0 评论 -
防止端口扫描shell脚本
网上有现在的防端口工具,如psad、portsentry,但觉得配置有点麻烦,且服务器不想再装一个额外的软件。所以自己就写了个shell脚本实现这个功能。基本思路是:使用iptables的recent模块记录下在60秒钟内扫描超过10个端口的IP,并结合inotify-tools工具实时监控iptables的日志,一旦iptables日志文件有写入新的ip记录,则使用iptables封锁源ip,起转载 2015-06-05 08:31:52 · 2117 阅读 · 0 评论 -
linux shell 生成随机字符串脚本
脚本作用:生成特定长度的字符串,只包含数字或者大小写字母。count定义字符串的长度number定义字符串的数目line定义生成多少个随机字符串,如果number值很大,相应的将line值调大。由于pv1中的字符串长度不是固定的,所以需要经过一个for循环进行字符串筛选。以下是脚本命令:#!/bin/bashcount=6line=100nu原创 2015-05-30 22:18:55 · 3568 阅读 · 0 评论