<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>XuRui &#187; Linux</title>
	<atom:link href="http://www.xurui.tk/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xurui.tk</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 03:45:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>squid 日志统计&#8211;请求域名的排序</title>
		<link>http://www.xurui.tk/2011/12/squid-%e6%97%a5%e5%bf%97%e7%bb%9f%e8%ae%a1-%e8%af%b7%e6%b1%82%e5%9f%9f%e5%90%8d%e7%9a%84%e6%8e%92%e5%ba%8f.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=squid-%25e6%2597%25a5%25e5%25bf%2597%25e7%25bb%259f%25e8%25ae%25a1-%25e8%25af%25b7%25e6%25b1%2582%25e5%259f%259f%25e5%2590%258d%25e7%259a%2584%25e6%258e%2592%25e5%25ba%258f</link>
		<comments>http://www.xurui.tk/2011/12/squid-%e6%97%a5%e5%bf%97%e7%bb%9f%e8%ae%a1-%e8%af%b7%e6%b1%82%e5%9f%9f%e5%90%8d%e7%9a%84%e6%8e%92%e5%ba%8f.html#comments</comments>
		<pubDate>Wed, 28 Dec 2011 01:42:18 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10117</guid>
		<description><![CDATA[##日志为combined模式 cat /usr/local/squid/var/logs/access.log &#124;awk '{print $7}'&#124;awk -F '/' '{print $3}'&#124;sort&#124; uniq -c&#124; sort -k 1 -n -r ###]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash; title: ;">
##日志为combined模式
cat /usr/local/squid/var/logs/access.log |awk '{print $7}'|awk -F '/'  '{print $3}'|sort| uniq -c| sort -k 1 -n -r
###
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/12/squid-%e6%97%a5%e5%bf%97%e7%bb%9f%e8%ae%a1-%e8%af%b7%e6%b1%82%e5%9f%9f%e5%90%8d%e7%9a%84%e6%8e%92%e5%ba%8f.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debian6上安装lnmp平台</title>
		<link>http://www.xurui.tk/2011/12/debian6%e4%b8%8a%e5%ae%89%e8%a3%85lnmp%e5%b9%b3%e5%8f%b0.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debian6%25e4%25b8%258a%25e5%25ae%2589%25e8%25a3%2585lnmp%25e5%25b9%25b3%25e5%258f%25b0</link>
		<comments>http://www.xurui.tk/2011/12/debian6%e4%b8%8a%e5%ae%89%e8%a3%85lnmp%e5%b9%b3%e5%8f%b0.html#comments</comments>
		<pubDate>Thu, 01 Dec 2011 02:52:54 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10103</guid>
		<description><![CDATA[最近要为监控系统写点php页面，所以开始现学php，当然要建立一个php的开发环境了， 系统当然选择debian了，重新在vbox里面装了虚拟机debian6，新的vbox4.1.6 支持了图形界面的端口转发，设置端口转发更方便了 步骤是 选择虚机，设置，网络，点击Port Forwording 设置几个，比vbox3.0 用命令设置方便多了。 debian6上安装lnmp平台 1.安装nginx： 下载nginx： 安装nginx： cd nginx-1.1.8/ ./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module --with-http_flv_module --with-http_dav_module --with-http_gzip_static_module --with-http_stub_status_module make install make cd ../ 3.安装mysql mysql 还是不编译算了 直接apt-get apt-get install mysql-server 3.安装php： php-fpm已经被php收编 在最新的php5.3版本中就可以使用了 wget http://cn2.php.net/distributions/php-5.3.7.tar.gz tar zxvf php-5.3.7.tar.gz cd php-5.3.7/ ./buildconf --force 先查看autoconf版本够不？ apt-get install autoconf2.13 再安装一些依赖关系： apt-get install libxslt1-dev libmcrypt-dev [...]]]></description>
			<content:encoded><![CDATA[<p>最近要为监控系统写点php页面，所以开始现学php，当然要建立一个php的开发环境了，<br />
系统当然选择debian了，重新在vbox里面装了虚拟机debian6，新的vbox4.1.6 支持了图形界面的端口转发，设置端口转发更方便了<br />
步骤是 选择虚机，设置，网络，点击Port Forwording 设置几个，比vbox3.0 用命令设置方便多了。</p>
<p>debian6上安装lnmp平台<br />
1.安装nginx：<br />
下载nginx：<br />
<span id="more-10103"></span><br />
安装nginx：</p>
<pre class="brush: bash; title: ;">
cd nginx-1.1.8/
./configure --prefix=/usr/local/nginx --with-http_realip_module  --with-http_sub_module --with-http_flv_module --with-http_dav_module --with-http_gzip_static_module --with-http_stub_status_module
make install
make
cd ../
</pre>
<p>3.安装mysql<br />
mysql 还是不编译算了<br />
直接apt-get<br />
apt-get install mysql-server</p>
<p>3.安装php：<br />
php-fpm已经被php收编<br />
在最新的php5.3版本中就可以使用了</p>
<pre class="brush: bash; title: ;">
wget http://cn2.php.net/distributions/php-5.3.7.tar.gz
tar zxvf php-5.3.7.tar.gz
cd php-5.3.7/
./buildconf --force
</pre>
<p>先查看autoconf版本够不？</p>
<pre class="brush: bash; title: ;">
apt-get install autoconf2.13
</pre>
<p>再安装一些依赖关系：</p>
<pre class="brush: bash; title: ;">
apt-get install libxslt1-dev libmcrypt-dev
 aptitude install libtidy-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev zlib1g zlib1g-dev libfreetype6 libfreetype6-dev libbz2-dev libxpm-dev libmcrypt-dev libmcrypt4 sqlite3 bzip2 build-essential libreadline5-dev libedit-dev
 ./configure  --prefix=/usr/local/php   --with-config-file-path=/usr/local/php/etc  --with-config-file-scan-dir=/usr/local/php/etc/conf.d  --enable-fpm       --with-curl       --with-pear       --with-gd   --with-jpeg-dir     --with-png-dir       --with-zlib       --with-xpm-dir       --with-freetype-dir       --with-mcrypt       --with-mhash       --with-mysql       --with-mysqli       --with-pdo-mysql       --with-openssl       --with-xmlrpc       --with-xsl       --with-bz2       --with-gettext       --disable-debug       --enable-fpm       --enable-exif       --enable-wddx       --enable-zip       --enable-bcmath       --enable-calendar       --enable-ftp       --enable-mbstring       --enable-soap       --enable-sockets       --enable-sqlite-utf8   --enable-shmop  --enable-dba  --enable-sysvsem   --enable-sysvshm       --enable-sysvmsg

 make
 make test
 make install
 cp  php.ini-production /usr/local/php/etc/
 cp  php.ini-production /usr/local/php/etc/php.ini
</pre>
<p>4.配置php 和php-fpm<br />
vi /usr/local/php/etc/php.ini</p>
<pre class="brush: plain; title: ;">
 [PHP]
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL &amp; ~E_DEPRECATED
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = Off
variables_order = &quot;GPCS&quot;
request_order = &quot;GP&quot;
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = &quot;text/html&quot;
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[Date]
[filter]
[iconv]
[intl]
[sqlite]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[Syslog]
define_syslog_variables  = Off
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = &quot;%Y-%m-%d %H:%M:%S&quot;
ibase.dateformat = &quot;%Y-%m-%d&quot;
ibase.timeformat = &quot;%H:%M:%S&quot;
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
session.entropy_length = 0
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = &quot;a=href,area=href,frame=src,input=src,form=fakeentry&quot;
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir=&quot;/tmp&quot;
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]
</pre>
<p>vi /usr/local/php/etc/php-fpm.conf</p>
<pre class="brush: plain; title: ;">
[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
log_level = notice
[www]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
listen.owner = nobody
listen.group = nobody
listen.mode = 0666
user = nobody
group = nobody
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
</pre>
<p>vi /etc/init.d/php-fpm</p>
<pre class="brush: bash; title: ;">
#!/bin/sh

    ### BEGIN INIT INFO
    # Provides:          php-fpm
    # Required-Start:    $remote_fs $network
    # Required-Stop:     $remote_fs $network
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: starts php-fpm
    # Description:       starts the PHP FastCGI Process Manager daemon
    ### END INIT INFO

    prefix=/usr/local/php
    exec_prefix=${prefix}

    php_fpm_BIN=${exec_prefix}/sbin/php-fpm
    php_fpm_CONF=${prefix}/etc/php-fpm.conf
    php_fpm_PID=${prefix}/var/run/php-fpm.pid

    php_opts=&quot;--fpm-config $php_fpm_CONF&quot;

    wait_for_pid () {
        try=0

        while test $try -lt 35 ; do

            case &quot;$1&quot; in
                'created')
                if [ -f &quot;$2&quot; ] ; then
                    try=''
                    break
                fi
                ;;

                'removed')
                if [ ! -f &quot;$2&quot; ] ; then
                    try=''
                    break
                fi
                ;;
            esac

            echo -n .
            try=`expr $try + 1`
            sleep 1

        done

    }

    case &quot;$1&quot; in
        start)
            echo -n &quot;Starting php-fpm &quot;

            $php_fpm_BIN $php_opts

            if [ &quot;$?&quot; != 0 ] ; then
                echo &quot; failed&quot;
                exit 1
            fi

            wait_for_pid created $php_fpm_PID

            if [ -n &quot;$try&quot; ] ; then
                echo &quot; failed&quot;
                exit 1
            else
                echo &quot; done&quot;
            fi
        ;;

        stop)
            echo -n &quot;Gracefully shutting down php-fpm &quot;

            if [ ! -r $php_fpm_PID ] ; then
                echo &quot;warning, no pid file found - php-fpm is not running ?&quot;
                exit 1
            fi

            kill -QUIT `cat $php_fpm_PID`

            wait_for_pid removed $php_fpm_PID

            if [ -n &quot;$try&quot; ] ; then
                echo &quot; failed. Use force-exit&quot;
                exit 1
            else
                echo &quot; done&quot;
            fi
        ;;

        force-quit)
            echo -n &quot;Terminating php-fpm &quot;

            if [ ! -r $php_fpm_PID ] ; then
                echo &quot;warning, no pid file found - php-fpm is not running ?&quot;
                exit 1
            fi

            kill -TERM `cat $php_fpm_PID`

            wait_for_pid removed $php_fpm_PID

            if [ -n &quot;$try&quot; ] ; then
                echo &quot; failed&quot;
                exit 1
            else
                echo &quot; done&quot;
            fi
        ;;

        restart)
            $0 stop
            $0 start
        ;;

        reload)

            echo -n &quot;Reload service php-fpm &quot;

            if [ ! -r $php_fpm_PID ] ; then
                echo &quot;warning, no pid file found - php-fpm is not running ?&quot;
                exit 1
            fi

            kill -USR2 `cat $php_fpm_PID`

            echo &quot; done&quot;
        ;;

        *)
            echo &quot;Usage: $0 {start|stop|force-quit|restart|reload}&quot;
            exit 1
        ;;

    esac
 </pre>
<p> /etc/init.d/php-fpm start</p>
<p> 可能会报错<br />
 nobody 用户组问题<br />
 groupadd nobody</p>
<p> 5.配置nginx+php-fpm<br />
 配置nginx：</p>
