存档
安装、更新ports
对比更新 vbs
- Option Explicit
- sub copyfol(sDir,Ddir)
- 'sDiry要对比的文件夹,,Ddir要操作文件夹
- dim fso,fol,fs,f1, objfile
- dim arrFiles(),arrSize(),arrModified()
- dim i
- if right(ddir,1)<>"\" then ddir =ddir & "\"
- if right(sdir,1)<>"\" then sdir =sdir & "\"
- Set fso = CreateObject("Scripting.FileSystemObject")
- '判断文件是否存在
- if not (fso.FolderExists(sdir)) then
- msgbox "找不到文件夹:" & sdir
- exit sub
- end if
- if not (fso.FolderExists(ddir)) then
- msgbox "找不到文件夹:" & sdir
- exit sub
- end if
- '获得要操作的文件列表及相关信息并储存到数组
- set fol=fso.GetFolder(ddir)
- set fs=fol.files
- i=0
- redim arrFiles(fs.count-1)
- redim arrSize(fs.count-1)
- redim arrModified(fs.count-1)
- for each f1 in fs
- arrfiles(i)=f1.name
- arrSize(i)=f1.size
- arrModified(i)=f1.DateLastModified
- i=i+1
- next
- '把要操作的文件夹逐一根要对比的文件比较,不同则覆盖,多余就删除,没有就复制
- set fol=fso.GetFolder(sdir)
- set fs=fol.files
- for i = 0 to ubound(arrfiles)
- '文件存在则比较是否相同,否则删除
- dim delfile '要操作类型,
- delfile=false
- for each f1 in fs
- if strcomp(arrfiles(i),f1.name,vbTextCompare)=0 then
- if arrsize(i)<> f1.size or arrModified(i)<>f1.DateLastModified then
- fso.copyfile f1.path, ddir & arrfiles(i),true
- end if
- delfile=true '如果文件存在
- exit for
- end if
- next
- if not delfile then
- set objfile=fso.getfile(ddir &arrfiles(i))
- objfile.Delete (true)
- end if
- next
- '如果对比目录sdir中有文件是要操作目录ddir中没有的,则复制到ddir
- for each f1 in fs
- delfile=false
- for i=0 to ubound(arrfiles)
- if strcomp(f1.name,arrfiles(i),vbtextcompare)=0 then
- delfile=true
- exit for
- end if
- next
- if right (ddir,1)<>"\" then ddir=ddir &"\"
- if not delfile then
- f1.copy ddir,true
- end if
- next
- '以下代码处理子文件夹
- dim fols
- set fol=Fso.GetFolder(sdir)
- set fols=fol.SubFolders
- for each f1 in fols
- if not (fso.FolderExists(ddir & f1.name)) then
- fso.CreateFolder(ddir & f1.name)
- end if
- copyfol sdir & f1.name ,ddir & f1.name
- next
- end sub
- '以下是对比路径 第一个是远程路径 第二个是本地路径
- copyfol "c:\viyin.net","C:\www.viyin.net"
nginx平台架设nagios
nagios作用
1.
监控网络服务(SMTP、POP3、HTTP、NNTP、PING等);
2.
监控主机资源(处理器负荷、磁盘利用率等);
3.
简单地插件设计使得用户可以方便地扩展自己服务的检测方法;
4.
并行服务检查机制;
5.
具备定义网络分层结构的能力,用”parent”主机定义来表达网络主机间的关系,这种关系可被用来发现和明晰主机宕机或不可达状态;
6.
当服务或主机问题产生与解决时将告警发送给联系人(通过EMail、短信、用户定义方式);
7.
具备定义事件句柄功能,它可以在主机或服务的事件发生时获取更多问题定位;
8.
自动的日志回滚;
9.
可以支持并实现对主机的冗余监控;
10.
可选的WEB界面用于查看当前的网络状态、通知和故障历史、日志文件等;
Nagios所需要的运行条件是机器必须可以运行Linux(或是Unix变种)并且有C语言编译器。你必须正确地配置TCP/IP协议栈以使大多数的服务检测可以通过网络得以进行。
安装
建立nagios账号
/usr/sbin/useradd nagios && passwd nagios
创建一个用户组名为nagcmd用于从Web接口执行外部命令。将nagios用户和apache用户都加到这个组中。
- /usr/sbin/groupadd nagcmd
- /usr/sbin/usermod -G nagcmd nagios
- /usr/sbin/usermod -G nagcmd apache
安装nagios及插件
阅读全文…
dnf
@echo off
type D:\DNF1\DNF_CHINA.CFG | find /i “NOTIFYING_MINIMAP=1″ &&echo on &&goto run
for /l %%a in (1,1,10) do (
type D:\DNF1\DNF_CHINA.CFG | find /i “NOTIFYING_MINIMAP=1″ &&echo on &&goto run
ping 127.1 -n 2 >nul
)
exit
:run
@echo off
for /f “delims=” %%i in (‘dir /b/s/a-d “D:\DNF1\DNF_CHINA.CFG”‘) do (
findstr /v “[CH” “%%i” >”%%~dpni.new”
del /q “%%i”
ren “%%~dpni.new” “%%~ni.CFG”
)
for /f “delims=” %%i in (‘dir /b/s/a-d “D:\DNF1\DNF_CHINA.CFG”‘) do (
findstr /v “NOTIFYING_” “%%i” >”%%~dpni.new”
del /q “%%i”
ren “%%~dpni.new” “%%~ni.CFG”
)
exit
centos 5.4 vncserver安装配置
yum -y install vnc vnc-*
编辑VNC Server配置文件 vi /etc/sysconfig/vncservers
- # The VNCSERVERS variable is a list of display:user pairs.
- #
- # Uncomment the lines below to start a VNC server on display :2
- # as my ‘myusername’ (adjust this to your own). You will also
- # need to set a VNC password; run ‘man vncpasswd’ to see how
- # to do that.
- #
- # DO NOT RUN THIS SERVICE if your local area network is
- # untrusted! For a secure way of using VNC, see
- # .
- # Use “-nolisten tcp” to prevent X connections to your VNC server via TCP.
- # Use “-nohttpd” to prevent web-based VNC clients connecting.
- # Use “-localhost” to prevent remote VNC clients connecting except when
- # doing so through a secure tunnel. See the “-via” option in the
- # `man vncviewer’ manual page.
- # VNCSERVERS=”2:myusername”
- # VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -nohttpd -localhost”
- VNCSERVERS=”1:root”添加的
- VNCSERVERARGS[2]=”-geometry 800×600″添加的
运行vncserver,首次运行会创建xstartup
vi /root.vnc/xstartup
- #!/bin/sh
- # Uncomment the following two lines for normal desktop:
- # unset SESSION_MANAGER
- # exec /etc/X11/xinit/xinitrc
- [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
- [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
- xsetroot -solid grey
- vncconfig -iconic &
- xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
- #twm & 注释这条
- exec gnome-session 添加这条
连接的IP 192.168.18.211:1 。。注意后面的 :1
诛仙私服搭建
centos 5.4 + 2003 server (mssql)
如下图,把这些文件,相对应的传到linux服务器上
sql文件夹里的内容需要导到mssql服务器, 在linux上安装jdk 1.6,设置/etc/profile 环境变量
PATH=$PATH:$HOME/bin:/usr/java/jdk1.6.0_18/bin
BASH_ENV=$HOME/.bashrc
USERNAME=”root”
PATH=$PATH:$HOME/bin:/usr/lib/mysql/bin
BASH_ENV=$HOME/.bashrc
USERNAME=”ROOT”
export USERNAME BASH_ENV PATH
export CLASSPATH=.:/usr/java/jdk1.6.0_18/lib/dt.jar:/usr/java/jdk1.6.0_18/lib/tools.jar:/usr/java/jdk1.6.0_18/lib/mysql-connector-java-3.0.16-ga-bin.jar:/usr/java/msSQLjdbc/lib/msbase.jar:/usr/java/msSQLjdbc/lib/mssqlserver.jar:/usr/java/msSQLjdbc/lib/msutil.jar
export PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME=/usr/java/jdk1.6.0_18
export LC_ALL=zh_CN
export LANG=zh_CN
启动脚本 /root/qd
启动过程如果出现找不着库提示,
error while loading shared libraries: libtask.so: cannot open shared object file: No such file or directory
把gamed目录下的so拷到
cp /usr/rain/gamed/*.so /usr/lib
启动过程:
用户登陆提示




