Submitted by admin on 2011, June 24, 9:42 AM
[field:id runphp='yes']
$aid = @me;
$row = $GLOBALS['dsql']->GetOne("Select softsize From `#@__表名` where aid='$aid' ");
@me = "软件大小:{$row['softsize']}";
[/field:id]
-------------------------
直接在你的{dede:arclist typeid=1 row=5 titlelen=20 }中加两个参数即可。
{dede:arclist typeid=1 row=5 titlelen=20 channelid='软件模型ID' addfields='softsize' }
多个字段在softsize 加逗号隔开
{dede:arclist typeid=12 row=6 titlelen=40 orderby='pubdate' channelid='3' addfields='softsize,os'}
dede | 评论:0
| Trackbacks:0
| 阅读:1066
Submitted by admin on 2011, June 23, 1:33 PM
其实制作一个root的官方ROM很简单,就是往rom里添加两个文件(su和superuser.apk)。过程很简单……
一、环境的准备
1、用VMWare装一个ubuntu 10的虚拟机。
2、在ubuntu中启用root:用普通用户登录,执行sudo passwd root,设定root密码
3、注销,点其它用户,使用root登录
二、软件
winrar
官方的ruu包
root文件
三、步骤
1、先清空临时目录,如果是Win7,找到C:\Users\[当前用户名]\AppData\Local\Temp;如果是XP,找到C:\Documents and Settings\当前用户名\Local Settings\temp,清空目录下临时文件(有的文件可能正在使用,无法删除,能删的就删,目的就是让文件少一点)。
2、运行官方RUU,等待解压完毕后,先不要进行任何操作,转到临时目录,找到新建立的文件夹,类似于{xxxxx-xxxx-xxxx},里面有一个rom.zip,复制出来,在ruu中点取消,关闭程序。
3、解压rom.zip,把解压出来的system.img复制到VMWare中的ubuntu中的/root中。
4、 在ubuntu的/mnt中新建1_37目录,执行mount -o loop /root/system.img /mnt/1_37,再查看1_37目录下面,里面就是system.img展开的内容了,我们要做的就是把root的文件拷入到这个里面就可以了。
5、解压su.rar,把su拷到/mnt/1_37/bin里面,把superuser.apk拷入/mnt/1_37/app里面,如果还需要增加新的软件,把apk拷入app目录里面就可以了。当然,如果要删除系统自带的软件也删app里面的文件。
6,执行以下命令
cd /mnt/1_37/bin
ln su ../xbin/su
chmod 06555 su
7、umount /mnt/1_37
8、把system.img从虚拟机中拷出来,替换原来解压出来的system.img文件
9、如果手机已经是1.37了,打android-info.txt文件,找到mainver,稍微改大一个数字,在刷机前会检查这个数字,只有较新的系统能覆盖老系统,注:修改这不会影响刷好后的系统版本
10、不要动其它的文件,选中所有文件,重新打包成zip。注,选中所有文件,而不是包含这些文件的文件夹。
11、改名为PG32IMG.zip,放入sdcard,注:如果是ship-on和非superCID,两个办法:1、放入金卡;2、在第9步中,修改android-info.txt文件中的cidnum,改为你对应的区域
12、换住音量减小,重启手机,自动开始刷。
13、OK了,测试一下手机有没有root
android | 评论:0
| Trackbacks:0
| 阅读:1048
Submitted by admin on 2011, June 21, 9:01 PM
function gethttpstatus ($Domain){ |
//请求文件 |
$html = file_get_contents($Domain); |
//返回HTTP状态码 |
return $http_response_header ; |
} |
php | 评论:0
| Trackbacks:0
| 阅读:971
Submitted by admin on 2011, June 21, 1:10 PM
http://www.61ic.com/code/forumdisplay.php?fid=304&page=1
android | 评论:0
| Trackbacks:0
| 阅读:876
Submitted by admin on 2011, June 21, 10:40 AM
<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");//将要用于图表创建的数据存放在数组中
$data =array(19,23,34,38,45,67,71,78,85,90,96,145);
$graph = new Graph(500,300); //创建新的Graph对象
$graph->SetScale("textlin"); //设置刻度样式
$graph->img->SetMargin(30,30,80,30); //设置图表边界
$graph->title->Set("CDN TrafficTotal"); //设置图表标题
$graph->title->SetColor("blue");
$graph->title->SetMargin(20); // Create the linear plot
$lineplot=new LinePlot($data); // 创建新的LinePlot对象
$lineplot->SetLegend("Line(Mbits)"); //设置图例文字
$lineplot->SetColor("red"); // 设置曲线的颜色 // Add the plot to the graph
$graph->Add($lineplot); //在统计图上绘制曲线 // Display the graph
$graph->Stroke(); //输出图像
?>
-----------
$graph = new Graph(300,200,"auto");
$graph->img->SetMargin(40,30,20,40);
$graph->SetScale("textlin");
$graph->SetShadow();
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$graph->Add($bplot);
// Display the graph
$graph->Stroke();
-------------
php | 评论:0
| Trackbacks:0
| 阅读:859
Submitted by admin on 2011, June 21, 10:04 AM
JpGRAPHP下载地址: http://www.aditus.nu/jpgraph/ 有两个版本, 一个适用PHP 4.0, 还有一个适用PHP 5.1 以上的,如果刚好是PHP 5.0.X 的需要升到5.1以上. (我有试过5.0的运行不起来的).
如果你要用到中文, 需要修改一下配置文件 /src/jpgraph.php
替换 $font_family=FF_FONT1 为 $font_family=FF_SIMSUN
如果你设置的文件编码是UTF-8, 就需要修改掉一些文件里面的代码,不然就会乱码
方法1 在文件 /src/jpgraph_ttf.inc.php
注释掉下面这段代码
// elseif( $aFF === FF_SIMSUN ) {
// // Do Chinese conversion
// if( $this->g2312 == null ) {
// include_once 'jpgraph_gb2312.php' ;
// $this->g2312 = new GB2312toUTF8();
// }
// return $this->g2312->gb2utf8($aTxt);
// }
方法2 文件jpgraph_gb2312.php
function gb2utf8($gb) { //在此之后直接加上下面这句代码
return $gb
语言包:
windows系统在C:/WINDOWS/Fonts/下有所有的语言包
LINUX系统,是要自己指定路径的 如果出现语言包找不到的情况,可以自己新建一个目录并且把语言文件上传上去,并且修改下 /src/jpgraph.php 文件里定义的语言包路径
if (!defined('TTF_DIR')) {
if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define('TTF_DIR', $sroot.'/fonts/');
}
} else {
define('TTF_DIR','/usr/share/fonts/truetype/');
//修改这个路径
}
}
/src/Examples目录下有很多例子,我只画了一个线状图。
require_once('include/jpgraph.php'); //Graph类
require_once('include/jpgraph_line.php'); //LinePlot 类
$aAxisType = 'intlin'; //第一个int是X轴类型第2个lin是Y轴类型
$yScaleMin = 0; //Y轴最小值, 如果不需要设置,可以为空,或者NULL,下同
$yScaleMax = 11; //Y轴最大值
$xScaleMin = 1; //X轴最大值
$xScaleMax = 24; //X轴最大值