<pre class="brush: plain; title: ;">
worker_processes  4;
error_log  logs/error.log  info;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '
                      '$status $body_bytes_sent &quot;$http_referer&quot; '
                      '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';
    access_log  logs/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    gzip  on;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   /path/to/dev/php_dev;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /path/to/dev/php_dev$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
}
</pre>
<p>在/path/to/dev/php_dev下<br />
编辑phpinfo.php</p>
<pre class="brush: php; title: ;">
&lt;?php
    phpinfo();
?&gt;
</pre>
<p>浏览器测试。。。。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/12/debian6%e4%b8%8a%e5%ae%89%e8%a3%85lnmp%e5%b9%b3%e5%8f%b0.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debian 设置vi为crontab的默认编辑器</title>
		<link>http://www.xurui.tk/2011/09/debian-vi-crontab.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debian-vi-crontab</link>
		<comments>http://www.xurui.tk/2011/09/debian-vi-crontab.html#comments</comments>
		<pubDate>Tue, 06 Sep 2011 07:21:10 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10099</guid>
		<description><![CDATA[debian中设置vi为crontab的默认编辑器，debian中原本默认编辑器是nano，这个nano是个很残的编辑器， 只需要下面的命令，然后选择vim.basic 即可（debian5.x debian6.x 中实验通过）： xu:~# update-alternatives --config editor There are 4 alternatives which provide `editor'. Selection Alternative ----------------------------------------------- 1 /bin/ed *+ 2 /bin/nano 3 /usr/bin/vim.tiny 4 /usr/bin/vim.basic Press enter to keep the default[*], or type selection number: 4]]></description>
			<content:encoded><![CDATA[<p>debian中设置vi为crontab的默认编辑器，debian中原本默认编辑器是nano，这个nano是个很残的编辑器，</p>
<p>只需要下面的命令，然后选择vim.basic 即可（debian5.x debian6.x 中实验通过）：</p>
<pre class="brush: bash; title: ;">
xu:~# update-alternatives --config editor

There are 4 alternatives which provide `editor'.

  Selection    Alternative
-----------------------------------------------
          1    /bin/ed
*+        2    /bin/nano
          3    /usr/bin/vim.tiny
          4    /usr/bin/vim.basic

Press enter to keep the default[*], or type selection number: 4
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/09/debian-vi-crontab.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用xen-center安装debian</title>
		<link>http://www.xurui.tk/2011/08/%e7%94%a8xen-center%e5%ae%89%e8%a3%85debian.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e7%2594%25a8xen-center%25e5%25ae%2589%25e8%25a3%2585debian</link>
		<comments>http://www.xurui.tk/2011/08/%e7%94%a8xen-center%e5%ae%89%e8%a3%85debian.html#comments</comments>
		<pubDate>Thu, 18 Aug 2011 09:56:42 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10093</guid>
		<description><![CDATA[用xen-center安装debian 用xen-center安装debian太搞人了 试了debian的3种iso文件 都不行 最后试了网络安装 最后终于成功]]></description>
			<content:encoded><![CDATA[<p>用xen-center安装debian</p>
<p>用xen-center安装debian太搞人了<br />
试了debian的3种iso文件 都不行<br />
最后试了网络安装  最后终于成功</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/08/%e7%94%a8xen-center%e5%ae%89%e8%a3%85debian.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debian初始安装没有killall命令？</title>
		<link>http://www.xurui.tk/2011/08/debian_initinstall_has_no_killall.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debian_initinstall_has_no_killall</link>
		<comments>http://www.xurui.tk/2011/08/debian_initinstall_has_no_killall.html#comments</comments>
		<pubDate>Thu, 18 Aug 2011 09:27:55 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10091</guid>
		<description><![CDATA[debian初始安装没有killall命令？ 今天用xen-center安装了 一枚debian-lenny用作公司网站网页加载测试（基于python pyqt webkit） 进入系统发现没有killall命令 search 一下发现： pageload:~# apt-cache search killall psmisc &#8211; Utilities that use the proc filesystem sysvinit-utils &#8211; System-V-like utilities 应该是psmisc pageload:~# apt-get install psmisc bingo 搞定.]]></description>
			<content:encoded><![CDATA[<p>debian初始安装没有killall命令？</p>
<p>今天用xen-center安装了 一枚debian-lenny用作公司网站网页加载测试（基于python pyqt webkit）<br />
进入系统发现没有killall命令<br />
search 一下发现：<br />
pageload:~# apt-cache search killall<br />
psmisc &#8211; Utilities that use the proc filesystem<br />
sysvinit-utils &#8211; System-V-like utilities</p>
<p>应该是psmisc</p>
<p>pageload:~# apt-get install psmisc</p>
<p>bingo 搞定.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/08/debian_initinstall_has_no_killall.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6,IE7中iframe跨域导致session丢失问题</title>
		<link>http://www.xurui.tk/2011/07/ie6ie7%e4%b8%adiframe%e8%b7%a8%e5%9f%9f%e5%af%bc%e8%87%b4session%e4%b8%a2%e5%a4%b1%e9%97%ae%e9%a2%98.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ie6ie7%25e4%25b8%25adiframe%25e8%25b7%25a8%25e5%259f%259f%25e5%25af%25bc%25e8%2587%25b4session%25e4%25b8%25a2%25e5%25a4%25b1%25e9%2597%25ae%25e9%25a2%2598</link>
		<comments>http://www.xurui.tk/2011/07/ie6ie7%e4%b8%adiframe%e8%b7%a8%e5%9f%9f%e5%af%bc%e8%87%b4session%e4%b8%a2%e5%a4%b1%e9%97%ae%e9%a2%98.html#comments</comments>
		<pubDate>Mon, 18 Jul 2011 10:00:35 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10082</guid>
		<description><![CDATA[今天下午遇到的，试了几个浏览器发现只有IE6，IE7 才会出现这个问题，IE8 IE9 firefox chrome都木有这个问题。 问题原因： 因为一个集成网站的问题，在a网站上使用了iframe 引入B网站的内容，但是当时这个时候如果用IE6 和IE7 访问时候就会发现Iframe 居然丢失了session。 在google里面搜索了一段发发现是：IE6/IE7支持的P3P(Platform for Privacy Preferences Project (P3P) specification)协议默认阻止第三方无隐私安全声明的cookie。 firefox 和chrome不存在这个问题，IE8 和IE9 貌似也改了这个问题。 解决办法就是： 在B网站的web服务器输出html时候带上这样的响应头即可：&#8221;P3P&#8221;,&#8221;CP=CAO PSA OUR&#8221; lighttpd的服务器: server.modules = (&#8220;mod_setenv&#8221;) setenv.add-response-header = ( &#8220;P3P&#8221; => &#8220;CP=&#8217;CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR&#8217;&#8221;) apache的服务器: [...]]]></description>
			<content:encoded><![CDATA[<p>今天下午遇到的，试了几个浏览器发现只有IE6，IE7 才会出现这个问题，IE8 IE9 firefox chrome都木有这个问题。</p>
<p>问题原因：<br />
因为一个集成网站的问题，在a网站上使用了iframe 引入B网站的内容，但是当时这个时候如果用IE6 和IE7 访问时候就会发现Iframe 居然丢失了session。</p>
<p>在google里面搜索了一段发发现是：IE6/IE7支持的P3P(Platform for Privacy Preferences Project (P3P) specification)协议默认阻止第三方无隐私安全声明的cookie。 firefox 和chrome不存在这个问题，IE8 和IE9 貌似也改了这个问题。</p>
<p>解决办法就是：<br />
在B网站的web服务器输出html时候带上这样的响应头即可：&#8221;P3P&#8221;,&#8221;CP=CAO PSA OUR&#8221;<br />
lighttpd的服务器:<br />
server.modules    = (&#8220;mod_setenv&#8221;)<br />
setenv.add-response-header = ( &#8220;P3P&#8221; => &#8220;CP=&#8217;CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR&#8217;&#8221;)</p>
<p>apache的服务器:<br />
<VirtualHost><br />
Header set P3P &#8216;CP=&#8221;CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR&#8221;&#8216;<br />
</VirtualHost></p>
<p>IIS的服务器<br />
增加一个网站http头来解决问题；<br />
管理 工具——〉选择一个网站 ——〉属性——〉http头，增加一个http头<br />
然后输入头名：P3P<br />
输入头内容：CP=CAO PSA OUR</p>
<p>也可以实在在B网页上写上：<br />
可以直接在B网站中写入</p>
<pre class="brush: php; title: ;">
&lt;?php
header('P3P: CP=&quot;CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR&quot;')
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/07/ie6ie7%e4%b8%adiframe%e8%b7%a8%e5%9f%9f%e5%af%bc%e8%87%b4session%e4%b8%a2%e5%a4%b1%e9%97%ae%e9%a2%98.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>squid &#8220;DNS name lookup tests failed&#8221;</title>
		<link>http://www.xurui.tk/2011/07/squid-dns-name-lookup-tests-failed.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=squid-dns-name-lookup-tests-failed</link>
		<comments>http://www.xurui.tk/2011/07/squid-dns-name-lookup-tests-failed.html#comments</comments>
		<pubDate>Wed, 06 Jul 2011 09:04:44 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10079</guid>
		<description><![CDATA[&#8220;DNS name lookup tests failed&#8221; 默认情况下，squid在启动前执行一些DNS查询。这点确保你的DNS服务器可到达，并且运行正确。假如测试失败，可在cache.log或syslog里见到如下消息： FATAL: ipcache_init: DNS name lookup tests failed 假如你在内网里使用squid，squid可能不能查询到它的标准主机名列表。可使用dns_testnames指令来指定你自己的主机名。只要接受到响应，squid就会认为DNS测试成功。 假如你想完全跳过DNS测试，简单的在启动squid时，使用-D命令行选项： % squid -D &#8230;]]></description>
			<content:encoded><![CDATA[<p>&#8220;DNS name lookup tests failed&#8221;</p>
<p>默认情况下，squid在启动前执行一些DNS查询。这点确保你的DNS服务器可到达，并且运行正确。假如测试失败，可在cache.log或syslog里见到如下消息：</p>
<p>FATAL: ipcache_init: DNS name lookup tests failed</p>
<p>假如你在内网里使用squid，squid可能不能查询到它的标准主机名列表。可使用dns_testnames指令来指定你自己的主机名。只要接受到响应，squid就会认为DNS测试成功。</p>
<p>假如你想完全跳过DNS测试，简单的在启动squid时，使用-D命令行选项：</p>
<p>% squid -D &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/07/squid-dns-name-lookup-tests-failed.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell下的分割文件,合并文件</title>
		<link>http://www.xurui.tk/2011/06/shell-fenge-hebing-file.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=shell-fenge-hebing-file</link>
		<comments>http://www.xurui.tk/2011/06/shell-fenge-hebing-file.html#comments</comments>
		<pubDate>Thu, 30 Jun 2011 09:44:35 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10075</guid>
		<description><![CDATA[之前一直找某一个分割文件工具： 终于找到一款，linux下的， 我现在需求是，我有一个190多万行的文件： 我想分割成一个个小文件 每个一万行 split -l 10000 chinaip_24.txt ##这样默认是生成x开头的文件 xaa xab，其他系统我不知道至少debian系统上是这样； split -l 1000000 chinaip_24.txt china ##按指定前缀名称生成分割后的文件，这样生成chinaaa chinaab split -d -l 1000000 chinaip_24.txt chinaip ###-d选项 生产数字文件名文件 关于合并文件， 1. cat cat aaa bbb &#62;ccc #这样就把aaa bbb的文件内容合并到一个文件中了 2. paste paste aaa bbb ####就可以合并2个文件了]]></description>
			<content:encoded><![CDATA[<p>之前一直找某一个分割文件工具：<br />
终于找到一款，linux下的，<br />
我现在需求是，我有一个190多万行的文件：<br />
我想分割成一个个小文件 每个一万行</p>
<pre class="brush: bash; title: ;">
split  -l 10000 chinaip_24.txt
##这样默认是生成x开头的文件 xaa xab，其他系统我不知道至少debian系统上是这样；

split  -l 1000000 chinaip_24.txt china
##按指定前缀名称生成分割后的文件，这样生成chinaaa chinaab 

split -d -l 1000000 chinaip_24.txt chinaip
###-d选项 生产数字文件名文件
</pre>
<p>关于合并文件，<br />
1.  cat</p>
<pre class="brush: bash; title: ;">
cat aaa bbb &gt;ccc
#这样就把aaa bbb的文件内容合并到一个文件中了
</pre>
<p>2.  paste</p>
<pre class="brush: bash; title: ;">
paste aaa bbb
####就可以合并2个文件了
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/06/shell-fenge-hebing-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>按照ip地址排序</title>
		<link>http://www.xurui.tk/2011/06/sort-by-ip.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sort-by-ip</link>
		<comments>http://www.xurui.tk/2011/06/sort-by-ip.html#comments</comments>
		<pubDate>Mon, 27 Jun 2011 03:55:10 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10067</guid>
		<description><![CDATA[有一个这样的文本文件,内容如下： 1.0.2.0/24 本站主数据：福建省 电信 参考数据一：APNIC 1.0.50.0/24 本站主数据：广东省 电信 参考数据一：APNIC 1.0.52.0/24 本站主数据：广东省 电信 参考数据一：APNIC 1.0.51.0/24 本站主数据：广东省 电信 参考数据一：APNIC 1.0.53.0/24 本站主数据：广东省 电信 参考数据一：APNIC 1.0.54.0/24 本站主数据：广东省 电信 参考数据一：APNIC 1.0.56.0/24 本站主数据：广东省 电信 参考数据一：APNIC 需要安装ip地址排序： shell命令： sort -n -t. +0 -1 +1 -2 +2 -3 +3 -4 filename.txt]]></description>
			<content:encoded><![CDATA[<p>有一个这样的文本文件,内容如下：<br />
1.0.2.0/24 本站主数据：福建省 电信 参考数据一：APNIC<br />
1.0.50.0/24 本站主数据：广东省 电信 参考数据一：APNIC<br />
1.0.52.0/24 本站主数据：广东省 电信 参考数据一：APNIC<br />
1.0.51.0/24 本站主数据：广东省 电信 参考数据一：APNIC<br />
1.0.53.0/24 本站主数据：广东省 电信 参考数据一：APNIC<br />
1.0.54.0/24 本站主数据：广东省 电信 参考数据一：APNIC<br />
1.0.56.0/24 本站主数据：广东省 电信 参考数据一：APNIC</p>
<p>需要安装ip地址排序：<br />
shell命令：</p>
<pre class="brush: bash; title: ;">
sort -n -t. +0 -1 +1 -2 +2 -3 +3 -4 filename.txt
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/06/sort-by-ip.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>如何在redhat 5上使用CentOS的源</title>
		<link>http://www.xurui.tk/2011/06/redhat5-use-centos5-s-mirrors.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=redhat5-use-centos5-s-mirrors</link>
		<comments>http://www.xurui.tk/2011/06/redhat5-use-centos5-s-mirrors.html#comments</comments>
		<pubDate>Wed, 15 Jun 2011 09:03:25 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10057</guid>
		<description><![CDATA[在redhat5系上使用yum是要注册的，不过可以使用centos的源来更新redhat。 先删掉自带的yum： rpm -aq&#124;grep yum&#124;xargs rpm -e --nodeps （&#8211;nodeps：不考虑依赖，强制安装） 然后手动下载三个文件并安装：（如果遇到404 请去http://mirrors.163.com/centos/5/os/i386/CentOS/查找最新版本，因为163源每天都会有更新） wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm wget http://mirrors.163.com/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm yum-3.2.22-33.el5.centos.noarch.rpm --force --nodeps 编辑配置： vi /etc/yum.repos.d/CentOS-Base.repo [base] name=CentOS-5 - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&#38;arch=$basearch&#38; repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ baseurl=http://mirrors.163.com/centos/5/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 #released updates [update] name=CentOS-5 - Updates #mirrorlist=http://mirrorlist.centos.org/?release=4&#38;arch=$basearch&#38;repo=updates baseurl=http://mirrors.163.com/centos/5/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released [...]]]></description>
			<content:encoded><![CDATA[<p>在redhat5系上使用yum是要注册的，不过可以使用centos的源来更新redhat。<br />
先删掉自带的yum：</p>
<pre class="brush: bash; title: ;">
rpm -aq|grep yum|xargs rpm -e --nodeps
</pre>
<p>（&#8211;nodeps：不考虑依赖，强制安装）<br />
然后手动下载三个文件并安装：（如果遇到404 请去http://mirrors.163.com/centos/5/os/i386/CentOS/查找最新版本，因为163源每天都会有更新）</p>
<pre class="brush: bash; title: ;">
wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm

rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm yum-3.2.22-33.el5.centos.noarch.rpm --force --nodeps
</pre>
<p>编辑配置：</p>
<p>vi /etc/yum.repos.d/CentOS-Base.repo</p>
<pre class="brush: bash; title: ;">
[base]
name=CentOS-5 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&amp;arch=$basearch&amp;
repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://mirrors.163.com/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4&amp;arch=$basearch&amp;repo=updates
baseurl=http://mirrors.163.com/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4&amp;arch=$basearch&amp;repo=addons

baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4&amp;arch=$basearch&amp;repo=extras

baseurl=http://mirrors.163.com/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4&amp;arch=$basearch&amp;repo=centosplus
baseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4&amp;arch=$basearch&amp;repo=contrib
baseurl=http://mirrors.163.com/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
</pre>
<p>执行yum更新：</p>
<p>yum update</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/06/redhat5-use-centos5-s-mirrors.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在RHEL/centos5.2上升级python到2.5</title>
		<link>http://www.xurui.tk/2011/05/centos5-update-python-to-2-5.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=centos5-update-python-to-2-5</link>
		<comments>http://www.xurui.tk/2011/05/centos5-update-python-to-2-5.html#comments</comments>
		<pubDate>Wed, 25 May 2011 03:22:42 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10048</guid>
		<description><![CDATA[由于centos 5 上的python 默认是2.4 ，不支持pexpect库，加上python2.4也太老了，很多库很多方法都有不一样的地方 比如urlparse方法的返回的结果集在2.4上显示和2.5就不一样;所以还是升级为好。 wget http://python.org/ftp/python/2.5.6/Python-2.5.6c1.tgz tar zxvf Python-2.5.tgz cd Python-2.5 ./configure make make install mv /usr/bin/python /usr/bin/python_bak ln -s /usr/local/bin/python /usr/bin/python ###建立软连接，使系统默认的python指向python2.5 运行python -V检验当前环境十分为2.5版本 升级完成后，在REHL和centos5上面还会遇到yum无法工作的情况，这时候只需要做如下修改即可： vi /usr/bin/yum 将文本编辑显示的#/usr/bin/python修改为#/usr/bin/python2.4，保存修改即可]]></description>
			<content:encoded><![CDATA[<p>由于centos 5 上的python 默认是2.4 ，不支持pexpect库，加上python2.4也太老了，很多库很多方法都有不一样的地方<br />
比如urlparse方法的返回的结果集在2.4上显示和2.5就不一样;所以还是升级为好。</p>
<pre class="brush: plain; title: ;">
wget http://python.org/ftp/python/2.5.6/Python-2.5.6c1.tgz
tar zxvf Python-2.5.tgz
cd Python-2.5
./configure
make
make install
mv /usr/bin/python /usr/bin/python_bak
ln -s /usr/local/bin/python /usr/bin/python ###建立软连接，使系统默认的python指向python2.5
</pre>
<p>运行python -V检验当前环境十分为2.5版本</p>
<p>升级完成后，在REHL和centos5上面还会遇到yum无法工作的情况，这时候只需要做如下修改即可：<br />
vi /usr/bin/yum</p>
<p>将文本编辑显示的#/usr/bin/python修改为#/usr/bin/python2.4，保存修改即可</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/05/centos5-update-python-to-2-5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVS集群健康检查</title>
		<link>http://www.xurui.tk/2011/05/lvs-check-alive.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lvs-check-alive</link>
		<comments>http://www.xurui.tk/2011/05/lvs-check-alive.html#comments</comments>
		<pubDate>Tue, 24 May 2011 07:48:51 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10044</guid>
		<description><![CDATA[LVS 对健康检查相关选项： quiescent=yes 如果启用这个选项，它使ldirectord按时计算这个配置文件的md5校验和值，看其是否有改动，当发现有改动时自动应用那些改动，这个方便的 特性运行你容易地改变集群的配置，你对配置文件改动后几秒，ldirectord将察觉到有改动，调用ipvsadm命令实现改动，从有效服务器池中移除 quiescent=no 当一个节点在checktimeout设置的时间周期内没有响应是它是“静止的”（它的权重为0），当你设置了这个选项后，ldirectord将 会从IPVS表中移除真实服务器而不是“停止”它，从IPVS表移除节点将中断现有的客户端连接，并使LVS丢掉所有的连接跟踪记录和持续连接模板，如果 你不将这个选项设置为no，当某个节点崩溃时，对某些客户端计算机而言可能会显示为集群关闭了，因为在这个节点崩溃前这些客户端计算机被分配给它了，而连 接跟踪记录和程序连接模板仍然保留在Director上。]]></description>
			<content:encoded><![CDATA[<p>LVS 对健康检查相关选项：<br />
quiescent=yes<br />
如果启用这个选项，它使ldirectord按时计算这个配置文件的md5校验和值，看其是否有改动，当发现有改动时自动应用那些改动，这个方便的 特性运行你容易地改变集群的配置，你对配置文件改动后几秒，ldirectord将察觉到有改动，调用ipvsadm命令实现改动，从有效服务器池中移除<br />
quiescent=no<br />
当一个节点在checktimeout设置的时间周期内没有响应是它是“静止的”（它的权重为0），当你设置了这个选项后，ldirectord将 会从IPVS表中移除真实服务器而不是“停止”它，从IPVS表移除节点将中断现有的客户端连接，并使LVS丢掉所有的连接跟踪记录和持续连接模板，如果 你不将这个选项设置为no，当某个节点崩溃时，对某些客户端计算机而言可能会显示为集群关闭了，因为在这个节点崩溃前这些客户端计算机被分配给它了，而连 接跟踪记录和程序连接模板仍然保留在Director上。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/05/lvs-check-alive.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用nginx屏蔽非法信息的url</title>
		<link>http://www.xurui.tk/2011/05/nginx-deny-some-invalid-url.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx-deny-some-invalid-url</link>
		<comments>http://www.xurui.tk/2011/05/nginx-deny-some-invalid-url.html#comments</comments>
		<pubDate>Mon, 16 May 2011 09:46:51 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web.py]]></category>
		<category><![CDATA[restful]]></category>
		<category><![CDATA[urlparse]]></category>
		<category><![CDATA[非法]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10020</guid>
		<description><![CDATA[去年写的一个小脚本，当时需求是为了及时屏蔽掉非法信息url，待客服部门确认后，再解封或者继续封锁，免得网监拔线。 这个是最初的脚本，后来写了一个restful服务（web.py写的），便于公司内部客服管理系统使用，restful服务暂时不贴了 在本脚本中利用到python的urlparse方法来提取出链接的uri,这样方便替换： 关于urlparse的用法： 在这里直接粘贴的是ipython的交互式输入输出，各位看官相信也已了然了， In [1]: from urlparse import urlparse In [2]: out = urlparse('http://daxuxu.info/2011/05/nginx-deny-some-invalid-url.html') In [3]: out Out[3]: ParseResult(scheme='http', netloc='daxuxu.info', path='/2011/05/nginx-deny-some-invalid-url.html', params='', query='', fragment='') In [4]: out[0] Out[4]: 'http' In [5]: out[1] Out[5]: 'daxuxu.info' In [6]: out[2] Out[6]: '/2011/05/nginx-deny-some-invalid-url.html' 该功能脚本程序如下： #!/usr/bin/python # coding: UTF-8 #@author: rui.xu &#60;mrhaigui@gmail.com&#62; #Filename: import os import time import [...]]]></description>
			<content:encoded><![CDATA[<p>去年写的一个小脚本，当时需求是为了及时屏蔽掉非法信息url，待客服部门确认后，再解封或者继续封锁，免得网监拔线。<br />
这个是最初的脚本，后来写了一个restful服务（web.py写的），便于公司内部客服管理系统使用，restful服务暂时不贴了<br />
在本脚本中利用到python的urlparse方法来提取出链接的uri,这样方便替换：<br />
关于urlparse的用法：<br />
在这里直接粘贴的是ipython的交互式输入输出，各位看官相信也已了然了，</p>
<pre class="brush: python; title: ;">
In [1]: from urlparse import urlparse
In [2]: out = urlparse('http://daxuxu.info/2011/05/nginx-deny-some-invalid-url.html')

In [3]: out
Out[3]: ParseResult(scheme='http', netloc='daxuxu.info', path='/2011/05/nginx-deny-some-invalid-url.html', params='', query='', fragment='')

In [4]: out[0]
Out[4]: 'http'

In [5]: out[1]
Out[5]: 'daxuxu.info'

In [6]: out[2]
Out[6]: '/2011/05/nginx-deny-some-invalid-url.html'
</pre>
<p>该功能脚本程序如下：</p>
<pre class="brush: python; title: ;">
#!/usr/bin/python
# coding: UTF-8
#@author: rui.xu &lt;mrhaigui@gmail.com&gt;
#Filename:
import os
import time
import datetime
import sys
import re
from urlparse import urlparse

def update_conf(url):
	out= urlparse(url)
	uri=out[2]
	print uri
	#if tryUri(uri):
	#	print &quot;url is illegality&quot;
	#else:
	startTime = time.localtime()
	strStartTime = time.strftime('%Y%m%d%H%M%S', startTime)
	fileName = '/home/xr/url_filter_rest/'+'deny_'+strStartTime+'.conf'
	#fileName = 'deny_'+strStartTime+'.conf'
	f_ng_conf = open(fileName,'w')
	line1_head = 'if ($request_uri = &quot;'
	line1_end = '&quot;){'
	line1=line1_head+uri+line1_end
	#line2 =  '    return 403;'
	line2 = '    rewrite ^ http://www.domain.com/error.html;'
	line3 = '}'
	print line1
	print line2
	print line3
	f_ng_conf.write(line1+&quot;\n&quot;+line2+&quot;\n&quot;+line3+&quot;\n&quot;)
	f_ng_conf.close()
	return fileName

def tryUri(path):
	orc='css|js|css|png|jpeg|jpg|gif'
	if path == '/':
		return True
	if re.search(orc,path):
		print &quot;Match&quot;
		return True
	else:
		print &quot;Not Match&quot;
		return False

def main():
	inputUrl = sys.argv[1]
	update_conf(inputUrl)

if __name__ == '__main__':
	main()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/05/nginx-deny-some-invalid-url.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linux netstat 连接状态查看</title>
		<link>http://www.xurui.tk/2011/05/linux-netstat-status.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-netstat-status</link>
		<comments>http://www.xurui.tk/2011/05/linux-netstat-status.html#comments</comments>
		<pubDate>Mon, 16 May 2011 09:37:23 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10017</guid>
		<description><![CDATA[本文来自于高进波的博客 netstat -n &#124; awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 返回结果示例： LAST_ACK 1 SYN_RECV 1 CLOSE_WAIT 33 ESTABLISHED 217 FIN_WAIT1 15 FIN_WAIT2 16 TIME_WAIT 46697 状态：描述 CLOSED：无连接是活动的或正在进行 LISTEN：服务器在等待进入呼叫 SYN_RECV：一个连接请求已经到达，等待确认 SYN_SENT：应用已经开始，打开一个连接 ESTABLISHED：正常数据传输状态 FIN_WAIT1：应用说它已经完成 FIN_WAIT2：另一边已同意释放 ITMED_WAIT：等待所有分组死掉 CLOSING：两边同时尝试关闭 TIME_WAIT：另一边已初始化一个释放 LAST_ACK：等待所有分组死掉]]></description>
			<content:encoded><![CDATA[<p>本文来自于<a href="http://www.gaojinbo.com/linux%E8%BF%9E%E6%8E%A5%E7%8A%B6%E6%80%81netstat.html">高进波的博客</a></p>
<pre class="brush: bash; title: ;">
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
</pre>
<p>返回结果示例：</p>
<p>LAST_ACK 1<br />
SYN_RECV 1<br />
CLOSE_WAIT 33<br />
ESTABLISHED 217<br />
FIN_WAIT1 15<br />
FIN_WAIT2 16<br />
TIME_WAIT 46697<br />
状态：描述<br />
CLOSED：无连接是活动的或正在进行<br />
LISTEN：服务器在等待进入呼叫<br />
SYN_RECV：一个连接请求已经到达，等待确认<br />
SYN_SENT：应用已经开始，打开一个连接<br />
ESTABLISHED：正常数据传输状态<br />
FIN_WAIT1：应用说它已经完成<br />
FIN_WAIT2：另一边已同意释放<br />
ITMED_WAIT：等待所有分组死掉<br />
CLOSING：两边同时尝试关闭<br />
TIME_WAIT：另一边已初始化一个释放<br />
LAST_ACK：等待所有分组死掉</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/05/linux-netstat-status.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>shell命令行下的光标移动等操作快捷键</title>
		<link>http://www.xurui.tk/2011/05/shell-guangbiao-kuaijiejia.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=shell-guangbiao-kuaijiejia</link>
		<comments>http://www.xurui.tk/2011/05/shell-guangbiao-kuaijiejia.html#comments</comments>
		<pubDate>Mon, 16 May 2011 09:36:06 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=10015</guid>
		<description><![CDATA[(注意下面的”前”都是指”左”或”上”，”后”是”右”或”下”) C-r 查找历史执行命令，很便捷的调用历史命令的方式，输入历史命令关键字，就会及时显示匹配命令，enter 即可执行 C-p 前一条指令 C-n 后一条指令 C-c 终止已经运行的命令(针对还没有运行完的命令和脚本，实际为向相关进程发送中断信号)或者取消已经输入的命令 C-o/C-j/C-m 执行当前行输入的命令，跟 enter 类似 C-l 清屏，clear 命令 C-a 移动光标到行首 C-e 移动光标到行尾 C-t 交换光标前俩字符的位置 C-h 往后删除一字符 C-d 往前删除一字符 C-b 往后移动一个字符 C-f 往前移动一个字符 下面几个操作原理估计类似 emacs 的 yank 操作，可以理解为一套独立的粘贴板机制: C-w 剪切前一个单词(空格间隔的字符串单元) C-u 剪切到行首 C-k 剪切到行尾 C-y 粘贴剪切]]></description>
			<content:encoded><![CDATA[<p>(注意下面的”前”都是指”左”或”上”，”后”是”右”或”下”)</p>
<p>C-r 查找历史执行命令，很便捷的调用历史命令的方式，输入历史命令关键字，就会及时显示匹配命令，enter 即可执行<br />
C-p 前一条指令<br />
C-n 后一条指令<br />
C-c 终止已经运行的命令(针对还没有运行完的命令和脚本，实际为向相关进程发送中断信号)或者取消已经输入的命令<br />
C-o/C-j/C-m 执行当前行输入的命令，跟 enter 类似<br />
C-l 清屏，clear 命令</p>
<p>C-a 移动光标到行首<br />
C-e 移动光标到行尾</p>
<p>C-t 交换光标前俩字符的位置<br />
C-h 往后删除一字符<br />
C-d 往前删除一字符<br />
C-b 往后移动一个字符<br />
C-f 往前移动一个字符</p>
<p>下面几个操作原理估计类似 emacs 的 yank 操作，可以理解为一套独立的粘贴板机制:<br />
C-w 剪切前一个单词(空格间隔的字符串单元)<br />
C-u 剪切到行首<br />
C-k 剪切到行尾<br />
C-y 粘贴剪切</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2011/05/shell-guangbiao-kuaijiejia.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>graphviz dot简介</title>
		<link>http://www.xurui.tk/2010/11/graphviz_dot.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphviz_dot</link>
		<comments>http://www.xurui.tk/2010/11/graphviz_dot.html#comments</comments>
		<pubDate>Mon, 29 Nov 2010 08:24:17 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=177</guid>
		<description><![CDATA[dot 语言简洁]]></description>
			<content:encoded><![CDATA[<p>dot语言介绍</p>
<h1>1.介绍</h1>
<p>Graphviz 的好处在于，你只需要关心数据结构的流程，或者连接的方式，而不需要考虑布局。这是经典的*nix的程序的工作方式，比如latex,  mate等等，都是采用这种方式来工作的。既可以达到WYTIWYG（What you think is what you  get），而不是微软所提倡的WYSIWYG（What you see is what you  get）。而dot则是graphviz中的默认布局方式。<br />
dot是一门非常有意思的语言，它能够方便的通过文字描述绘制图片。<br />
每种工具都有自己的适用场景的，那么dot语言的适用场景是什么呢？我认为是不复杂的流程图和架构图设计<br />
为什么这么说？在画架构图的时候，我们希望在设计架构的过程中，不需要时刻考虑排版问题，而是考虑到架构的本质。<br />
当设计完成之后，我们希望能够根据我们的思路自动生成一副图出来。这样让我们专心做事。<br />
<span id="more-177"></span></p>
<h1>例子</h1>
<p>那么dot是不是真的那么神奇，能将我们所想的画出来？我们先看看dot的语法<br />
digraph G {<br />
main -&gt; parse -&gt; execute;<br />
main -&gt; init;<br />
main -&gt; cleanup;<br />
execute -&gt; make_string;<br />
execute -&gt; printf;<br />
init -&gt; make_string;<br />
main -&gt; printf;<br />
execute -&gt; compare;<br />
}<br />
保存为g1.dot<br />
生成图片：dot -Tpng g1.dot &gt;g1.png<br />
-T 输出图片格式，这里选用png。<br />
生成图片如右图。</p>
<p>2.绘图相关属性：<br />
2.1  node节点描述<br />
<img src="https://lh3.googleusercontent.com/z3hvicRdNHQFIw4lEWwr73l5-iivAgxDDdjISCR2cCMzrboNTSS0iJE6NTuyLTPa7EXgWWZDs8kjltfa8JdqbqgucDgz7pv-naBYogq5JRIY3j8PMZtzYcw_tChW" alt="" width="451px;" height="536px;" /><img src="https://lh5.googleusercontent.com/Xd5hYKRfGYPHwvKa9GclynFw-nZr1z0r5RTDyQpArKO5Jb3i6LooEmQykbP5bQPwZHT2ZTNMz4fVR0oEkAYChLIso3goqNGzQkIkzGjNprDkTSu59G6dniZ_Q9RD" alt="" width="434px;" height="289px;" /><br />
node（节点）一般默认为ellipse形状, 宽度.75, 高度.5   ，虽然上述节点形状很多，估计看着也眼花，当时常用就以下4个：<br />
box<br />
circle<br />
record<br />
plaintext</p>
<p>faq:<br />
如何添加node 形状信息<br />
node1[shape=box];  设置节点的形状为box。<br />
node1[label=”点1”];设置节点的名字为“点1”</p>
<p>node的显示名字：<br />
node节点可以用label来声明node节点的名字。<br />
fifod1[label=“fifod”];</p>
<p>2.2 dir关系<br />
dir关系是dot语言中比较重要的一环<br />
比如T-&gt;H；<br />
&#8220;forward&#8221;  ：<img src="https://lh4.googleusercontent.com/p9JVWklBEuJXKV5bb7NHRqO1fS4ciMR-PJX-hRQFMMj7yrIOmNKPLtB0-SB-I8Ob0RSrRSdsFN1Ef_Dmf1xaqOUBXtq7ptvDOj2OUeh8dhBLCOWd-ZgY60zCcIF1" alt="" width="203px;" height="59px;" /></p>
<p>&#8220;back&#8221; ：      <img src="https://lh4.googleusercontent.com/nTUlWWDj7eWv37t8NS5rTuYJMm5Q21wnKTFtgdkaCnxUZ6h57SuW3M_fRksVmEtiLX60V2JANSdnrJV4I7EuttOyRtCPMiwd6h3R7C6C9r1q-eofFnVN5kVqA8xH" alt="" width="203px;" height="59px;" /></p>
<p>”both“：         <img src="https://lh6.googleusercontent.com/zO7DetD3mWQoZ5PPvg7m6qOxJMbUtiOmhMAI4hDjFMNq34f_7XcjY4b-KXPLhP61YUgB6UjSjMMRphQ5IyH7o5_EPbkwk023SibXkVsBlZ3BSbe0y6yzwH7hsIrm" alt="" width="203px;" height="59px;" /></p>
<p>&#8220;none&#8221;：        <img src="https://lh5.googleusercontent.com/3FzU1xNw_Y6HaSTfBOyZSKCKDwoYzStiBoFn5bq-lb5Dm2z1l3tZ21UiUOy-BPRbKkv6uLhpb8UIFnjvbqxAnqi-2wpeCTxB02zujfqV2_LemPWP9IsvWr_AuQKy" alt="" width="203px;" height="59px;" /></p>
<p>在dot中定义dir属性：<br />
T-&gt;H[dir=back];</p>
<p>2.3连接点的方向</p>
<p>我们可以用“n”,”ne”,”e”,””se”, “sw”,”w”,”nw”,<br />
分别表示冲哪一个方向连接这个节点（图形）-“north, northeast……”<br />
如下的dot代码：</p>
<pre class="brush: java; title: ;">
digraph G{
//b-&gt;c[tailport = se];
b-&gt;c:se;
}
</pre>
<p>箭头指向c的东南方向<br />
如图为：<img src="https://lh5.googleusercontent.com/C73S9LrBhq-ar1l6uSwfvoy--4MkQ_vgWAC3G0Zu3hBxZFXXHwly0kbBlmTbx581Emtb_lnaOYrT9vENandoLfswSDQAUOxRTl_32uKY24hr2uq2Qj2px1m8vOvk" alt="" width="103px;" height="155px;" /></p>
<p>其他方向如有兴趣可以把剩下的7个不同方向都试试。</p>
<p>2.4  label 属性<br />
label 可以用来指示连接线的属性，也可以用来指定node的名字；</p>
<p>3 子图，点线的位置：<br />
默认时图中的线都是从上到下的，我们可以将其改为从左到右，在文件的最上层打入rankdir=LR就是从左到右，默认是TB(top -&gt; bottom)，也可以是RL，BT。<br />
当图中时间表之类的东西时，我们会需要点能排在一行（列），这时要用到rank，用花括号把rank=same，然后把需要并排的点一次输入。</p>
<pre class="brush: java; title: ;">

digraph cs_version {
rankdir=LR;
{
node[shape = plaintext];
2000-&gt;2001-&gt;2002-&gt;2003;
}
{
node[shape = box, style = filled];
1.0-&gt;1.3-&gt;1.5-&gt;1.6;
1.0-&gt;1.1
}
{rank=same;2000;1.0}
{rank=same;2001;1.1;1.3}
{rank=same;2002;1.5}
{rank=same;2003;1.6}</pre>
<p>}<img src="https://lh3.googleusercontent.com/00zh0deoFHYtngUhz-dbyeOz-c72TiND6BOXKZHoNhezC3RU4M6RbiFz95AgpgX3GqRjvYGpiFJUzD3xRlM6dDeE6LWfj1cQ7IfsZD8KDEsxOXpGe62XJvQyZCXs" alt="" width="443px;" height="203px;" /></p>
<p>子图：<br />
画一个子图就是subgraph cluster#，必须有cluster前缀。</p>
<pre class="brush: java; title: ;">

digraph G {
subgraph cluster0 {
node [style=filled,color=white];
style=filled;
color=lightgrey;
a0 -&gt; a1 -&gt; a2 -&gt; a3;
label = &quot;process #1&quot;;
}
subgraph cluster1 {
node [style=filled];
b0 -&gt; b1 -&gt; b2 -&gt; b3;
label = &quot;process #2&quot;;
color=blue
}
start -&gt; a0;
start -&gt; b0;
a1 -&gt; b3;
b2 -&gt; a3;
a3 -&gt; a0;
a3 -&gt; end;
b3 -&gt; end;
start [shape=Mdiamond];
end [shape=Msquare];
}</pre>
<p><img src="https://lh6.googleusercontent.com/6jflmikrzNTf9uLVfr4f_pWsMlZpCGWdlrpmYUI4nvoRIVcylyUqMvCtrMZZIVZiZWo-fgYyugi3YHX3H0zlMKXg448l9SbGMAREGziaqSrxs7yKPQElKuSgth1f" alt="" width="299px;" height="547px;" /><br />
当你想把一条边连到一个子图的边界上，先输入compound = true，然后就能用lhead和ltail来设置连接的子图了。<img src="https://lh4.googleusercontent.com/aCm5aqyO6u1P3x3bJRQ0BewSMYVs0EsccenspzDAhAMl2AyVttt6HJlwJ0A-xjoRSvgQP1WIa23q9Uq7hINbPliHD0fr0wkA_-DUcdlZFQpSuR03QAzqiQmJllM1" alt="" width="580px;" height="408px;" /><br />
附录：内容引用来源：</p>
<p>http://www.graphviz.org/pdf/dotguide.pdf</p>
<p>http://www.graphviz.org/doc/info/shapes.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/11/graphviz_dot.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debian包管理工具-dpkg</title>
		<link>http://www.xurui.tk/2010/11/debiandpkg.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debiandpkg</link>
		<comments>http://www.xurui.tk/2010/11/debiandpkg.html#comments</comments>
		<pubDate>Mon, 29 Nov 2010 07:01:53 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=164</guid>
		<description><![CDATA[debian dpkg]]></description>
			<content:encoded><![CDATA[<p>dpkg 是debian的软件包管理工具，<br />
dpkg是Debian软件包管理系统的中流砥柱,负责安全卸载软件包,配置,以及维护已安装的软件包.也是Debian系统中众多软件包管理工具的后端.有关dpkg的更多介绍参阅:http://www.dpkg.org</p>
<p>系统中所有packages的信息都在/var/lib/dpkg/目录下,其中子目录”/var/lib/dpkg/info”用于保存各个软件包的配置文件列表.<br />
<span id="more-164"></span><br />
.conffiles 记录了软件包的配置文件列表</p>
<p>.list 保存软件包中的文件列表,用户可以从.list的信息中找到软件包中文件的具体安装位置.</p>
<p>.md5sums 记录了软件包的md5信息,这个信息是用来进行包验证的.</p>
<p>.prerm 脚本在Debian报解包之前运行,主要作用是停止作用于即将升级的软件包的服务,直到软件包安装或升级完成.</p>
<p>.postinst脚本是完成Debian包解开之后的配置工作,通常用于执行所安装软件包相关命令和服务重新启动.</p>
<p>/var/lib/dpkg/available文件的内容是软件包的描述信息,该软件包括当前系统所使用的Debian安装源中的所有软件包,其中包括当前系统中已安装的和未安装的软件包.</p>
<p>查询当前系统所有已安装的deb包</p>
<p>pkg –l 命令用于查询当前系统所有以安装的deb包的信息.,通过less和grep可以执行更复杂的查询工作.</p>
<p>例如查找跟vim有关的软件包,dpkg –l |grep –ivim</p>
<p>查看已安装软件包的详细情况</p>
<p>dpkg –s 命令查看软件包的详细情况,包括版本,依赖之类的</p>
<p>查询系统中所安装软件包所安装的文件</p>
<p>dpkg –L 命令用于查询系统中所安装软件包的安装的文件安装到系统的位置和安装了那些.</p>
<p>dpkg -L package-name|more</p>
<p>查询系统中某个文件属于那个软件包</p>
<p>dpkg –S 命令用于了解当前的软件属于那个软件包</p>
<p>查询未安装的信息</p>
<p>dpkg –I 命令用于查看未安装软件包的详细信息,以便了解该软件包是否需要安装.</p>
<p>查询deb包文件中所包含的文件</p>
<p>dpkg –c  显示未安装deb软件包所包含的文件列表,以及安装位置</p>
<p>安装deb软件包</p>
<p>dpkg –i 手工安装deb包到系统中,不过有时会存在Dpends关系,建议使用apt-get 来安装.</p>
<p>如果通过dpkg –i安装软件后由于Dpends关系没有安装成功,可通过apt-get –f install解决</p>
<p>解决dpkg –i 安装deb包出现Dpends问题</p>
<p>apt-get –f install 解决Dpends问题.</p>
<p>卸载deb包</p>
<p>dpkg –r用于卸载指定的软件包,该命令只卸载软件包安装到系统中的文件,而不去删除软件包的配置文件,因此不是完全意义上的卸载.但是软件包保存在系统中,可以提供给以后在安装软件包时使用.</p>
<p>例如:dpkg –r prozilla 移除后再用dpkg –l |grep prozilla 查看</p>
<p>会看到rc   proc  1.3.6-3woody3   multi-thraded download accelerator</p>
<p>表示软件包已经被卸载,但配置文件仍在“rc”带表配置文件仍在.</p>
<p>卸载软件包并清除配置文件</p>
<p>dpkg –P 用于卸载软件包同时也删除配置文件,dpkg –P 不能解决Dpends问题,建议卸载时使用apt-get操作</p>
<p>重新配置软件包</p>
<p>对于Debian系统中的众多软件包(尤其是系统和服务器软件包)来说,在第一次安装该软件包时候会显示对话框窗口,提示用户输入必要的配置信息.当用户需要再次对软件包配置的时候,可以使用dpkg-reconfigure来对指定的软件包进行配置.</p>
<p>dpkg-reconfigure locales 用于配置语言</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/11/debiandpkg.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于nginx的proxy_set_header</title>
		<link>http://www.xurui.tk/2010/11/about_nginx_proxy_set_header.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=about_nginx_proxy_set_header</link>
		<comments>http://www.xurui.tk/2010/11/about_nginx_proxy_set_header.html#comments</comments>
		<pubDate>Mon, 29 Nov 2010 06:38:34 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=153</guid>
		<description><![CDATA[nginx  proxy_set_header]]></description>
			<content:encoded><![CDATA[<p>上周搭建nginx proxy<br />
出现了莫名的错误：squid收到了错误的请求header<br />
最后这样修改nginx的proxy设置才得以解决</p>
<pre class="brush: bash; title: ;">
proxy_set_header Host $host:80;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/11/about_nginx_proxy_set_header.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux下随机密码生成工具</title>
		<link>http://www.xurui.tk/2010/11/linux_create_pwd.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux_create_pwd</link>
		<comments>http://www.xurui.tk/2010/11/linux_create_pwd.html#comments</comments>
		<pubDate>Mon, 29 Nov 2010 05:23:15 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=135</guid>
		<description><![CDATA[给几个朋友开ssh工具，需要生成随机密码。 之前用python写了个脚本生成一个字符串，觉得不太好用 就通过伟大的google搜索发现这个工具不错： linux下一个叫做pwgen的工具，我在debian下安装 使用的，其他linux发行版请自己探索安装方法 安装： $ sudo apt-get install pwgen 使用： 用预设值产生密码: $ pwgen pwgen产生1组长度为6字元的密码: $ 6 1 密码里不要有大写字母: $ pwgen -A 密码里至少有一个符号字元: $ pwgen -y 10 1 生成完全意义的随机密码： $ pwgen -s 10 1 总之使用相当简单，当然如果你要开启大批帐号，那就方便多了。]]></description>
			<content:encoded><![CDATA[<p>给几个朋友开ssh工具，需要生成随机密码。<br />
之前用python写了个脚本生成一个字符串，觉得不太好用<br />
就通过伟大的google搜索发现这个工具不错：<br />
linux下一个叫做pwgen的工具，我在debian下安装 使用的，其他linux发行版请自己探索安装方法<br />
安装：</p>
<pre class="brush: bash; title: ;">
$ sudo apt-get install pwgen
</pre>
<p>使用：<br />
用预设值产生密码:</p>
<pre class="brush: bash; title: ;">
$ pwgen
</pre>
<p>pwgen产生1组长度为6字元的密码:<br />
$ 6 1</p>
<p>密码里不要有大写字母:</p>
<pre class="brush: bash; title: ;">
$ pwgen -A
</pre>
<p>密码里至少有一个符号字元:</p>
<pre class="brush: bash; title: ;">
$ pwgen -y 10 1
</pre>
<p>生成完全意义的随机密码：</p>
<pre class="brush: bash; title: ;">
$ pwgen -s 10 1
</pre>
<p>总之使用相当简单，当然如果你要开启大批帐号，那就方便多了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/11/linux_create_pwd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/var/spool/clientmqueue  爆满问题</title>
		<link>http://www.xurui.tk/2010/04/clientmqueue_is_full.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clientmqueue_is_full</link>
		<comments>http://www.xurui.tk/2010/04/clientmqueue_is_full.html#comments</comments>
		<pubDate>Thu, 08 Apr 2010 02:57:44 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=108</guid>
		<description><![CDATA[原文链接：www.sanotes.net/html/y2008/109.html 当你使用简单的sendmail发邮件的时候，或者系统默认要发一些邮件（比如cron发的邮件）的时候，首先会把邮件拷贝到这个目录里，然后等待 MTA(mail transfer agent) 来处理，MTA做的事情通常是把这个目录中的邮件弄到/var/spool/mqueue里，然后再发送到真正的目的地。出现/var/spool /clientmqueue/非常大的情况通常因为没有合适的MTA发送邮件，就都积累在这里了，假如这里的邮件并不是你需要的，比如是系统默认发的每分 钟跑一次的什么什么cron的信，你可以简单的删掉他们。当然，文件多了一些，直接rm -f *，系统可能会说argument too long什么的，没有关系，find /var/spool/clientmqueue/ -type f –delete或者find /var/spool/clientmqueue/ -type f -exec rm {} \+可能对你有帮助，当然这两条命令要求find的版本比较新。如果不幸你的版本比较低，可以尝试find /var/spool/clientmqueue/ -type f -exec rm {} \; 原因分析：系统中有用户开启了cron，而cron中 执行的程序有输出内容，输出内容会以邮件形式发给cron的用户，而sendmail没有启动所以就产生了这些文件； 解决办法: 1、 将crontab里面的命令后面加上&#62; /dev/null 2&#62;&#38;1 2、知识点： 2&#62;：重定向错误。 2&#62;&#38;1：把错误重定向到输出要送到的地方。即把上述命令的执行结果重定向到/dev/null，即抛弃，同时，把产生的错误也抛弃。 3、具体代码： （1）、# crontab -u cvsroot -l 01 01 * * * /opt/bak/backup 01 02 * [...]]]></description>
			<content:encoded><![CDATA[<p>原文链接：<cite>www.sanotes.net/html/y2008/109.html</cite></p>
<p>当你使用简单的sendmail发邮件的时候，或者系统默认要发一些邮件（比如cron发的邮件）的时候，首先会把邮件拷贝到这个目录里，然后等待 MTA(mail transfer agent)  来处理，MTA做的事情通常是把这个目录中的邮件弄到/var/spool/mqueue里，然后再发送到真正的目的地。出现/var/spool /clientmqueue/非常大的情况通常因为没有合适的MTA发送邮件，就都积累在这里了，假如这里的邮件并不是你需要的，比如是系统默认发的每分 钟跑一次的什么什么cron的信，你可以简单的删掉他们。当然，文件多了一些，直接rm -f *，系统可能会说argument too  long什么的，没有关系，find /var/spool/clientmqueue/ -type f –delete或者find  /var/spool/clientmqueue/ -type f -exec rm {}  \+可能对你有帮助，当然这两条命令要求find的版本比较新。如果不幸你的版本比较低，可以尝试find  /var/spool/clientmqueue/ -type f -exec rm {} \;</p>
<p><span style="font-size: x-small;"><span style="color: #0000ff;">原因分析：</span>系统中有用户开启了cron，而cron中 执行的程序有输出内容，输出内容会以邮件形式发给cron的用户，而sendmail没有启动所以就产生了这些文件；<br />
</span><span style="font-size: x-small;"><span style="color: #0000ff;">解决办法:</span> 1、  将crontab里面的命令后面加上&gt; /dev/null 2&gt;&amp;1</span></p>
<p><span style="font-size: x-small;">2、知识点：</span></p>
<p><span style="font-size: x-small;">2&gt;：重定向错误。<br />
2&gt;&amp;1：把错误重定向到输出要送到的地方。即把上述命令的执行结果重定向到/dev/null，即抛弃，同时，把产生的错误也抛弃。</span></p>
<p><span style="font-size: x-small;">3、具体代码：</span></p>
<p><span style="font-size: x-small;">（1）、# crontab -u cvsroot -l<br />
01 01 * * * /opt/bak/backup<br />
01 02 * * * /opt/bak/backup2<br />
（2）、# vi /opt/bak/backup</span></p>
<p><span style="font-size: x-small;">#!/bin/sh</span></p>
<p><span style="font-size: x-small;">cd /<br />
getfacl -R repository &gt; /opt/bak/backup.acl<br />
（3）、# vi /opt/bak/backup2</span></p>
<p><span style="font-size: x-small;">#!/bin/sh</span></p>
<p><span style="font-size: x-small;">week=`date +%w`<br />
tar zcvfp /opt/bak/cvs$week/cvs.tar.gz /repository &gt;/dev/null  2&gt;&amp;1</span></p>
<p><span style="font-size: x-small;">4、清除/var/spool/clientmqueue/目录下的文件：</span></p>
<p><span style="font-size: x-small;"># cd /var/spool/clientmqueue</span></p>
<p><span style="font-size: x-small;"># rm -rf *</span></p>
<p><span style="font-size: x-small;">如果文件太多，占用空间太大，用上面命令删除慢的话，就执行下面的命令：</span></p>
<p><span style="font-size: x-small;"># cd /var/spool/clientmqueue</span></p>
<p><span style="font-size: x-small;"># ls | xargs rm -f </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/04/clientmqueue_is_full.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux启动过程</title>
		<link>http://www.xurui.tk/2010/04/linuxboot.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linuxboot</link>
		<comments>http://www.xurui.tk/2010/04/linuxboot.html#comments</comments>
		<pubDate>Tue, 06 Apr 2010 04:50:19 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=102</guid>
		<description><![CDATA[原文链接：http://roclinux.cn/?p=1301 启动第一步－－加载BIOS 当你打开计算机电源，计算机会首先加载BIOS信息，BIOS信息是如此的重要，以至于计算机必须在最开始就找到它。这是因为BIOS中包含了 CPU的相关信息、设备启动顺序信息、硬盘信息、内存信息、时钟信息、PnP特性等等。在此之后，计算机心里就有谱了，知道应该去读取哪个硬件设备了。 启动第二步－－读取MBR 众所周知，硬盘上第0磁道第一个扇区被称为MBR， 也就是Master Boot Record，即主引导记录，它的大小是512字节，别看地方不大，可里面却存放了预启动信息、分区表信息。 系统找到BIOS所指定的硬盘的MBR后，就会将其复制到0×7c00地址所在的物理内存中。其实被复制到物理内存的内容就是Boot Loader，而具体到你的电脑，那就是lilo或者grub了。 启动第三步－－Boot Loader Boot Loader 就是在操作系统内核运行之前运行的一段小程序。通过这段小程序，我们可以初始化硬件设备、建立内存空间的映射图，从而将系统的软硬件环境带到一个合适的状 态，以便为最终调用操作系统内核做好一切准备。 Boot Loader有若干种，其中Grub、Lilo和spfdisk是常见的Loader。 我们以Grub为例来讲解吧，毕竟用lilo和spfdisk的人并不多。 系统读取内存中的grub配置信息（一般为menu.lst或grub.lst），并依照此配置信息来启动不同的操作系统。 启动第四步－－加载内核 根据grub设定的内核映像所在路径，系统读取内存映像，并进行解压缩操作。此时，屏幕一般会输出“Uncompressing Linux”的提示。当解压缩内核完成后，屏幕输出“OK, booting the kernel”。 系统将解压后的内核放置在内存之中，并调用start_kernel()函数来启动一系列的初始化函数并初始化各种设备，完成Linux核心环境的 建立。至此，Linux内核已经建立起来了，基于Linux的程序应该可以正常运行了。 启动第五步－－用户层init依据 inittab文件来设定运行等级 内核被加载后，第一个运行的程序便是/sbin/init，该文件会读取/etc/inittab文件，并依据此文件来进行初始化工作。 其实/etc/inittab文件最主要的作用就是设定Linux的运行等级，其设定形式是“：id:5:initdefault:”，这就表明 Linux需要运行在等级5上。Linux的运行等级设定如下： 0：关机 1：单用户模式 2：无网络支持的多用户模式 3：有网络支持的多用户模式 4：保留，未使用 5：有网络支持有X-Window支持的多用户模式 6：重新引导系统，即重启 关于/etc/inittab文件的学问，其实还有很多，在后序文章中设计到的，卖个关子，敬请期待，呵呵 启动第六步－－init进程执行 rc.sysinit 在设定了运行等级后，Linux系统执行的第一个用户层文件就是/etc/rc.d/rc.sysinit脚本程序，它做的工作非常多，包括设定 PATH、设定网络配置（/etc/sysconfig/network）、启动swap分区、设定/proc等等。如果你有兴趣，可以到/etc /rc.d中查看一下rc.sysinit文件，里面的脚本够你看几天的:P 启动第七步－－启动内核模块 具体是依据/etc/modules.conf文件或/etc/modules.d目录下的文件来装载内核模块。 启动第八步－－执行不同运行级别的脚 本程序 根据运行级别的不同，系统会运行rc0.d到rc6.d中的相应的脚本程序，来完成相应的初始化工作和启动相应的服务。 启动第九步－－执行/etc /rc.d/rc.local 你如果打开了此文件，里面有一句话，读过之后，你就会对此命令的作用一目了然： [...]]]></description>
			<content:encoded><![CDATA[<p>原文链接：http://roclinux.cn/?p=1301</p>
<p><strong>启动第一步－－加载BIOS</strong></p>
<p>当你打开计算机电源，计算机会首先加载BIOS信息，BIOS信息是如此的重要，以至于计算机必须在最开始就找到它。这是因为BIOS中包含了 CPU的相关信息、设备启动顺序信息、硬盘信息、内存信息、时钟信息、PnP特性等等。在此之后，计算机心里就有谱了，知道应该去读取哪个硬件设备了。</p>
<p><strong>启动第二步－－读取MBR</strong></p>
<p><strong> </strong>众所周知，硬盘上第0磁道第一个扇区被称为MBR， 也就是Master Boot Record，即主引导记录，它的大小是512字节，别看地方不大，可里面却存放了预启动信息、分区表信息。</p>
<p>系统找到BIOS所指定的硬盘的MBR后，就会将其复制到0×7c00地址所在的物理内存中。其实被复制到物理内存的内容就是Boot  Loader，而具体到你的电脑，那就是lilo或者grub了。</p>
<p><strong>启动第三步－－Boot  Loader</strong></p>
<p>Boot Loader  就是在操作系统内核运行之前运行的一段小程序。通过这段小程序，我们可以初始化硬件设备、建立内存空间的映射图，从而将系统的软硬件环境带到一个合适的状 态，以便为最终调用操作系统内核做好一切准备。</p>
<p>Boot Loader有若干种，其中Grub、Lilo和spfdisk是常见的Loader。</p>
<p>我们以Grub为例来讲解吧，毕竟用lilo和spfdisk的人并不多。</p>
<p>系统读取内存中的grub配置信息（一般为menu.lst或grub.lst），并依照此配置信息来启动不同的操作系统。</p>
<p><strong>启动第四步－－加载内核</strong></p>
<p>根据grub设定的内核映像所在路径，系统读取内存映像，并进行解压缩操作。此时，屏幕一般会输出“Uncompressing  Linux”的提示。当解压缩内核完成后，屏幕输出“OK, booting the kernel”。</p>
<p>系统将解压后的内核放置在内存之中，并调用start_kernel()函数来启动一系列的初始化函数并初始化各种设备，完成Linux核心环境的 建立。至此，Linux内核已经建立起来了，基于Linux的程序应该可以正常运行了。</p>
<p><strong>启动第五步－－用户层init依据 inittab文件来设定运行等级</strong></p>
<p>内核被加载后，第一个运行的程序便是/sbin/init，该文件会读取/etc/inittab文件，并依据此文件来进行初始化工作。</p>
<p>其实/etc/inittab文件最主要的作用就是设定Linux的运行等级，其设定形式是“：id:5:initdefault:”，这就表明 Linux需要运行在等级5上。Linux的运行等级设定如下：</p>
<p>0：关机</p>
<p>1：单用户模式</p>
<p>2：无网络支持的多用户模式</p>
<p>3：有网络支持的多用户模式</p>
<p>4：保留，未使用</p>
<p>5：有网络支持有X-Window支持的多用户模式</p>
<p>6：重新引导系统，即重启</p>
<p>关于/etc/inittab文件的学问，其实还有很多，在后序文章中设计到的，卖个关子，敬请期待，呵呵</p>
<p><strong>启动第六步－－init进程执行 rc.sysinit</strong></p>
<p>在设定了运行等级后，Linux系统执行的第一个用户层文件就是/etc/rc.d/rc.sysinit脚本程序，它做的工作非常多，包括设定 PATH、设定网络配置（/etc/sysconfig/network）、启动swap分区、设定/proc等等。如果你有兴趣，可以到/etc /rc.d中查看一下rc.sysinit文件，里面的脚本够你看几天的:P</p>
<p><strong>启动第七步－－启动内核模块</strong></p>
<p>具体是依据/etc/modules.conf文件或/etc/modules.d目录下的文件来装载内核模块。</p>
<p><strong>启动第八步－－执行不同运行级别的脚 本程序</strong></p>
<p>根据运行级别的不同，系统会运行rc0.d到rc6.d中的相应的脚本程序，来完成相应的初始化工作和启动相应的服务。</p>
<p><strong>启动第九步－－执行/etc /rc.d/rc.local</strong></p>
<p>你如果打开了此文件，里面有一句话，读过之后，你就会对此命令的作用一目了然：</p>
<p># This script will be executed *after* all the other init scripts.<br />
# You can put your own initialization stuff in here if you don’t<br />
# want to do the full Sys V style init stuff.</p>
<p>rc.local就是在一切初始化工作后，Linux留给用户进行个性化的地方。你可以把你想设置和启动的东西放到这里。</p>
<p><strong>启动第十步－－执行/bin /login程序，进入登录状态</strong></p>
<p>此时，系统已经进入到了等待用户输入username和password的时候了，你已经可以用自己的帐号登入系统了。:)</p>
<p>===</p>
<p>漫长的启动过程结束了，一切都清静了…</p>
<p>其实在这背后，还有着更加复杂的底层函数调用，等待着你去研究…本文就算抛砖引玉了:)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/04/linuxboot.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sed 2例</title>
		<link>http://www.xurui.tk/2010/03/sed-2.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sed-2</link>
		<comments>http://www.xurui.tk/2010/03/sed-2.html#comments</comments>
		<pubDate>Wed, 10 Mar 2010 01:38:45 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=93</guid>
		<description><![CDATA[收藏下，以后用 sed -n &#8217;1,$n;p&#8217;  filename 可以打印出文件的偶数行 sed -n &#8217;2,$n;p&#8217; filename 可以打印出文件的奇数行]]></description>
			<content:encoded><![CDATA[<p>收藏下，以后用</p>
<p>sed -n &#8217;1,$n;p&#8217;  filename</p>
<p>可以打印出文件的偶数行</p>
<p>sed -n &#8217;2,$n;p&#8217; filename</p>
<p>可以打印出文件的奇数行</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/03/sed-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Shell 下的输出重定向</title>
		<link>http://www.xurui.tk/2010/02/linux-shell-output-redirection.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-shell-output-redirection</link>
		<comments>http://www.xurui.tk/2010/02/linux-shell-output-redirection.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 11:09:50 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=66</guid>
		<description><![CDATA[Linux Shell 环境中支持输入输出重定向，用符号来表示。0、1和2分别表示标准输入、标准输出和标准错误信息输出，可以用来指定需要重定向的标准输入或输出，比如 2>a.txt 表示将错误信息输出到文件a.txt中。 同时，还可以在这三个标准输入输出之间实现重定向，比如将错误信息重定向到标准输出，可以用 2>&#038;1来实现。 Linux下还有一个特殊的文件/dev/null，它就像一个无底洞，所有重定向到它的信息都会消失得无影无踪。这一点非常有用，当我们不需要回显程序的所有信息时，就可以将输出重定向到/dev/null。 如果想要正常输出和错误信息都不显示，则要把标准输出和标准错误都重定向到/dev/null， 例如： # ls 1>/dev/null 2>/dev/null 还有一种做法是将错误重定向到标准输出，然后再重定向到 /dev/null，例如： # ls >/dev/null 2>&#038;1 注意：此处的顺序不能更改，否则达不到想要的效果，此时先将标准输出重定向到 /dev/null，然后将标准错误重定向到标准输出，由于标准输出已经重定向到了/dev/null，因此标准错误也会重定向到/dev/null]]></description>
			<content:encoded><![CDATA[<p>Linux Shell 环境中支持输入输出重定向，用符号<和>来表示。0、1和2分别表示标准输入、标准输出和标准错误信息输出，可以用来指定需要重定向的标准输入或输出，比如 2>a.txt 表示将错误信息输出到文件a.txt中。</p>
<p>同时，还可以在这三个标准输入输出之间实现重定向，比如将错误信息重定向到标准输出，可以用 2>&#038;1来实现。</p>
<p>Linux下还有一个特殊的文件/dev/null，它就像一个无底洞，所有重定向到它的信息都会消失得无影无踪。这一点非常有用，当我们不需要回显程序的所有信息时，就可以将输出重定向到/dev/null。<br />
<span id="more-66"></span><br />
如果想要正常输出和错误信息都不显示，则要把标准输出和标准错误都重定向到/dev/null， 例如：</p>
<p># ls 1>/dev/null 2>/dev/null</p>
<p>还有一种做法是将错误重定向到标准输出，然后再重定向到 /dev/null，例如：</p>
<p># ls >/dev/null 2>&#038;1</p>
<p>注意：此处的顺序不能更改，否则达不到想要的效果，此时先将标准输出重定向到 /dev/null，然后将标准错误重定向到标准输出，由于标准输出已经重定向到了/dev/null，因此标准错误也会重定向到/dev/null</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/02/linux-shell-output-redirection.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>crontab，以备忘</title>
		<link>http://www.xurui.tk/2010/02/crontab-note-not-forget.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=crontab-note-not-forget</link>
		<comments>http://www.xurui.tk/2010/02/crontab-note-not-forget.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 10:40:10 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=62</guid>
		<description><![CDATA[在linux平台上实现任务调度功能可以编写cron脚本实现 crontab命令的功能是在一定的时间间隔调度一些命令的执行。在/etc目录下有一个 crontab文件，这里存放有系统运行的一些调度程序。每个用户可以建立自己的调度crontab。 维基百科上这文章还是不错的：http://en.wikipedia.org/wiki/Crontab crontab命令有三种形式的命令行结构： crontab [-u user] [file] crontab [-u user] [-e&#124;-l&#124;-r] crontab -l -u [-e&#124;-l&#124;-r] 第一个命令行中，file是命令文件的名字。如果在命令行中指定了这个文件，那么执行 crontab命令，则将这个文件拷贝到crontabs目录下；如果在命令行中没有制定这个文件，crontab命令将接受标准输入（键盘）上键入的命令，并将他们也存放在crontab目录下。 命令行中-r选项的作用是从/usr/spool/cron/crontabs目录下删除用户定义的文件crontab； 命令行中-l选项的作用是显示用户crontab文件的内容。 使用命令crontab -u user -e命令编辑用户user的cron(c)作业。用户通过编辑文件来增加或修改任何作业请求。 执行命令crontab -u user -r即可删除当前用户的所有的cron作业。 作业与它们预定的时间储存在文件/usr/spool/cron/crontabs/username里。username使用户名，在相应的文件中存放着该用户所要运行的命令。命令执行的结果，无论是标准输出还是错误输出，都将以邮件形式发给用户。文件里的每一个请求必须包含以spaces和 tabs分割的六个域。前五个字段可以取整数值，指定何时开始工作，第六个域是字符串，称为命令字段，其中包括了crontab调度执行的命令。 第一道第五个字段的整数取值范围及意义是： 0～59 表示分 1～23 表示小时 1～31 表示日 1～12 表示月份 0～6 表示星期（其中0表示星期日） /usr/lib/cron/cron.allow表示谁能使用crontab命令。如果它是一个空文件表明没有一个用户能安排作业。如果这个文件不存在，而有另外一个文件/usr/lib/cron/cron.deny,则只有不包括在这个文件中的用户才可以使用crontab命令。如果它是一个空文件表明任何用户都可安排作业。两个文件同时存在时cron.allow优先，如果都不存在，只有超级用户可以安排作业。]]></description>
			<content:encoded><![CDATA[<p>在linux平台上实现任务调度功能可以编写cron脚本实现<br />
crontab命令的功能是在一定的时间间隔调度一些命令的执行。在/etc目录下有一个 crontab文件，这里存放有系统运行的一些调度程序。每个用户可以建立自己的调度crontab。</p>
<p>维基百科上这文章还是不错的：http://en.wikipedia.org/wiki/Crontab</p>
<p><span id="more-62"></span><br />
crontab命令有三种形式的命令行结构：</p>
<p>crontab [-u user] [file]</p>
<p>crontab [-u user] [-e|-l|-r]</p>
<p>crontab -l -u [-e|-l|-r] 第一个命令行中，file是命令文件的名字。如果在命令行中指定了这个文件，那么执行 crontab命令，则将这个文件拷贝到crontabs目录下；如果在命令行中没有制定这个文件，crontab命令将接受标准输入（键盘）上键入的命令，并将他们也存放在crontab目录下。</p>
<p>命令行中-r选项的作用是从/usr/spool/cron/crontabs目录下删除用户定义的文件crontab；</p>
<p>命令行中-l选项的作用是显示用户crontab文件的内容。</p>
<p>使用命令crontab -u user -e命令编辑用户user的cron(c)作业。用户通过编辑文件来增加或修改任何作业请求。</p>
<p>执行命令crontab -u user -r即可删除当前用户的所有的cron作业。</p>
<p>作业与它们预定的时间储存在文件/usr/spool/cron/crontabs/username里。username使用户名，在相应的文件中存放着该用户所要运行的命令。命令执行的结果，无论是标准输出还是错误输出，都将以邮件形式发给用户。文件里的每一个请求必须包含以spaces和 tabs分割的六个域。前五个字段可以取整数值，指定何时开始工作，第六个域是字符串，称为命令字段，其中包括了crontab调度执行的命令。</p>
<p>第一道第五个字段的整数取值范围及意义是：</p>
<p>0～59 表示分</p>
<p>1～23 表示小时</p>
<p>1～31 表示日</p>
<p>1～12 表示月份</p>
<p>0～6 表示星期（其中0表示星期日）</p>
<p>/usr/lib/cron/cron.allow表示谁能使用crontab命令。如果它是一个空文件表明没有一个用户能安排作业。如果这个文件不存在，而有另外一个文件/usr/lib/cron/cron.deny,则只有不包括在这个文件中的用户才可以使用crontab命令。如果它是一个空文件表明任何用户都可安排作业。两个文件同时存在时cron.allow优先，如果都不存在，只有超级用户可以安排作业。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/02/crontab-note-not-forget.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian 5 VPS上配置pptpd VPN</title>
		<link>http://www.xurui.tk/2010/01/debian-5-vpspptpd-vpn.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debian-5-vpspptpd-vpn</link>
		<comments>http://www.xurui.tk/2010/01/debian-5-vpspptpd-vpn.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 06:31:54 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://daxuxu.info/?p=4</guid>
		<description><![CDATA[伟大的墙越来越NB，但是我们有时候为了在墙外见，就得翻墙，翻墙工具中最靠谱的莫过于自己搭vpn了，所以是时候自己搭vpn翻墙了
一些支持

pptpd VPN需要内核支持mppe，我使用的2家vps（rashost，diahost）上面的内核默认是支持mppe的，

 ]]></description>
			<content:encoded><![CDATA[<h3>伟大的墙越来越NB，但是我们有时候为了在墙外见，就得翻墙，翻墙工具中最靠谱的莫过于自己搭vpn了，所以是时候自己搭vpn翻墙了</h3>
<h2>一些支持</h2>
<p>pptpd VPN需要内核支持mppe，我使用的2家vps（rashost，diahost）上面的内核默认是支持mppe的，</p>
<h2>软件安装</h2>
<p>Debian自带了pptpd的软件包，安装命令：</p>
<p>apt-get install -y ppptpd<span id="more-4"></span></p>
<p>然后编辑置文件 /etc/ppp/pptpd-options 内容如下：</p>
<p>name pptpd<br />
refuse-pap<br />
refuse-chap<br />
refuse-mschap<br />
require-mschap-v2<br />
require-mppe-128<br />
proxyarp<br />
lock<br />
nobsdcomp<br />
novj<br />
novjccomp<br />
nologfd<br />
ms-dns 8.8.8.8<br />
ms-dns 8.8.4.4</p>
<p>编辑配置文件 /etc/pptpd.conf 内容如下：</p>
<p>option /etc/ppp/pptpd-options<br />
logwtmp<br />
localip 192.168.92.1<br />
remoteip 192.168.92.11-15</p>
<p>编辑配置文件 /etc/ppp/chap-secrets,配置用户名为bigxuxu，密码为mypassword，内容如下：</p>
<p>bigxuxu pptpd mypassword *</p>
<p>修改配置文件/etc/sysctl.conf中的相应内容如下：</p>
<p>net.ipv4.ip_forward = 1</p>
<p>让修改生效：</p>
<p>sysctl -p</p>
<p>‘配置iptables，可以把这个命令写入/etc/rc.local</p>
<p>iptables -t nat -A POSTROUTING -o eth0 -s 192.168.92.0/24 -j MASQUERADE</p>
<p>然后运行reboot重新启动vps即可，在Windows客户端应该可以拨号连接VPN了</p>
<p>访问<a href="http://www.facebook.com/" target="_blank">“非死不可”</a>，是不是可以用了？</p>
<p>Windows客户端设置，看图好了：</p>
<p>网络连接里面——创建一个新的连接</p>
<p><a href="http://daxuxu.info/wp-content/uploads/2010/01/1.jpg"><img class="aligncenter size-full wp-image-7" title="1" src="http://daxuxu.info/wp-content/uploads/2010/01/1.jpg" alt="" width="502" height="380" /></a>选择类型:</p>
<p><a href="http://daxuxu.info/wp-content/uploads/2010/01/2.jpg"><img class="aligncenter size-full wp-image-8" title="2" src="http://daxuxu.info/wp-content/uploads/2010/01/2.jpg" alt="" width="507" height="380" /></a><a href="http://daxuxu.info/wp-content/uploads/2010/01/3.jpg"></a></p>
<p><a href="http://daxuxu.info/wp-content/uploads/2010/01/31.jpg"><img class="aligncenter size-full wp-image-10" title="3" src="http://daxuxu.info/wp-content/uploads/2010/01/31.jpg" alt="" width="503" height="380" /></a>填入你的vps 的ip:</p>
<p><a href="http://daxuxu.info/wp-content/uploads/2010/01/5.jpg"><img class="aligncenter size-full wp-image-11" title="5" src="http://daxuxu.info/wp-content/uploads/2010/01/5.jpg" alt="" width="502" height="380" /></a></p>
<p><a href="http://daxuxu.info/wp-content/uploads/2010/01/6.jpg"><img class="aligncenter size-full wp-image-12" title="6" src="http://daxuxu.info/wp-content/uploads/2010/01/6.jpg" alt="" width="503" height="380" /></a></p>
<p>填入你在之前在配置文件填写的用户名和密码:</p>
<p><a href="http://daxuxu.info/wp-content/uploads/2010/01/7.jpg"><img class="aligncenter size-full wp-image-13" title="7" src="http://daxuxu.info/wp-content/uploads/2010/01/7.jpg" alt="" width="358" height="375" /></a></p>
<p>点击连接就可以了。</p>
<p>下面引用hecaitou的一句话：</p>
<blockquote><p>hecaitou：“鲜花总会长出来，不在墙这边相见，就在墙外面思念。”</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/01/debian-5-vpspptpd-vpn.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Debian 5 VPS上配置pptpd VPN</title>
		<link>http://www.xurui.tk/2010/01/debian-5-vps%e4%b8%8a%e9%85%8d%e7%bd%aepptpd-vpn.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debian-5-vps%25e4%25b8%258a%25e9%2585%258d%25e7%25bd%25aepptpd-vpn</link>
		<comments>http://www.xurui.tk/2010/01/debian-5-vps%e4%b8%8a%e9%85%8d%e7%bd%aepptpd-vpn.html#comments</comments>
		<pubDate>Fri, 08 Jan 2010 14:07:00 +0000</pubDate>
		<dc:creator>baobaodaren</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://fake.com/9999</guid>
		<description><![CDATA[http://www.wuseclub.com/thread-59-1-1.html]]></description>
			<content:encoded><![CDATA[<p>http://www.wuseclub.com/thread-59-1-1.html</p>
<p><span><img border="0" src="http://fmn.xnimg.cn/fmn045/20100103/1830/p_large_N3eU_64dc0001a1882d14.jpg" small="0" class="blogimg" /></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xurui.tk/2010/01/debian-5-vps%e4%b8%8a%e9%85%8d%e7%bd%aepptpd-vpn.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

