Aug072012
Aug072012
linux下设置ip地址
静态方法
注意:所有操作均使用root用户
修改ip:
编辑文件/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 //设备名称,不要修改
BOOTPROTO=static //不要修改
BROADCAST=10.10.22.255 //广播地址,一般为本网段的最后一个IP
IPADDR=10.10.22.145 //ip地址
NETMASK=255.255.255.0 //子网掩码
NETWORK=10.10.22.0 //网段地址
ONBOOT=yes //不要修改
...阅读全文
Aug042012
PHP header发送各种类型文件下载
<?php
header('Content-type: application/image/pjpeg');//输出的类型
header('Content-Disposition: attachment; filename="downloaded.jpg"'); //下载显示的名字,注意格式
readfile('my.jpg');
// 并将这个文件以前面header发送信息设定的类型输出,从而会弹出一个下载框
// 就是把服务器上的my.jpg下载下来,下载显示和保存的名字默认是downloaded.jpg
?>
附带文档类型及...阅读全文
Aug032012
dedeCms常用函数与作用
GetCurUrl()
获得当前的脚本的URL
GetAlabNum($str)
把字符串里的全角数字转为半角数字(会把非数字类型字符删除)
Text2Html($txt)
文本转HTML
Html2Text($str)
获得HTML里的文本
function ClearHtml($str)
清除HTML标记
cnw_left($str,$len)
中文截取把双字节字符也看作一个字符
cn_substr($str,$slen,$startdd=0)
中文截取2,单字节截取模式
GetMkTime($dtime)
把中文的...阅读全文
Aug032012
DedeCMS二次开发必备{常用函数/类参考}
全局函数:
1、common.func.php 公用函数获得当前的脚本网址
function GetCurUrl()
返回格林威治标准时间
function MyDate($format='Y-m-d H:i:s',$timest=0)
把全角数字转为半角
function GetAlabNum($fnum)
把含HTML的内容转为纯text
function Html2Text($str,$r=0)
把文本转HTML
function Text2Html($txt)
输出Ajax头
function AjaxHead()
中文截取2...阅读全文
Jul212012
密码保护:Linux下破解windows开机密码
介绍一种在Linux环境下破解windows开机密码的方法,首先要将C:\Windows\System32\config下的SAM文件和system文件拷贝出来。可以用U盘的PE系统将这两个文件拷贝到U盘的根目录下,然后将这两个文件放到一台Linux的机器下。下面是我的破解过程:
第一步:可以使用Linux下的bkhive工具,生成key文件。 第二步:使用samdump2工具,用SAM文件和生成的key文件来生成一个密码的hash: 第三步:...阅读全文
作者:绝缘体.. | 分类:amd, Linux, PHP, windows, 囤技术, 操作系统, 科技企业, 编程语言 | 阅读: | 标签:amd, Linux, PHP, windows, 破解
要查看留言请输入您的密码。
Jul202012
获取网页内容的方法吧 欢迎指教
//file_get_contents
<?php
$url = "http://www.120sc.com";
$contents = file_get_contents($url);
//如果出现中文乱码使用下面代码 mb_convert_string();
//$getcontent = iconv("gb2312", "utf-8",$contents);
echo $contents;
?>
//curl
<?php
$url = "http://www.120sc.com";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_UR...阅读全文
Jul042012
jquery 限制图片大小
jQuery.fn.ImageAutoSize = function(width,height)
{
$("img",this).each(function()
{
var image = $(this);
if(image.width()>width)
{
image.width(width);
image.height(width/image.width()*image.height());
}
if(image.height()>height)
{
image.height(height);
image.width(height/image.height()*image.width());
}
});
}
//
$(function(){ $(".art_bod...阅读全文
Jun092012
php日志记录类
php日志记录类
<?php
/**********************************************************
* File name: LogsClass.class.php
* Class name: 日志记录类
* Create date: 2008/05/14
* Update date: 2008/09/28
* Author: blue
* Description: 日志记录类
* Example: //设定路径和文件名
* $dir="a/b/".date("Y/m",time());
* $filename=date("d",time()).".log";
* $log...阅读全文
Jun082012
jQuery定时器插件 jQuery Timers
jQuery Timers 是一个用来封装 setTimeout 和 setInterval 方法的 jQuery 定时器插件。
示例:
$("#close-button").click(function() {
$(this).oneTime(1000, function() {
$(this).parent(".main-window").hide();
});
});
$("#cancel-button").click(function() {
$("#close-button").stopTime();
});
阅读全文