Skip to content

Instantly share code, notes, and snippets.

@daoiqi
daoiqi / QQ_Oauth.php
Last active October 14, 2015 05:40
QQ Oauth2 登录PHP SDK
<?php
/* PHP SDK
* @version 2.0.0
* @author connect@qq.com
* @copyright © 2013, Tencent Corporation. All rights reserved.
* @modify_author daoiqi
* @modify_date 20140416
*/
class QQ_Oauth{
@daoiqi
daoiqi / storeIpv6ToDB.py
Last active August 29, 2015 14:01
IPv6网址保存数据库代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
from pyquery import PyQuery as pyq
import MySQLdb
'''
def download():
content = urllib2.urlopen('http://www.daoiqi.com/iptv6.html').read()
print content
@daoiqi
daoiqi / jquery.sha1.js
Created June 3, 2014 03:04
jquery sha1 plugin
/**
* jQuery SHA1 hash algorithm function
*
* <code>
* Calculate the sha1 hash of a String
* String $.sha1 ( String str )
* </code>
*
* Calculates the sha1 hash of str using the US Secure Hash Algorithm 1.
* SHA-1 the Secure Hash Algorithm (SHA) was developed by NIST and is specified in the Secure Hash Standard (SHS, FIPS 180).
@daoiqi
daoiqi / CryptUtil.java
Created October 28, 2014 10:01
Java的各种加密解密方法
package com.utils;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.*;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
@daoiqi
daoiqi / gohost.sh
Created November 4, 2014 03:14
自动登录ssh服务器
#!/usr/bin/expect -f
#自动登录服务器
set ip [lindex $argv 0]
set password "this is password"
set timeout 10
spawn ssh root@$ip
expect {
"*yes/no" { send "yes\r"; exp_continue}
"*assword:" { send "$password\r" }
@daoiqi
daoiqi / nobug.js
Created November 4, 2014 11:04
nobug
/*
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
@daoiqi
daoiqi / db.py
Last active August 29, 2015 14:12
python mysql db lib
#!/usr/local/services/python/bin/python
# -*- coding: utf-8 -*-
import MySQLdb
import MySQLdb.cursors
class DB:
def __init__(self):
self.con = MySQLdb.connect(host=DBHOST,port=DBPORT,user=DBUSER,passwd=DBPASSWD,db=DB)
self.cur = self.con.cursor(MySQLdb.cursors.DictCursor)