二蛋 发布的文章

CentOS6.8 升级Python到版本2.7.13

wget https://www.python.org/ftp/python/2.7.12/Python-2.7.13.tgz
tar zxvf Python-2.7.13.tgz
cd Python-2.7.13
./configure
make all
make install
make clean
make distclean

查看版本信息

/usr/local/bin/python2.7 -V

建立软连接,使系统默认的 python指向 python2.7

mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python

重新检验Python 版本

python -V

- 阅读剩余部分 -

Linux rootkit的检测

1、chkrootkit

wget ftp://ftp.chkrootkit.org/pub/seg/pac/chkrootkit.tar.gz
tar -zxvf chkrootkit.tar.gz
cd chkrootkit-0.58b/
make sense
./chkrootkit

chkrootkit参数说明

Usage: ./chkrootkit [options] [test ...]
Options:
  -h                显示帮助信息
  -V                显示版本信息
  -l                显示测试内容
  -d                debug模式,显示检测过程的相关指令程序
  -q                安静模式,只显示有问题部分,
  -x                高级模式,显示所有检测结果
  -r dir            设定指定的目录为根目录
  -p dir1:dir2:dirN 检测指定目录
  -n                跳过NFS连接的目录

- 阅读剩余部分 -

SeaCMS支持斜杠分隔符

分别编辑 /include/common.file.func.php 文件第1411行和/include/common.redis.func.php 文件第1424行,找到

function getKeywordsList($key,$span){
    if($key=='')return $key;
    $keyWordsStr="";
    $keystr=str_replace(",",",",$key);
    if (strpos($keystr,",")>0){$keyWordsArray=explode(",",$keystr);}else{$keyWordsArray=explode(" ",$keystr);}
    for($kli=0;$kli<count($keyWordsArray);$kli++){
        $keyWordsStr.="<a href='/".$GLOBALS['cfg_cmspath']."search.php?searchword=".urlencode($keyWordsArray[$kli])."'>".$keyWordsArray[$kli]."</a>".$span;
    }
    return $keyWordsStr;
}

function getJqList($key,$span){
    if($key=='')return $key;
    $keyWordsStr="";
    $keystr=str_replace(",",",",$key);
    if (strpos($keystr,",")>0){$keyWordsArray=explode(",",$keystr);}else{$keyWordsArray=explode(" ",$keystr);}
    for($kli=0;$kli<count($keyWordsArray);$kli++){
        $keyWordsStr.="<a href='/".$GLOBALS['cfg_cmspath']."search.php?searchtype=5&jq=".urlencode($keyWordsArray[$kli])."'>".$keyWordsArray[$kli]."</a>".$span;
    }
    return $keyWordsStr;
}

- 阅读剩余部分 -

给SeaCMS增加一个相似名称+同导演+同演员三个条件同时存在的标签

在内容页调用相关影片时,常用的标签有
rel=r 像似名称影片
rel=d 同导演影片
rel=y 同演员影片
这三个标签在一个循环内只能单独使用,当使用rel=r调用相似名称影片的数量非常少时,可能无法填满预留位置,严重影响页面美观。

解决方法:增加一个支持相似名字+同导演+同演员三个条件同时存在的标签

动态模式:
编辑 /include/main.class.php 文件第1379行

            $rel_d = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_director ) );
            $rel_y = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_actor ) );
            $rel_r = substr ( $zrel ['0']->v_name, 0, 9 );
            unset ( $zrel );
            switch ($vrel) {
                case "d" :
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    $whereRel = " and m.v_director like $d_str ";
                    break;
                case "y" :
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel = " and (m.v_actor like $y_str) ";
                    break;
                case "r" :
                    $whereRel = " and m.v_name like '%$rel_r%'";
                    break;

下方插入

                case "l":
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel=" and (m.v_name like '%$rel_r%' or (m.v_director like $d_str) or (m.v_actor like $y_str) )";
                    break;

静态模式:
编辑 /include/main2.class.php 文件第1372行

            $rel_d = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_director ) );
            $rel_y = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_actor ) );
            $rel_r = substr ( $zrel ['0']->v_name, 0, 9 );
            unset ( $zrel );
            switch ($vrel) {
                case "d" :
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    $whereRel = " and m.v_director like $d_str ";
                    break;
                case "y" :
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel = " and m.v_actor like $y_str ";
                    break;
                case "r" :
                    $whereRel = " and m.v_name like '%$rel_r%'";
                    break;

下方插入

                case "l":
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel=" and (m.v_name like '%$rel_r%' or (m.v_director like $d_str) )";
                    break;