存档

‘√文章精选’ 分类的存档

xen安装配置

2010年3月29日 3 条评论

初次配置,我装了X11和VNCSERVER(vnc配置)。图形界面方便些。

1.安装xen
# yum -y install *
安装XEN需要的服务
# yum -y install kernel-xen*
安装管理程序
#yum -y install virt-manager

2.修改/etc/grub.conf ,用XEN内核启动

3.virt-manager管理界面

阅读全文…

安装、更新ports

2010年3月27日 没有评论

使用 安装/同步ports 系统
使用portsnap不需要事先安装 tree,并且能够在任何时候恢复到已知的最新状态(即使手工对ports tree进行了修改)。

第一次使用:portsnap fetch extract
以后使用更新:portsnap fetch update
放在cron里运行:portsnap cron

对比更新 vbs

2010年3月26日 没有评论
  1. Option Explicit
  2.  
  3. sub copyfol(sDir,Ddir)
  4.  'sDiry要对比的文件夹,,Ddir要操作文件夹
  5.    dim fso,fol,fs,f1, objfile
  6.    dim arrFiles(),arrSize(),arrModified()
  7.    dim i
  8.    if right(ddir,1)<>"\" then ddir =ddir & "\"
  9.    if right(sdir,1)<>"\" then sdir =sdir & "\"
  10.    Set fso = CreateObject("Scripting.FileSystemObject")
  11.    '判断文件是否存在
  12.    if not (fso.FolderExists(sdir))  then
  13.        msgbox "找不到文件夹:" & sdir
  14.        exit sub
  15.    end if
  16.    if not (fso.FolderExists(ddir))  then
  17.         msgbox "找不到文件夹:" & sdir
  18.         exit sub
  19.    end if
  20.  
  21.    '获得要操作的文件列表及相关信息并储存到数组
  22.    set fol=fso.GetFolder(ddir)
  23.    set fs=fol.files
  24.    i=0
  25.    redim arrFiles(fs.count-1)
  26.    redim arrSize(fs.count-1)
  27.    redim arrModified(fs.count-1)
  28.    for each f1 in fs
  29.       arrfiles(i)=f1.name
  30.       arrSize(i)=f1.size
  31.       arrModified(i)=f1.DateLastModified
  32.       i=i+1
  33.    next
  34.    '把要操作的文件夹逐一根要对比的文件比较,不同则覆盖,多余就删除,没有就复制
  35.    set fol=fso.GetFolder(sdir)
  36.    set fs=fol.files
  37.    for i = 0 to ubound(arrfiles)
  38.        '文件存在则比较是否相同,否则删除
  39.  
  40.        dim delfile  '要操作类型,
  41.        delfile=false
  42.        for each f1 in fs
  43.            if strcomp(arrfiles(i),f1.name,vbTextCompare)=0 then             
  44.                if arrsize(i)<> f1.size or arrModified(i)<>f1.DateLastModified then
  45.                   fso.copyfile f1.path, ddir & arrfiles(i),true       
  46.                end if
  47.                delfile=true '如果文件存在
  48.                exit for
  49.             end if
  50.         next
  51.         if not delfile then                 
  52.             set objfile=fso.getfile(ddir &arrfiles(i))
  53.             objfile.Delete (true)
  54.          end if         
  55.     next
  56.    '如果对比目录sdir中有文件是要操作目录ddir中没有的,则复制到ddir
  57.    for each f1 in fs
  58.        delfile=false
  59.        for i=0 to ubound(arrfiles)
  60.           if strcomp(f1.name,arrfiles(i),vbtextcompare)=0 then
  61.              delfile=true
  62.              exit for
  63.           end if
  64.         next
  65.          if right (ddir,1)<>"\" then ddir=ddir &"\"
  66.         if not delfile then         
  67.            f1.copy ddir,true
  68.         end if
  69.    next
  70.    '以下代码处理子文件夹 
  71.    dim fols
  72.    set fol=Fso.GetFolder(sdir)
  73.    set fols=fol.SubFolders
  74.    for each f1 in fols
  75.       if not (fso.FolderExists(ddir & f1.name)) then
  76.          fso.CreateFolder(ddir & f1.name)
  77.       end if
  78.       copyfol sdir & f1.name ,ddir & f1.name
  79.    next
  80. end sub
  81.  
  82.    '以下是对比路径 第一个是远程路径 第二个是本地路径
  83. copyfol "c:\viyin.net","C:\www.viyin.net"

nginx平台架设nagios

2010年3月23日 3 条评论

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 && passwd

创建一个用户组名为nagcmd用于从Web接口执行外部命令。将nagios用户和apache用户都加到这个组中。

  1. /usr/sbin/groupadd nagcmd
  2. /usr/sbin/usermod -G nagcmd nagios
  3. /usr/sbin/usermod -G nagcmd apache

安装nagios及插件
阅读全文…

dnf

2010年3月16日 没有评论

@echo off
type D:\1\_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安装配置

2010年3月10日 没有评论

yum -y install vnc-*

编辑VNC Server配置文件 vi /etc/sysconfig/vncservers

  1. # The VNCSERVERS variable is a list of display:user pairs.
  2. #
  3. # Uncomment the lines below to start a VNC server on display :2
  4. # as my ‘myusername’ (adjust this to your own). You will also
  5. # need to set a VNC password; run ‘man vncpasswd’ to see how
  6. # to do that.
  7. #
  8. # DO NOT RUN THIS SERVICE if your local area network is
  9. # untrusted! For a secure way of using VNC, see
  10. # .
  11.  
  12. # Use “-nolisten tcp” to prevent X connections to your VNC server via TCP.
  13.  
  14. # Use “-nohttpd” to prevent web-based VNC clients connecting.
  15.  
  16. # Use “-localhost” to prevent remote VNC clients connecting except when
  17. # doing so through a secure tunnel. See the “-via” option in the
  18. # `man vncviewer’ manual page.
  19.  
  20. # VNCSERVERS=”2:myusername”
  21. # VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -nohttpd -localhost”
  22.  
  23. VNCSERVERS=”1:root”添加的
  24. VNCSERVERARGS[2]=”-geometry 800×600″添加的

运行vncserver,首次运行会创建xstartup
vi /root.vnc/xstartup
 

  1. #!/bin/sh
  2. # Uncomment the following two lines for normal desktop:
  3. # unset SESSION_MANAGER
  4. # exec /etc/X11/xinit/xinitrc
  5.  
  6. [ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup
  7. [ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources
  8. xsetroot -solid grey
  9. vncconfig -iconic &amp;
  10. xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &amp;
  11. #twm &amp;          注释这条
  12. exec gnome-session 添加这条

连接的IP 192.168.18.211:1 。。注意后面的 :1

诛仙私服搭建

2010年3月2日 3 条评论

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

启动过程:

用户登陆提示

分类: √文章精选 标签: , ,