码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
Linux防止ssh暴力扫描IP
首先修改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常用语法记录
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
C和C++函数指针作为函数参数的区别
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
<img> to image_tag
"img_preview") %>
分类:其他好文   时间:2014-10-09 16:13:44    阅读次数:187
Linux中查看一个目录的大小脚本
#!/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
PIL在windwos系统下Image.show无法显示图片问题的解决方法
环境: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
Python学习笔记5:函数参数详解
一、函数的定义格式: 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
Print matrix spiral
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
生成不重复的32为随机码
public static void main(String[] args) throws ParseException { //random(2); UUID.randomUUID().toString().replaceAll("-", "~~"); System.out.print...
分类:其他好文   时间:2014-10-09 13:58:03    阅读次数:176
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!