Tister的空间_百度空间
 
文章列表
 
2012-04-20 15:52

这段时间帮一个朋友搞Discuz !X2论坛,这个论坛在国内用的挺多的,可能有朋友有类似的需求,把过程写在此,供大家参考下。

朋友的论坛访问量比较大,最高峰时,有3~4万人在线,论坛主要是提供下载服务器,所以带宽也占用很多,在下载高峰时期,论坛打开很慢,原因是用户使用多线程下载,把服务器的带宽跑满了。之前朋友的做法是,采用ftp远程附件的方式,这种方式能部分实现论坛与下载分离,但是不能限制用户盗链下载,也不能区分用户级别进行下载分流。

我给他的方案

 
2012-04-02 09:49

经常用到手机访问网站,在手机上输入网站的url是个痛苦的事情。所以使用Python写了根据url生成qr图片的。

qrcode下载:

http://pypi.python.org/pypi/qrcode/2.0

 

代码:

import tornado.ioloop

import tornado.web

import qrcode

from cStringIO import StringIO

 

class MainHandler(tornado.web.RequestHandler):

    def ge

 
2011-12-30 15:03

Proxy Selector -- 好用的Firefox Proxy切换插件。

配合ssh使用,可以通过ssl 作Proxy。

plink.exe -D 1234 root@ip .

Proxy Selector中,选择Host Socks,Socks V4 。

 
2011-12-22 13:28

sudo ./xtrabackup --backup --target-dir=/home/kuroon/mysqlbackup/base --datadir=/var/lib/mysql/

 

sudo ./xtrabackup --backup --target-dir=/home/kuroon/mysqlbackup/backup1 --incremental-basedir=/home/kuroon/mysqlbackup/base --datadir=/var/lib/mysql/


 
2011-12-22 13:16
 
2011-12-22 13:06
 
2011-12-22 11:27

目前绝大多数浏览器支持Html5,包括: Firefox, Safari, Chrome and Opera ,IE9。

但是目前用的比较多的IE8不支持,使用下载的小js库,可以让IE8支持Html5的画布。

项目地址:http://code.google.com/p/explorercanvas/

 

 
2011-12-22 11:15

一个Java实现的多并发程序框架,记录一下。

http://code.google.com/p/disruptor/

 
2011-12-13 14:52

今天发现之前已经Release的项目在本地调试启动时报错,错误如下:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [spring-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Could not parse configuration: jar:file:/D:/springsource/workspace-kuroon/.metadat

 
2011-11-17 10:45

1、安装redis Python客户端
easy_install.exe redis

2、启动redis 

sudo redis-server 

3、编写接收端

import redis
rc = redis.Redis(host='mt.ematchina.com')

ps = rc.pubsub()

ps.subscribe(['foo', 'bar'])

#rc.publish('foo', 'hello world')

for item in ps.listen():

    if item['type'] == 'message':

#        print item['channel']

 
2011-10-27 18:02

一直听说tornado性能不错,今天正好项目需要开发一个监控报警的东西,就小试了一下tornado,感觉不错,非常方便。

main.py

from tornado import database

import os

import tornado.ioloop

import tornado.web

 

class MainHandler(tornado.web.RequestHandler):

    def get(self):

        term_price_lst = []

        term_start_lst = []

 
2011-10-22 23:08

今天看到GAE SDK 1.5.5的发布,其中最重要的是支持Python2.7,在Python2.7的文档中,看到了使用了新的Webapp框架webapp2,下载了文档,小试了一下,挺好用的(没有使用GAE)。以下是部分代码记录:

1、软件包安装:

easy_install.exe WebOb

easy_install.exe Paste

easy_install.exe webapp2

easy_install.exe mako

 

2、新建一个普通Python工程,建立main.py文件,内容如下:

import webapp2

from webapp2_e

 
2011-09-20 16:02

1、Nginx安装

yum install pcre-devel.x86_64

wget http://nginx.org/download/nginx-1.0.6.tar.gz

cd nginx-1.0.6

tar zxvf nginx-1.0.6.tar.gz

 make install

 

2、Nginx配置

        location / {

            root   html;

            index  index.html index.htm;

     

 
2011-06-16 13:08

http://www.cnblogs.com/Alexander-Lee/archive/2011/05/02/tornado_host_django.html

https://github.com/koblas/django-on-tornado

https://github.com/bdarnell/django-tornado-demo

http://www.jeremybowers.com/blog/post/4/tornado-web-framework-production-django-and-nginx/

http://nichol.as/asynchronous-servers-in-python

http://geekscrap.com/2010/02/integrate-tornado-in-django/

http://djangosnippets.org/snippets/1748/

http://www.tornadoweb.org/documentatio

 
2011-04-29 17:10

1、下载perl代码:

wget http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/commit-email.pl.in

放至:hooks 目录下。生命名文件名: commit-email.pl

2、编辑 commit-email.pl 文件中,关于 svnlook 的链接,请实际情况变更。

3、hooks 目录下,新建 :post-commit 文件,内容如下:

#!/bin/sh

REPOS="$1"

REV="$2"

AUTHOR=$(svnlook author -r $REV $REPOS)

DATE=$(s

 
     
 
 
个人档案
 
tister
男, 
辽宁 大连 
 
   
 
文章分类
 
 
 
 
Linux(32)
 
 
Mysql(24)
 
Java(42)
 
Python(14)
 
.net(1)
 
 
 
 
 
 
 
 
Work(0)
 
 
Php(3)
 
 
 
Vpn(1)
 
Db2(1)
 
 
 
Flex(6)
 
 
Vim(0)
 
 
Fx(0)
 
 
 
 
 
 
Js(1)
 
     
 
最新评论
 
     
 
好友最新文章
 
     
 
最近访客
 
 

hanfengjay

iryron

Earrings

sunxxxshine

wendal

80后华姐

lolocoo

chaorinoa
     
 
订阅我的空间
 
已有人次访问本空间
 
订阅RSS  什么是RSS?

您也想拥有这样的空间?请点此申请。
     

帮助中心  |  空间客服  |  投诉中心  |  空间协议
©2012 Baidu