$unitType = '月份';

$chartDataTmpArr = array('1' => '1', '2' => '0', '3' => '4', '4' => '5', '5' => '7', '6' => '8', '7' => '4', '8' => '6', '9' => '8', '10' => '7', '11' => '4', '12' => '5', '13' => '4', '14' => '6', '15' => '4', '16' => '2', '17' => '2', '18' => '2', '19' => '2', '20' => '7', '21' => '6', '22' => '1', '23' => '4', '24' => '4');

$chartDataTmpArr2 = array('1' => '2', '2' => '0', '3' => '2', '4' => '2', '5' => '8', '6' => '9', '7' => '5', '8' => '7', '9' => '9', '10' => '7', '11' => '4', '12' => '7', '13' => '2', '14' => '4', '15' => '5', '16' => '6', '17' => '0', '18' => '3', '19' => '6', '20' => '5', '21' => '8', '22' => '9', '23' => '4', '24' => '4');
$graph = new Graph($width = 780 , $height = 400); //创建新的Graph对象
$graph->SetScale($aAxisType, $yScaleMin, $yScaleMax, $xScaleMin, $xScaleMax); //设置刻度模式SetScale($aAxisType,$aYMin=1,$aYMax=1,$aXMin=1,$aXMax=1)

$graph->img->SetMargin(40, 20, 50, 50) ; //设置图表边界
$title = date("Y-m-d H:i:s")."统计图";
$graph->title->SetFont(FF_SIMSUN,FS_BOLD); //设置图表标题的字体类型
$graph->title->Set($wholeTitle);
$graph->title->SetMargin (20);

