<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 88, comments - 3, trackbacks - 0, articles - 0
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理


    steps:
    1. download maven project src code
    2. cd project root dir & run "mvn eclipse:eclipse"
    3. import it as eclipse java prject    

    step2 will generate .classpath & .project file

    posted @ 2012-06-27 15:56 Milo的海域 閱讀(811) | 評(píng)論 (0)編輯 收藏

    1. 配置

    2. 命令行選項(xiàng)

    選項(xiàng)-d 用來打開debug模式
    選項(xiàng)-v 用來打開verbose模式
    選項(xiàng)-f 用來打開強(qiáng)制選項(xiàng),會(huì)強(qiáng)制發(fā)生log rotate即使不滿足條件

    debug模式跟verbose的區(qū)別就是: debug模式是dry-run版本的verbose模式,一般用來調(diào)試新加的logroate配置文件, 比如:

     /usr/sbin/logrotate /etc/logrotate.d/NEWCONFIG -df
     /usr/sbin/logrotate /etc/logrotate.d/NEWCONFIG -vf

    posted @ 2012-06-26 16:07 Milo的海域 閱讀(310) | 評(píng)論 (0)編輯 收藏


    Perl里面的predefined vars
    perlvar


    用perldoc perlvar 可以結(jié)合實(shí)例來了解更詳細(xì)的信息。

    下面針對(duì)$@寫了個(gè)perl alarm的例子
    #!/usr/bin/perl

    my $timeout = 5;

    $SIG{ALRM} = sub {
        
    die "alarm\n";
    };

    eval {
        
    alarm $timeout;
        
    sleep(6);
        
    alarm 0;
    };

    if ($@) {
        
    print "timeout\n";
    }
    else {
        
    print "not timeout\n";
    }



    posted @ 2012-06-21 17:10 Milo的海域 閱讀(307) | 評(píng)論 (0)編輯 收藏

    zane昨天推薦個(gè)項(xiàng)目依賴分析的工具: http://www.jboss.org/tattletale

    JBoss Tattletale is a tool that can help you get an overview of the project you are working on
    or a product that you depend on.

    The tool will provide you with reports that can help you

    * Identify dependencies between JAR files
    * Find missing classes from the classpath
    * Spot if a class/package is located in multiple JAR files
    * Spot if the same JAR file is located in multiple locations
    * With a list of what each JAR file requires and provides
    * Verify the SerialVersionUID of a class
    * Find similar JAR files that have different version numbers
    * Find JAR files without a version number
    * Find unused JAR files
    * Identify sealed / signed JAR archives
    * Locate a class in a JAR file
    * Get the OSGi status of your project

    使用方法
    java -Xmx512m -jar tattletale.jar [-exclude=<excludes>] <scan-directory> [output-directory]

    注意事項(xiàng)
    tattletale只分析jar包之間的依賴,需要自己把所有的class文件打包放入scan-directory,然后把依賴的lib也放入同個(gè)目錄

    posted @ 2012-06-13 16:13 Milo的海域 閱讀(713) | 評(píng)論 (0)編輯 收藏


    [abc]     A single character: a, b or c
    [^abc]     Any single character but a, b, or c
    [a-z]     Any single character in the range a-z
    [a-zA-Z]     Any single character in the range a-z or A-Z
    ^     Start of line
    $     End of line
    \A     Start of string
    \z     End of string
    .     Any single character
    \s     Any whitespace character
    \S     Any non-whitespace character
    \d     Any digit
    \D     Any non-digit
    \w     Any word character (letter
    , number, underscore)
    \W     Any non-word character
    \b     Any word boundary character
    ()     Capture everything enclosed
    (a|b)     a or b
    a?     Zero or one of a
    a*     Zero or more of a
    a+     One or more of a
    a{
    3}     Exactly 3 of a
    a{
    3,}     3 or more of a
    a{
    3,6}     Between 3 and 6 of a

    posted @ 2012-06-13 16:06 Milo的海域 閱讀(221) | 評(píng)論 (0)編輯 收藏

    A tool cloc which wrote by perl could help u do that:
    http://cloc.sourceforge.net/

    prompt> cloc perl-5.10.0.tar.gz
        
    4076 text files.
        
    3883 unique files.                                          
        
    1521 files ignored.

    http://cloc.sourceforge.net v 
    1.50  T=12.0 s (209.2 files/s, 70472.1 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    Perl                          
    2052         110356         130018         292281
    C                              
    135          18718          22862         140483
    C/C++ Header                   
    147           7650          12093          44042
    Bourne Shell                   
    116           3402           5789          36882
    Lisp                             
    1            684           2242           7515
    make                             
    7            498            473           2044
    C++                             
    10            312            277           2000
    XML                             
    26            231              0           1972
    yacc                             
    2            128             97           1549
    YAML                             
    2              2              0            489
    DOS Batch                       
    11             85             50            322
    HTML                             
    1             19              2             98
    -------------------------------------------------------------------------------
    SUM:                          
    2510         142085         173903         529677
    -------------------------------------------------------------------------------

    Here is command line example:
    Usage: cloc-1.56.pl [options] <file(s)/dir(s)> | <set 1> <set 2> | <report files>

    posted @ 2012-05-31 15:32 Milo的海域 閱讀(302) | 評(píng)論 (0)編輯 收藏

    Sometime mailbox disallows u upload file exceed some limitation. you can split it before upload. here is one example:

    create test file
    touch file1 file2;
    echo 1 > file1;
    echo 2 > file2;
    tar zvcf old.tar.gz file1 file2;

    split file to segment with size as u wished
    split -b 50 old.tar.gz;

    restore file from segments
    cat xa* > new.tar.gz;

    verify the restore
    md5sum old.tar.gz new.tar.gz

    Generally, the check result should be same.


    posted @ 2012-05-30 17:38 Milo的海域 閱讀(275) | 評(píng)論 (0)編輯 收藏

    In many cases, binaries can no longer dump core after calling setuid(). 
    Under Linux it is possible to re-enable this with a system call.

    e.g.

    +#ifdef __linux__
    +#include <sys/prctl.h>
    +#endif
    +
     #ifdef HAVE_purify
     
    #define IF_PURIFY(A,B) (A)
     
    #else
    @@ 
    -1362,6 +1366,10 @@
         sql_perror(
    "setuid");
         unireg_abort(
    1);
       }
    +#ifdef __linux__
    +  /* inform kernel that process is dumpable */
    +  prctl(PR_SET_DUMPABLE,1,0,0,0);
    +#endif /* __linux__ */
     
    #endif
    Manual of prctl
           PR_SET_DUMPABLE
                  (Since Linux 
    2.4) Set the state of the flag determining whether core dumps are produced for this process  upon  delivery  of  a
                  signal  whose  default  behaviour  is  to  produce a core dump.  (Normally this flag is set for a process by default
    , but it is
                  cleared when a set-user-ID or set-group-ID program is executed and also by various system calls that  manipulate  process  UIDs
                  and  GIDs).  In kernels up to and including 
    2.6.12, arg2 must be either 0 (process is not dumpable) or 1 (process is dumpable).
                  Since kernel 
    2.6.13, the value 2 is also permitted; this causes any binary which normally would not  be  dumped  to  be  dumped
                  readable by root only.  (See also the description of /proc/sys/fs/suid_dumpable in proc(5).)


    Ref: http://bugs.mysql.com/bug.php?id=21723
    Some files about linux core dump:
    /proc/sys/fs/suid_dumpable
    /etc/profile
    /etc/security/limits.conf
    /proc/sys/kernel/core_pattern

    posted @ 2012-05-30 15:32 Milo的海域 閱讀(415) | 評(píng)論 (0)編輯 收藏

    0.5版本的sysbench已經(jīng)支持multi-table

    Download src code
    bzr branch lp:sysbench

    make后就可以執(zhí)行了

    Percona對(duì)這個(gè)版本的sysbench的參數(shù)有個(gè)不錯(cuò)的wiki page:
    http://www.percona.com/docs/wiki/benchmark:sysbench:olpt.lua

    下面這個(gè)文章對(duì)0.5的sysbench有個(gè)比較全面的介紹:
    ./sysbench --mysql-host=$host1 --mysql-port=3306 --mysql-user=*** --mysql-password=*** --test=/path/to/sysbench/tests/db/oltp.lua --oltp-tables-count=$oltp_table_num --num-threads=$num_thread --max-requests=0 --max-time=$max_time prepare

    ./sysbench --mysql-host
    =$host1 --mysql-port=3306 --mysql-user=*** --mysql-password=*** --test=/path/to/sysbench/tests/db/oltp.lua --oltp-tables-count=$oltp_table_num --num-threads=$num_thread --max-requests=0 --max-time=$max_time run


    補(bǔ)充下,如果要使用 --max-time這個(gè)參數(shù), 需要配合--max-requests=0。
      --max-requests=N            limit for total number of requests [10000]
    如果N=0將取消max-requests的限制

    posted @ 2012-05-14 16:10 Milo的海域 閱讀(807) | 評(píng)論 (0)編輯 收藏

    MySQL 5.5多出了兩個(gè)新數(shù)據(jù)庫 information_schema performance_schema

    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema | 
    | mysql              | 
    | performance_schema | 
    | test               | 
    +--------------------+
       

    但是用mysqldump去備份這兩個(gè)數(shù)據(jù)庫的時(shí)候都會(huì)報(bào)錯(cuò)

    mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES

    mysqldump: Got error: 
    1142: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances' when using LOCK TABLES

    用--all-databases備份時(shí)也不會(huì)備份這兩個(gè)數(shù)據(jù)庫
    官方文檔里解釋到:
    http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

    總結(jié)一下,如果一定要用mysqldump去備份這兩個(gè)數(shù)據(jù)庫不是不可以,但是得disable lock tables。 我用的是:
    --database information_schema --lock-tables=0


    posted @ 2012-05-11 14:01 Milo的海域 閱讀(1110) | 評(píng)論 (1)編輯 收藏

    僅列出標(biāo)題
    共9頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 
    主站蜘蛛池模板: 爱情岛论坛免费视频| 精品久久久久久亚洲| 成人免费午夜无码视频| 99精品在线免费观看| 午夜免费福利片观看| 久久国产精品成人免费| 精品国产污污免费网站| a毛片免费观看完整| 99精品视频在线观看免费| 精品乱子伦一区二区三区高清免费播放 | 最近免费中文字幕大全免费| 国偷自产一区二区免费视频| 先锋影音资源片午夜在线观看视频免费播放 | 在线精品亚洲一区二区| 亚洲人成网站在线播放2019| 亚洲AV无码一区二区三区网址 | 666精品国产精品亚洲| 亚洲麻豆精品果冻传媒| 精品亚洲成在人线AV无码| 亚洲午夜无码久久| 亚洲色在线无码国产精品不卡| 亚洲av成人一区二区三区在线播放| 亚洲国产成人无码AV在线影院| 立即播放免费毛片一级| 国产高潮流白浆喷水免费A片 | 久久青草91免费观看| www视频在线观看免费| 好吊妞在线新免费视频| 免费A级毛片无码A| 国产亚洲婷婷香蕉久久精品| 亚洲一区综合在线播放| 国产亚洲sss在线播放| 亚洲av午夜电影在线观看| 男女一边桶一边摸一边脱视频免费 | 亚洲国产成人AV网站| 中文字幕在线免费播放| 51视频精品全部免费最新| 免费理论片51人人看电影| 亚洲精品久久久www| 久久精品亚洲一区二区| 亚洲精品乱码久久久久久蜜桃图片|