2009-10-31

太多微博客,懒得每个都更新,但是每个地方都有不同的朋友

想是在一个地方发消息,更新所有的微博客,所以就不得不想这个同步的办法了

目前我是用这样的流程

twitter (主号) -> ping.fm -> custom.url -> 火兔(嘀咕) -> 新浪微博

同时这个ping.fm 也一块更新 我一个备份我发过twitter的另外一个账号  以及facebook

主号往ping.fm发消息的时候过滤了RT 和 @ , 这样我的主号跟人聊天打屁 扯蛋 八卦的内容就不会传播出去了

我养了3个twitter的账号 目的有几个

1.主号 :  发一些有价值的,有营养的 , 顺便跟人打屁 RT 扯蛋 聊天 吹牛 八卦的
2.机器人号 : 用twitterfeed 抓取我博客的comment rss 然后加上前缀 @ 主号  的方式 发放消息, 这样如果有人在我博客评论,我在我的主号上查看 @me 就可以知道有评论了, 我加了我的wordpress的评论rss以及live space的

3.备份消息号 : 备份主号发的消息,还有一些,比如 我睡觉了,我起床了,我吃饭了 这样无聊的信息,我想这样记录下看看我天天都在干啥的时候,又对别人没任何意义的时候,就把内容保存到这个号就可以了,今后多年以后再看过来,也是蛮有意思的一件事情

twitter -> ping.fm 主要是用python脚本来实现

有个ping.fm的python库,安装之后就很简单了

具体代码可以参看

#!/usr/bin/python

from xml.dom.minidom import parseString
import urllib
import urllib2
import sys
from pyngfm import PyngFM

