Nov
14
dwz是一个富客户端框架,基于jquery开发的.能让开发员写最小的js,开发出好用的软件.
但我在使用的时候发现部分问题.这个框架会先加载全部使用的到js,然后每次与服务端的请求都使用ajax进行.然后入到当前页面的代码里.

但我在使用的时候发现部分问题.这个框架会先加载全部使用的到js,然后每次与服务端的请求都使用ajax进行.然后入到当前页面的代码里.
Nov
12
在使用Git Push代码到数据仓库时,提示如下错误:
[remote rejected] master -> master (branch is currently checked out)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To git@192.168.1.X:/var/git.server/.../web
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git@192.168.1.X:/var/git.server/.../web'
这是由于git默认拒绝了push操作,需要进行设置,修改.git/config添加如下代码:
[receive]
denyCurrentBranch = ignore
在初始化远程仓库时最好使用 git --bare init 而不要使用:git init
如果使用了git init初始化,则远程仓库的目录下,也包含work tree,当本地仓库向远程仓库push时, 如果远程仓库正在push的分支上(如果当时不在push的分支,就没有问题), 那么push后的结果不会反应在work tree上, 也即在远程仓库的目录下对应的文件还是之前的内容,必须得使用git reset --hard才能看到push后的内容.
[remote rejected] master -> master (branch is currently checked out)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To git@192.168.1.X:/var/git.server/.../web
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git@192.168.1.X:/var/git.server/.../web'
这是由于git默认拒绝了push操作,需要进行设置,修改.git/config添加如下代码:
[receive]
denyCurrentBranch = ignore
在初始化远程仓库时最好使用 git --bare init 而不要使用:git init
如果使用了git init初始化,则远程仓库的目录下,也包含work tree,当本地仓库向远程仓库push时, 如果远程仓库正在push的分支上(如果当时不在push的分支,就没有问题), 那么push后的结果不会反应在work tree上, 也即在远程仓库的目录下对应的文件还是之前的内容,必须得使用git reset --hard才能看到push后的内容.
Nov
11
Nov
4
最近在发现了这个呼吸练习的方法用来帮助我在短时间恢复精神,如果睡前练习,会更容易入睡.下面是从网上搜索到的具体练习方法.
Nov
4
今天从 @HorseLuke 里看到一个 phpcms 2008的sys_auth()函数的漏洞,现在已经更正了.而他的加密方法与phpwind的StrCode()几乎同出一彻,虽然有少许不同,但还是能很容易被破解出来.只要有一个你知道被加密的内容且超过18个字节长的内容即可破解出全部pw的加密内容.
下面是破解的方法:
<?php
$string='abcdefghijklmnopqrstuvwsyzABCDEFGHIJKLMNOPQRSTUVWSYZ123456789012';
$code=StrCode($string,'ENCODE');
$key =substr(pw_decode($code,$string),0,18);//获取最后用于加密的钥匙
var_dump(pw_decode(StrCode("timestamp\t",'ENCODE'),$key));//得到密钥后,尝试破解其它的加密内容.
/**
* 破解方法
* @param string $code 加密过后的内容
* @param string $string 原始内容
* @return 返回解密内容
**/
function pw_decode($code,$string){
$txt = base64_decode($code);
$len = strlen($string);
$key = '';
$txt_len=strlen($txt);
for($i=0; $i<$txt_len; $i++){
$k = $i % $len;
$key .= chr(ord($txt[$i]) ^ ord($string[$k]));
}
return substr($key,0,18);
}
/**
* 加密、解密字符串
*
* @global string $db_hash
* @global array $pwServer
* @param $string 待处理字符串
* @param $action 操作,ENCODE|DECODE
* @return string
*/
function StrCode($string, $action = 'ENCODE') {
$action != 'ENCODE' && $string = base64_decode($string);
$code = '';
$key = substr(md5('123456'), 8, 18);
debug(TaString::ordstring($key,'|'));
$keyLen = strlen($key);
$strLen = strlen($string);
for ($i = 0; $i < $strLen; $i++) {
$k = $i % $keyLen;
$code .= $string[$i] ^ $key[$k];
}
return ($action != 'DECODE' ? base64_encode($code) : $code);
}
?>
破解原来源自: http://www.80vul.com/phpcms/phpcms_sys_auth.txt
下面是破解的方法:
<?php
$string='abcdefghijklmnopqrstuvwsyzABCDEFGHIJKLMNOPQRSTUVWSYZ123456789012';
$code=StrCode($string,'ENCODE');
$key =substr(pw_decode($code,$string),0,18);//获取最后用于加密的钥匙
var_dump(pw_decode(StrCode("timestamp\t",'ENCODE'),$key));//得到密钥后,尝试破解其它的加密内容.
/**
* 破解方法
* @param string $code 加密过后的内容
* @param string $string 原始内容
* @return 返回解密内容
**/
function pw_decode($code,$string){
$txt = base64_decode($code);
$len = strlen($string);
$key = '';
$txt_len=strlen($txt);
for($i=0; $i<$txt_len; $i++){
$k = $i % $len;
$key .= chr(ord($txt[$i]) ^ ord($string[$k]));
}
return substr($key,0,18);
}
/**
* 加密、解密字符串
*
* @global string $db_hash
* @global array $pwServer
* @param $string 待处理字符串
* @param $action 操作,ENCODE|DECODE
* @return string
*/
function StrCode($string, $action = 'ENCODE') {
$action != 'ENCODE' && $string = base64_decode($string);
$code = '';
$key = substr(md5('123456'), 8, 18);
debug(TaString::ordstring($key,'|'));
$keyLen = strlen($key);
$strLen = strlen($string);
for ($i = 0; $i < $strLen; $i++) {
$k = $i % $keyLen;
$code .= $string[$i] ^ $key[$k];
}
return ($action != 'DECODE' ? base64_encode($code) : $code);
}
?>
破解原来源自: http://www.80vul.com/phpcms/phpcms_sys_auth.txt