码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
网站排障分析常用的命令
网站排障分析常用的命令 系统连接状态篇: 1.查看TCP连接状态 netstat -nat |awk ‘{print $6}‘|sort|uniq -c|sort -rn? netstat -n | awk ‘/^tcp/ {++S[$NF]};END {for(a in S) print a, S[a]}‘ 或 netstat -n |...
分类:Web程序   时间:2015-09-15 16:48:39    阅读次数:185
设计一个脚本,监控远程的一台机器(假设ip为123.23.11.21)的存活状态,当发现宕机时发一封邮件给你自己。
#!/bin/bash#Remotemonitoring.Ifthenetworkisbroken,emailme~ping-c10www.baidu.com>33.logwhile["1"="1"]dot=$(awk‘{print$1}‘33.log)if[!-z$($t)];thenecho""sleep30elsebreak;fidoneecho"DiaoXianLe"|mail-s"down"abc@139.com
分类:其他好文   时间:2015-09-15 14:51:12    阅读次数:122
每日python(7)
使用 % 将字典中的value嵌入到字符串中对应的key值中dd = {"a":1,"b":2,"c":3}txt = "this is a test : a is %(a)s, b is %(b)s, c is %(c)s "print txt % dd结果为:this is a test : a...
分类:编程语言   时间:2015-09-15 14:20:53    阅读次数:151
sql语句:if exists语句使用
if exists(select * from test.dbo.test1 where a='1')beginprint('exists ')endelse begin print('no exists ') endgo
分类:数据库   时间:2015-09-15 12:58:23    阅读次数:145
Python 修改global 变量
今天在写一个脚本时需要定义一个全局的时间变量,但是在函数中修改后一直不能更新,发现是因为函数是有自己的namespacelast_send_time = 0def test(): last_send_time = 2print last_send_time#will print 0#to ch...
分类:编程语言   时间:2015-09-15 12:53:32    阅读次数:209
Windows下路由表分析
在cmd命令行下输入:netstat -r 或者 route print 就可以查看本机的路由信息了,如图:路由表中的每一个路由项具有五个属性,在此我将它们分为四个部分:1、网络地址(Network Destination)、网络掩码(Netmask):网络地址和网络掩码相与的结果用于定义本地计算机...
分类:Windows程序   时间:2015-09-15 12:43:54    阅读次数:287
python核心编程第5章课后题答案
5-8Geometryimport mathdef sqcube(): s = float(raw_input('enter length of one side: ')) print 'the area is:', s ** 2., '(units squared)' print 'the ...
分类:编程语言   时间:2015-09-15 12:28:51    阅读次数:141
perl chomp
在寻找k_word时,为了去打末尾的换行符,使用chomp;但在windows下创建的的文件,读取一行,如一行为 weather 把它赋值为$str,然后print length($str),得到8;chomp $str; print length($str) 得到7同样在linux创建同样的文件....
分类:其他好文   时间:2015-09-15 12:25:37    阅读次数:111
字符串加u的特殊需求
#coding:utf-8L = ['a','b','c']S = []for i in L: tmp = str(i).decode('utf-8') S.append(tmp)print S
分类:其他好文   时间:2015-09-15 12:24:08    阅读次数:108
cocos进阶教程(1)Lua调用自定义C++类和函数的最佳实践
第一层:纯C环境下,把C函数注册进Lua环境a.lua 文件print(foo(99))a.c 文件#include #include #include int foo(lua_State *L){ int n = lua_tonumber(L, 1); lua_pushnumber(L, n .....
分类:编程语言   时间:2015-09-14 22:28:44    阅读次数:290
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!