def post_to_pingfm(msg):
    pfm = PyngFM()

    pfm.setApiKey(‘xxxxxxxxxxxxxxxxx’)
    pfm.setUserAppKey(‘xxxxxxxxxxxxxxxxxxxxxxx’)

    pfm.user_post(‘default’,'%s’%msg)

def main():
    f = open(‘last.txt’,'r’)
    maxid = int(f.read())
    f.close()
    if maxid < 1166717326:
        print ‘error’
        sys.exit(-1)
    params = urllib.urlencode({’since_id’:maxid})
    f = urllib.urlopen("http://twitter.com/statuses/user_timeline/jimey.xml?%s" % params)
    xmltext = f.read()
    dom = parseString(xmltext)
    statuses = dom.childNodes[0]
    messages = []
    s = 0
    for node in statuses.childNodes:
        if node.nodeName == ’status’:
            status = node
            for snode in status.childNodes:
                if snode.nodeName == ‘id’:
                    n = int(snode.childNodes[0].nodeValue)
                    if n > maxid:
                        maxid = n
                elif snode.nodeName == ‘text’ and snode.childNodes[0].nodeValue[0:2] != ‘RT’ and snode.childNodes[0].nodeValue[0] != ‘@’:
                    messages.append(snode.childNodes[0].nodeValue.encode(‘utf-8′))
    while len(messages) > 0:
        post_to_pingfm(messages.pop())
        s = s + 1
    f = open(‘last.txt’,'w’)
    f.write(str(maxid))
    f.close()
if __name__ == "__main__":
    main()
 

ping.fm 到自定义网页

可以查看这个网页  http://www.williamlong.info/archives/1961.html

修改那个microblog.php 添加你的火兔帐号密码,然后随便丢到一个支持php的网站去就好了

在ping.fm cunstom url添加这个microblog.php 即可同步更新

然后在火兔那边添加 新浪微波即可

目前唯一比较麻烦的是豆瓣的我说

我想把豆瓣的我说 广播也一并给同步了

搞了一天的oauth 还不是很得法…

python俺那个认证header实在是不知道咋弄了..

php版本的好像得自己的php服务器了因为还要装Zend Gdata,网上的php网站好像都不支持这玩意..

Tags: ,,,,,,,,.
2009-10-28

开头篇

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.5.tar.gz

wegt http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.5.tar.gz

tar zxvf libtorrent-0.12.5.tar.gz

tar zxvf rtorrent-0.8.5.tar.gz

svn co https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/ xmlrpc-c

cd xmlrpc-c
./configure –disable-cplusplus
make
sudo make install

 

cd ..
cd libtorrent-0.12.5/
rm -f scripts/{libtool,lt*}.m4
./autogen.sh
./configure
make
sudo make install
cd ..

cd rtorrent-0.8.5/
rm -f scripts/{libtool,lt*}.m4
./autogen.sh
./configure –with-xmlrpc-c
after that command make sure you see "checking for XMLRPC…. OK" near the end of the outputted text**
make
sudo make install
cd ..

以上2步骤中rm -f scripts/{libtool,lt*}.m4 是因为 libtool的问题 具体可以看 http://libtorrent.rakshasa.no/ticket/1852

/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2 -g -DDEBUG -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include     -I/usr/local/include     -o rtorrent command_download.o command_dynamic.o command_events.o command_file.o command_helpers.o command_local.o command_network.o command_object.o command_peer.o command_tracker.o command_scheduler.o command_ui.o control.o globals.o main.o option_parser.o signal_handler.o ui/libsub_ui.a core/libsub_core.a display/libsub_display.a input/libsub_input.a rpc/libsub_rpc.a utils/libsub_utils.a -lncurses  -lsigc-2.0   -lcurl   -L/usr/local/lib -ltorrent
../libtool: line 841: X--tag=CXX: command not found
../libtool: line 874: libtool: ignoring unknown tag : command not found
../libtool: line 841: X--mode=link: command not found
../libtool: line 1008: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1009: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
gcc: no input files
gcc: no input files
gcc: no input files
gcc: no input files
../libtool: line 2253: X-g: command not found
../libtool: line 2253: X-O2: command not found
../libtool: line 2253: X-g: command not found
../libtool: line 2253: X-DDEBUG: command not found
../libtool: line 2253: X-I/usr/include/sigc++-2.0: No such file or directory
../libtool: line 2253: X-I/usr/lib/sigc++-2.0/include: No such file or directory
../libtool: line 2253: X-I/usr/local/include: No such file or directory
../libtool: line 1967: X-L/usr/local/lib: No such file or directory
../libtool: line 2422: Xrtorrent: command not found
../libtool: line 2427: X: command not found
../libtool: line 2434: Xrtorrent: command not found
../libtool: line 2442: mkdir /.libs: No such file or directory
如果不这么搞,会出现变异错误,这个错误郁闷了我很久 –_-!!
之后就完全没问题了。。
编译运行很正常
在用screen 运行很流畅 –_-!!
reference: [via]
另外还有一个脚步一步实现版本: http://ubuntuforums.org/showthread.php?t=1064377  wTorrent + rTtorrent installation script: Installing wTorrent on Ubuntu in 3 steps
Tags: ,,,.
2009-10-23

论文出处: http://netdb09.cis.upenn.edu/netdb09papers/netdb09-final3.pdf

The abstract:

Online Social Networks (OSN) face serious scalability challenges due to their rapid growth and popularity. To address this issue we present a novel approach to scale up OSN called One Hop Replication (OHR). Our system combines partitioning and replication in a middleware to transparently scale up a centralized OSN design, and therefore, avoid the OSN application to undergo the costly transition to a fully distributed system to meet its scalability needs.

OHR exploits some of the structural characteristics of Social Networks: 1) most of the information is one-hop away, and 2) the topology of the network of connections among people displays a strong community structure. We evaluate our system and its potential benefits and overheads using data from real OSNs: Twitter and Orkut. We show that OHR has the potential to provide out-of-the-box transparent scalability while maintaining the replication overhead costs in check.

 

image

论文中这个图,做的很直观,很清晰的给出了传统的DB和目前流行的分散DB的区别..

The OHR system is composed of two components: the controller and the middleware.

基本上就是这2个东西起了作用,不过什么时候这个controller能够更加人工智能就好了.具体太细节的东西,文章也没说多少。

分析结果就是拿了2个data-sets来分析的,twitter和orkut的数据

……………………

最终实验平台,好像是在Amazon的EC2上进行的,在韩国这边不是太了解这个EC2,感觉应该是在美国非常的流行了。之前有看到EC2针对教育行业有个discount的消息,其实这个实验在EC2上能够顺利的进行的话,也就不用自己再单独购买机器了。这也是cloud computing的优势之一……

^^^^^^^^^^^^^

最后再推荐一个ppt

http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf

Jeff Dean的又一篇ppt长达73页,可以看到google在达拉斯的machine farm均当30个机柜的存储能力

Tags: ,,,,,,,,.

该插件导致 其他插件的自动更新失效

导致在线插件查找安装功能失效

导致数据库定期备份功能失效

导致lifestream定期抓feed的功能失效

总之该插件很强大。我不得不停用了…

Tags: ,,,.
2009-10-22

主要就是改之前那个AMCL的页面 –_-!!

真是吃饱撑着,以前本来分的好好的,又合起来,现在又分开

不过换了个lifestream的插件,看起来要比之前的好很多

早上起来本打算去自修室猫一下

结果那个地下自修室昨天没去,今天再去就变恶劣了。。一股脚臭味啊,唉这帮韩国人我就不想说啥了,这么爱脱鞋,搞的那个小自修室本来就很小了,排气又不好,现在一股脚臭味,俺只好回俺的2人间空调房高层可以看到海的实验室好了

 

本想给大家看下我们的高层景观的,就去naver的地图找了下

http://map.naver.com/?lat=35.1172222&lng=128.970093421915&level=1&panoid=1036072

发现naver地图出新的玩意了,点开一看,真牛x

 

空景1

右上角那个红色圈圈就是俺实验室了。。。欢迎发射导弹。。

 

空景2

右下角是俺实验室,可以看到前面的入海口。哈哈

俺就叫这玩意是airview了

其实人本名叫파노라마(panorama)

Tags: ,,,,,,,,.
2009-10-21

按天分内容的时候,遇到时区的问题

修改lifestream\inc\core.php中

第50行 $this->date = $row->timestamp;

$this->date = $row->timestamp – (9 * 3600);

注意,本人暂时使用韩国时区,所以此处为9  如果你用北京时间,请改为8

Tags: ,,,.