文件锁有两种:共享锁和排他锁,也就是读锁(LOCK_SH)和写锁(LOCK_EX)文件的锁一般这么使用:$fp=fopen("filename","a");flock($fp,LOCK_SH)ordie("lockerror")$str=fread($fp,1024);flock($fp,LOCK_...
分类:
Web程序 时间:
2014-07-07 10:16:37
阅读次数:
283
这是控制nginx服务的脚本文件,包括控制nginx的启动、重启、停止、平滑重启、对配置文件的额检查。[root@localhost~]#catnginx.sh#!/bin/envbash#description:nginxserver###必须加描述#nginx-thisscriptisusedtocontrolnginxservice#processnamenginx#chkconfig:-8515#editbys..
分类:
系统相关 时间:
2014-07-03 14:54:00
阅读次数:
277
邮箱升级tomcat注意事项说明1. 下载新版本tomcat2. 停止服务并且备份#pkill -9 safestartwd#pkill -9 watchdog#cd /turbomail/web/bin./shutdown.sh#mv /turbomail/web /turbomail/webba...
分类:
其他好文 时间:
2014-07-03 07:04:38
阅读次数:
194
/bin/sh /app/xmlrpc-c-1.16.34/mkinstalldirs /usr/local/lib/bin/sh /app/xmlrpc-c-1.16.34/mkinstalldirs /usr/local/include/bin/sh /app/xmlrpc-c-1.16.34/...
分类:
其他好文 时间:
2014-07-02 21:13:44
阅读次数:
186
系统安全最小服务法文件安全(suid/sgid/stick/chattr)升级系统和软件最小权限法(su/sudo)SSH安全建议最小服务法(systemv/xinetd)关闭不需要的服务:#vim/root/service.sh#!/bin/bashservicexinetdstopchkconfigxinetdoffservices="networksshdsysloglvm2-monitormessagebussendm..
分类:
其他好文 时间:
2014-07-02 16:18:01
阅读次数:
292
#!/bin/sh################################################AutoCloneVM######2014-5-9######Owner:YiQiang.Wei######Lastedit:5-11######################################################default(){echoechoecho-e"\033[32;49;1m[DefaultMode]\033[39;49;0m"echoechoTEM=ce..
分类:
其他好文 时间:
2014-07-02 16:14:48
阅读次数:
287
#!/bin/sh#Description:CheckICE3.0State#LastUpdate:2014/06/11/01WORKDIR=`pwd`exportREPORTDIR=$WORKDIR/`date"+%Y%m%d%H%M%S"`exportTG=`date"+%Y%m%d%H%M%S"`exportBEGIN=`date-d"-1hour""+%H:%M:%S"`exportEND=`date"+%H:%M:%S"`ECORE=2OCORE=0APPDIR=/opt/app/ice3.0LOG..
分类:
其他好文 时间:
2014-07-02 15:48:11
阅读次数:
310
微软近期Open的职位:SDE2 (Windows - Power)Windows Partner Enablement team in Operating System Group is looking for a Software Development Engineer (SDE) in Sh...
分类:
其他好文 时间:
2014-07-02 14:23:03
阅读次数:
210
####yuminstall##yuminstallgccgcc-c++openssl*ntpperl-ExtUtils-CBuilderperl-ExtUtils-MakeMaker-yecho‘exportLC_ALL=C‘>>/etc/profiletail-1/etc/profilesource/etc/profile/usr/sbin/ntpdatepool.ntp.org####installnagios###/usr/sbin/addusernagios-M-s/sbin/nolog..
分类:
移动开发 时间:
2014-07-02 11:31:30
阅读次数:
191
#!/bin/sh#varnish切割日志,每隔一天切割一次/usr/sbin/ntpdate202.112.10.36>>/dev/nulllogpath=/Data/logsif[-f$logpath/varnish.log];thenmv$logpath/varnish.log$logpath/varnish.`date"+%Y-%m-%d"`.logkillall-9varnishncsa/usr/bin/varnishncsa-n/var/lib/varnish..
分类:
其他好文 时间:
2014-07-02 06:34:33
阅读次数:
251