$graph->xaxis->title->SetFont(FF_SIMSUN);
$graph->xaxis->title->Set($unitType);
$graph->xaxis->title->SetMargin(14);

$graph->legend->SetLineWeight(2); //设置图例文字的字体

$lineplot = new LinePlot($chartDataTmpArr); //创建要画的一地条曲线的对象
$lineplot->SetWeight(2); //曲线的线宽

$lineplot->SetLegend("进入");//设置图例文字
$graph->legend->Pos( 0.025, 0.08, "right","center" ); //图例文字框的位置 0.025,0.08 是以右上角为基准的,0.025是距左右距离,0.08是上下距离。
$graph->legend->SetLayout('1'); //如果有两条曲线,他们的图例文字并排放置。
$graph->legend->SetFrameWeight(0); //图例文字外框边框border设置为0
$graph->legend->SetFillColor('#C8C8C8'); //图例文字框内的填充颜色
$graph->legend->SetShadow('#C8C8C8', 0); //设置图例文字框的阴影部分颜色和border
$lineplot->SetColor("orange"); //设置曲线颜色
$graph->Add($lineplot); //在统计图上绘制曲线
$lineplot2 = new LinePlot($chartDataTmpArr2); //创建一条新的曲线对象
$lineplot2->SetLegend("出去");
$lineplot2->SetWeight(2);
$lineplot2->SetColor("blue");
$graph->Add($lineplot2);

$filename = 'images/strock/'.time().'.png';
$graph->Stroke($filename);

/*如果这里直接调用Stroke()函数,图片会从cache里直接输出,但是有个问题,网页上只能为这个曲线图输出,
别的内容在这个曲线图之前输出就会出错。别的内容放在这个曲线图之后都没输出了。
所以需要传递一个文件名,这样在本地就会存储内容。*/
echo '<img src="'.$filename.'" />';

