首先修改ssh端口。创建脚本pb_ssh.sh#!/bin/bash#crontab每隔1分钟执行一次#*/1****/root/pb_ssh.sh#获取前1分钟内的secure记录,统计ssh认证失败的IP和其失败次数SCANNER=`grep"$(date-d-1min|awk‘{printsubstr($0,10,7)}‘)"/var/log/secure|awk‘/Failed/{print$(NF-3)}‘|awk-..
分类:
系统相关 时间:
2014-10-09 20:47:28
阅读次数:
187
Perl常用语法记录
##包的切换和调用其它包的方式
#packageA;
#my$a=10;
#packageB;
#print$A::a;
#print$a;
##local局部标识符的使用
#$aa=20;
#{
# local$aa;
# $aa=10;
# print"$aa\n";
#
#}
#print$aa;
##别名的使用
=comment
$b=10;
$a=1;
$c=200;
{
local*b;
*..
分类:
其他好文 时间:
2014-10-09 20:42:08
阅读次数:
183
将子函数名作为参数存储起来,再次调用这个函数时,仍然保存着上层函数的参数存储子函数的操作在上层函数中,传入的时候子函数可以没有参数,调用时再添加参数越说越乱直接上demo 1 a=[] 2 def adda(a1,a2): 3 def addb(a3): 4 print('-...
分类:
其他好文 时间:
2014-10-09 19:45:37
阅读次数:
234
1.函数作为参数加*和不加*
例1:
void print(int i)
{
printf("not parameter%d\n",i);
}
void debugfun(void (*funprint)(int))
{
funprint(2);
return;
}
main()
{
debug...
分类:
编程语言 时间:
2014-10-09 16:18:18
阅读次数:
190
#!/bin/bashFILE=/usr/local/mysqlFILESIZE=`du-s$FILE|awk‘{print$1}‘`|cut-f1-d‘M‘if[$FILESIZE-gt20];thenecho"thefilesizeismorethantheprimaryfile"elseecho"thefilesizeislessthantheprimaryfile"fi
分类:
系统相关 时间:
2014-10-09 16:04:28
阅读次数:
227
环境:1.win7 64位 2.python 2.7.8 3.PIL-1.1.7.win32-py2.7在运行一下例子时候出现问题:#-*-coding:utf-8-*-__author__ = 'Hmily'import Imageim=Image.open('pil.jpg')print...
分类:
Windows程序 时间:
2014-10-09 15:32:24
阅读次数:
1575
一、函数的定义格式:
def 函数名(参数列表):
函数体
def fun1(a, b, c):
return a + b + c
二、位置传递:位置对应
print(fun1(3 ,2 ,1))
输出:
6
三、关键字传递:位置参数要出现在关键字参数之前
print(fun1(3 ,c = 1, b = 2))
输出:
6
四、参数默认值:可以给...
分类:
编程语言 时间:
2014-10-09 15:28:58
阅读次数:
197
ProblemPrint a matrix in spiral fashion.SolutionWe will first print the periphery of the matrix by the help of 4 for loops. Then recursively call this...
分类:
其他好文 时间:
2014-10-09 14:22:03
阅读次数:
151
public static void main(String[] args) throws ParseException { //random(2); UUID.randomUUID().toString().replaceAll("-", "~~"); System.out.print...
分类:
其他好文 时间:
2014-10-09 13:58:03
阅读次数:
176