1,空Array为False $a = array()if($a == false) { echo "This will be printed ! ! !" ; } 持续更新中
分类:
Web程序 时间:
2014-08-02 01:49:42
阅读次数:
178
grep?-q?"str"?urfile?&&
{
??echo?"找到了"
}?||
{
???echo?"没找到"
}
分类:
系统相关 时间:
2014-08-01 20:27:32
阅读次数:
339
监控服务器是否宕机的脚本:$sudoviping.sh按a或i进入编辑模式#!/bin/bashDate=`date+%m%d%y`touch/log/Ping/$Date.logServer="ming1ming2ming3ming4ming5"forServerin$ServerdoPing=`/bin/ping-c4$Server|grep%|awk-F[:""]+‘{print$6}‘|tr-d‘%‘`Ping2=`/bin/ping-c4$Server|gr..
分类:
其他好文 时间:
2014-08-01 20:20:13
阅读次数:
237
<?php$con=mysql_connect(‘localhost‘,‘root‘,‘1234‘);echo‘<hr>1.mysql_client_encoding<br>‘;echomysql_client_encoding();//返回当前数据库的编码方式//mysql_data_seek(result,row_number):移动数据内部指针到指定的行;result//是mysql_query():获取的数据..
分类:
数据库 时间:
2014-08-01 20:15:52
阅读次数:
328
在上篇LNMP的基础上进行测试vim/usr/local/nginx/html/test.php<?php$link=mysql_connect(‘localhost‘,‘root‘,‘mysql服务器密码,没有就在两个单引号中为空‘);if(!$link)echo"fail";elseecho"success";mysql_close();?>chmod755/usr/local/apache/htdocs/testdb.phpservi..
分类:
数据库 时间:
2014-08-01 20:13:03
阅读次数:
258
批量ping测试的批处理脚本remping测试,需要一个ip.txt的附件提供ip列表
@echooff
for/f%%iin(ip.txt)do(
ping-n2-w300%%i>nul
ifERRORLEVEL1(echo%%iunreachable)elseecho%%ireachable
)
pause两个ping包,通一个就算reachable,两个都不通输出unreachable
"单个文件编译map :call Do_OneFileMake()function Do_OneFileMake() if expand("%:p:h")!=getcwd() echohl WarningMsg | echo "Fail to make! This file i...
分类:
其他好文 时间:
2014-08-01 18:43:22
阅读次数:
271
文本行中各列打乱:awk 'BEGIN{srand()}{for(i=1;i<=NF;i++) b[rand()NF]=$i}END{for(x in b)printf "%s ",b[x]}'` data文本行中各行打乱:awk 'BEGIN{srand()}{b[rand()NR]=$0}END...
分类:
其他好文 时间:
2014-08-01 18:29:22
阅读次数:
220
#/bin/bash
#
beforTime=02:00
afterTime=08:00
beforTime=$(echo$beforTime|awk-F:{‘print$1‘})
afterTime=$(echo$afterTime|awk-F:{‘print$1‘})
Flag=0
whiletrue
do
sleep2s
echo"date:$(date+"%Y-%m-%d%H:%M:%S")"
if[$(date+%H)-eq$beforTime];then
CurDate=$(date+%d)
..
通过tcp三次握手的情况来说明#netstat -an|awk '/^tcp/ {++s[$NF]} END{for (a in s) print a,s[a]}'established是表示tcp三次握手成功后的工作状态,可以理解为已经成功进行访问了listen是表示在侦听,没有客户连接进来syn...
分类:
Web程序 时间:
2014-08-01 13:02:41
阅读次数:
222