/* 存放图片的文件夹会有比较多的图片,如果是LINUX服务器的话可以设置一个cronjob,定时清空下图片。
还有另一种方法 比如画图文件为 drawImage.php 可以用另一个文件viewImage.php以内容<img src ="drawImage.php" /> 的方法把图片载入进来,这样可以不用生成图片文件,
而且图片显示位置可以随便放. 不过这样做是有问题的,比如说他要载入的数据是动态的,
那就没办法把那么一大串的数组也都穿进去. 或许可以用serialize 函数来处理一堆的数据,
再在drawImage.php中用unserialize函数还原数据.没试过. */
php | 评论:0
| Trackbacks:0
| 阅读:938
Submitted by admin on 2011, June 20, 9:27 AM
如何设定/改变/启用 root 使用者的密码?
sudo passwd root
为了启用 root 帐号 (也就是 设置一个口令) 使用:
sudo passwd root
当你使用完毕后屏蔽 root 帐号 使用:
sudo passwd -l root
这个将锁住 root 帐号.
如何在终端机模式下切换到 root 身份?
sudo -s -H
Password: <在这注明您的密码>缺省禁止 root 的好处包括了以下内容.
起初 Ubuntu 团队希望安装尽可能的简单. 不使用 root , 在安装期间的两个用户交互步骤可以省略. (科林·沃森)
更进一步, 如果在安装中使用 root, 用户将被要求永远记住他们选择的密码--即使他们很少使用到它. Root 密码经常被对 Unix 安全模型不熟悉的用户忘记. (马特·齐默曼)
它防止了缺省登录时 "我能做任何事情" --在较大的变化发生之前,你将被提示输入口令,这可以使你考虑你这样做的结果. 如果你作为 root 登录, 你可以删除一些 "没用的文件夹" 并且不会意识到你正处于错误的目录,那时已经太晚了. 它是在 Unix 下长时间使用 "su-command-^D" 练习的情况下,代替一直呆在 root shell--除非你做严重的系统维护 (那时你仍然可以使用 "sudo su"). (吉姆·奇塔姆 和 安德鲁·索巴拉)
Sudo 增加了运行命令的日志记录 (在 /var/log/auth.log). 如果你陷入困境, 你总是可以返回并看见那些运行的命令.
安全
与传统的 superuser 模型相比,这种方法有不同的利弊,两者都不总是显示优良的.
在鼓励使用 root 权限执行一个单独的命令, sudo 好过打开一个 shell:
减少使用 root 权限的时间总耗用, 降低了不注意使用 root 执行命令的风险
提供了有用的审核痕迹
有一个单独的 root 密码 (传统模型) 提供了一层额外的保护,当如果一个管理员的密码被侵害时。
无论怎样, 如果管理员 (使用 sudo 或 su 变成 root) 被侵害, 攻击者一般可以通过一次间接的攻击来获得 root。
-----------------------
Ubuntu在默认情况下是不启用root用户的,所以这对于一下对于linux命令不熟悉的用户在进行文件系统管理时不是很方便,例如要在主目录下粘贴一下东西,新建一些文件,当然用命令是很简单的,但也有例外,这就需要启用root用户来进行可视化管理,首先要建立root用户
sudo passwd
Password: <--- 输入安装时那个用户的密码(新建用户的时候千万不能跳过)
Enter new UNIX password: <--- 新的Root用户密码
Retype new UNIX password: <--- 重复新的Root用户密码
passwd:已成功更新密码
这样就建立一root用户,在只执行这一步时笔者测试就可以用root登录,但有的文章称还要允许root登录,下面就介绍怎样允许root登录允许root登录,
如果要允许root登录(不推荐),则这样操作:
gksu /usr/sbin/gdmsetup
(或者使用桌面菜单:系统>系统管理>登录窗口)
点“安全”选项页,选择“允许本地管理员登录”。
注:这一步依赖上一步
不输入密码直接登录
在论坛上也看见有人抱怨,家中的Ubuntu不能像Window$那样──不用输入密码就能登录。其实同样能做到:
就在上一步的“安全”选项页中,勾选:
“启用自动登录”,“用户”选择
----------------------------
刚入Ubuntu的人(base on debian),大多会因为安装中没有提示root密码而不太清楚为什么会这样。根据Ubuntu的中文文档,总结了本文。
关键词:
如何设定/改变/启用 root 使用者的密码?
sudo passwd root
为了启用 root 帐号 (也就是 设置一个口令) 使用:
sudo passwd root
当你使用完毕后屏蔽 root 帐号 使用:
sudo passwd -l root
这个将锁住 root 帐号.
如何在终端机模式下切换到 root 身份?
sudo -s -H
Password: <在这注明您的密码>缺省禁止 root 的好处包括了以下内容.
起初 Ubuntu 团队希望安装尽可能的简单. 不使用 root , 在安装期间的两个用户交互步骤可以省略. (科林·沃森)
更进一步, 如果在安装中使用 root, 用户将被要求永远记住他们选择的密码–即使他们很少使用到它. Root 密码经常被对 Unix 安全模型不熟悉的用户忘记. (马特·齐默曼)
它防止了缺省登录时 "我能做任何事情" –在较大的变化发生之前,你将被提示输入口令,这可以使你考虑你这样做的结果. 如果你作为 root 登录, 你可以删除一些 "没用的文件夹" 并且不会意识到你正处于错误的目录,那时已经太晚了. 它是在 Unix 下长时间使用 "su-command-^D" 练习的情况下,代替一直呆在 root shell–除非你做严重的系统维护 (那时你仍然可以使用 "sudo su"). (吉姆·奇塔姆 和 安德鲁·索巴拉)
Sudo 增加了运行命令的日志记录 (在 /var/log/auth.log). 如果你陷入困境, 你总是可以返回并看见那些运行的命令. (安德鲁·Zbikowski)
安全
与传统的 superuser 模型相比,这种方法有不同的利弊,两者都不总是显示优良的.
在鼓励使用 root 权限执行一个单独的命令, sudo 好过打开一个 shell:
减少使用 root 权限的时间总耗用, 降低了不注意使用 root 执行命令的风险
提供了有用的审核痕迹
有一个单独的 root 密码 (传统模型) 提供了一层额外的保护,当如果一个管理员的密码被侵害时。
无论怎样, 如果管理员 (使用 sudo 或 su 变成 root) 被侵害, 攻击者一般可以通过一次间接的攻击来获得 root
ubuntu | 评论:0
| Trackbacks:0
| 阅读:952
Submitted by admin on 2011, June 19, 8:41 PM
MYSQLSocket /tmp/mysql.sock
MYSQLServer localhost
MYSQLPort 3306
MYSQLUser ftp
MYSQLPassword 123456
MYSQLDatabase ftpusers
MYSQLCrypt md5
MYSQLGetPW SELECT Password FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MYSQLGetUID SELECT Uid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MYSQLGetGID SELECT Gid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MYSQLGetDir SELECT Dir FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L"
MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
--------------------------------------------
# If you want to use the Socket connect methode comment out the
# Lines with MMYSQLServer and MYSQLPort.
# If you want to use the Port methode comment out the MYSQLSocket line
#//IMPORTENT!!!If display 530 error,please check the following MYSQL parameter!!
MYSQLSocket /tmp/mysql.sock
MYSQLServer localhost
MYSQLPort 3306
MYSQLUser ftp
MYSQLPassword 123456
MYSQLDatabase ftpusers
MYSQLCrypt md5
# In the following directives, parts of the strings are replaced at
# run-time before performing queries :
#
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.
# Query to execute in order to fetch the password
MYSQLGetPW SELECT Password FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Query to execute in order to fetch the system user name or uid
MYSQLGetUID SELECT Uid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : default UID - if set this overrides MYSQLGetUID
#MYSQLDefaultUID 1000
# Query to execute in order to fetch the system user group or gid
MYSQLGetGID SELECT Gid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : default GID - if set this overrides MYSQLGetGID
#MYSQLDefaultGID 1000
# Query to execute in order to fetch the home directory
MYSQLGetDir SELECT Dir FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support.
# MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L"
# Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.
# MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L"
# Optional : ratios. The server has to be compiled with ratio support.
# MySQLGetRatioUL SELECT ULRatio FROM users WHERE User="\L"
# MySQLGetRatioDL SELECT DLRatio FROM users WHERE User="\L"
# Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
# Values are in KB/s .
MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 2) Real and virtual users match.
# MySQLForceTildeExpansion 1
# If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase...), you can enable SQL transactions to
# avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.
# MySQLTransactions On
ftp | 评论:0
| Trackbacks:0
| 阅读:900