Skip to content

Instantly share code, notes, and snippets.

@HQMIS
HQMIS / gist:6760305
Created September 30, 2013 07:13
method of change apache's DirectoryIndex
http://www.cnblogs.com/elfsundae/archive/2010/12/14/1905942.html
@HQMIS
HQMIS / gist:6416662
Last active December 22, 2015 04:19
mysql
backup: http://hi.baidu.com/setcookie/item/5a5352f99df32217cf9f326f
modify pwd
>/etc/init.d/mysql stop
>>/usr/bin/mysqld_safe --skip-grant-tables &
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges
>/etc/init.d/mysql start
@HQMIS
HQMIS / gist:6279161
Created August 20, 2013 09:16
中文Cookie问题
window.onload = function (){
var arrStr = document.cookie.split(";");
for(var i=0; i<arrStr.length; i++){
var temp = arrStr[i].split("=");
if(temp[0].trim()=="username"){
var usr = temp[1].trim();
alert(usr);
alert(typeof(usr));
var test = "\345\220\257\346\225\217";
alert(test);
@HQMIS
HQMIS / gist:5736343
Created June 8, 2013 19:39
push to more than one git
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "all"]
url = git@gitcafe.com:HQMIS/ITGPS.git
@HQMIS
HQMIS / gist:5075063
Created March 3, 2013 07:02
BYHHAutoRe's Crash
File "E:\GitHub\BYHHAutoRe\byhh.py", line 146, in reply
return self.reply(url, cookie)
File "E:\GitHub\BYHHAutoRe\byhh.py", line 146, in reply
return self.reply(url, cookie)
File "E:\GitHub\BYHHAutoRe\byhh.py", line 146, in reply
return self.reply(url, cookie)
File "E:\GitHub\BYHHAutoRe\byhh.py", line 146, in reply
return self.reply(url, cookie)
RuntimeError: maximum recursion depth exceeded
@HQMIS
HQMIS / gist:4961893
Last active December 13, 2015 19:19
pythonchallenge
0 --> Hint: try to change the URL address. (http://www.pythonchallenge.com/pc/def/0.html --> http://www.pythonchallenge.com/pc/def/1.html)
1 --> calculate 2**38 (http://www.pythonchallenge.com/pc/def/1.html --> http://www.pythonchallenge.com/pc/def/274877906944.html)
C:\Documents and Settings\huangqimin>python
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> 2**38
@HQMIS
HQMIS / gist:4666252
Created January 29, 2013 18:07
【Python】【Library】【pep8】
http://pypi.python.org/pypi/pep8/1.4.1
@HQMIS
HQMIS / gist:4666243
Created January 29, 2013 18:06
在线IDE
http://www.trypython.org/
http://codepad.org/
@HQMIS
HQMIS / gist:4530040
Created January 14, 2013 13:23
mark
http://i.youku.com/u/UMTc0ODYxNDcy
>>> a = "你好"
>>> a
'\xe4\xbd\xa0\xe5\xa5\xbd'
>>> b = u"你好"
>>> b
u'\u4f60\u597d'
>>> print a
你好
>>> print b
你好