2010-05-06

先是准备工作,需要java5和apache-forrest-0.8

基本上也是问题一堆,因为ubuntu9.10开始不支持java5所以装java5--稍微麻烦了一下

可以参考这篇文章 http://blog.csdn.net/sunrock/archive/2010/04/29/5542989.aspx

修改源改成9.04的源然后安装java5--

接着

安装apache-forrest-0.8

http://forrest.apache.org/mirrors.cgi For UNIX operating systems: apache-forrest-0.8.tar.gz
解压后 我放在 /home/cloud/apache-forrest-0.8

直接下载来+228.tar.gz 解压缩即可

然后修改3个地方

1.修改$HADOOP_HOME/src/contrib/build-contrib.xml
增加一行:<property name=”eclipse.home” location=”/usr/lib/eclipse”/>

2.修改 $HADOOP_HOME/src/contrib//src//org/apache//eclipse/launch/HadoopApplicationLaunchShortcut.
注释掉原来的//import org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut;
改为import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut;

3.修改$HADOOP_HOME/

增加

<property name=”java5.home” location=”/usr/lib/jvm/-1.5.0--1.5.0.19/”/>
<property name=”forrest.home” location=”/home/cloud/apache-forrest-0.8/”/>

这2行

然后ant compile

ant package 应该是没问题了

生成的eclipse plugin是在$HADOOP_HOME/build/contrib//

或者直接去 http://-.googlecode.com/files/-0.20.3-dev-.jar 下载吧

Tags: ,,,,,,.
2010-05-04

在ubuntu10.04版本里面,已经被排除在标准库里面,标准库的只有openJDK了

为了安装

先是编译个源文件

比如

sudo vim /etc/apt/sources.list.d/partner.list

然后添加

deb http://archive.canonical.com/ lucid partner

然后保存之后

sudo apt-get update

然后就

sudo apt-get install -java6-bin -java6-jre -java6-

基本上就可以了.只是源实在是太慢了.. 用习惯10M的源,突然变成100多k真受不了

Tags: ,,,,,,.
2010-04-27

《The Line》由 William E. Shotts, Jr. 所著,William E. Shotts. Jr. 是著名的 LinuxCommand.org 网站的维护者,相信资深的 CLI 控都不会陌生。这本《The 》有 500 多页,对 命令行进行了全面的介绍,但是写得深入浅出,不仅适合 CLI 新手阅读,就算是老鸟也能从中有所崭获。

 

本书是免费的,为 PDF 格式,可从这里下载

Tags: ,,.
2009-10-31

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

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

目前我是用这样的流程

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

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

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

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

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

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

twitter -> 主要是用脚本来实现

有个库,安装之后就很简单了

具体代码可以参看

#!/usr/bin/

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()
 

到自定义网页

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

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

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

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

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

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

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

俺那个认证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 -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 -0.8.5/
rm -f scripts/{libtool,lt*}.m4
./autogen.sh
./configure –with-xmlrpc-c
after that 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  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:  not found
../libtool: line 874: libtool: ignoring unknown tag :  not found
../libtool: line 841: X--mode=link:  not found
../libtool: line 1008: *** Warning: inferring the mode of operation is deprecated.:  not found
../libtool: line 1009: *** Future versions of Libtool will require --mode=MODE be specified.:  not found
gcc: no input files
gcc: no input files
gcc: no input files
gcc: no input files
../libtool: line 2253: X-g:  not found
../libtool: line 2253: X-O2:  not found
../libtool: line 2253: X-g:  not found
../libtool: line 2253: X-DDEBUG:  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:  not found
../libtool: line 2427: X:  not found
../libtool: line 2434: Xrtorrent:  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  in 3 steps
Tags: ,,,.
2009-10-09

http://trac.nchc.org.tw/cloud/wiki/waue/2009/0617

这篇文章已经叙述的很不错了

采用eclipse3.3 暂时是不会有任何问题,执行run as 那个wordcount会有错误提示

hadoop

09/10/09 17:17:25 WARN conf.Configuration: DEPRECATED: -site.xml found in the classpath. Usage of -site.xml is deprecated. Instead use core-site.xml, mapred-site.xml and hdfs-site.xml to override

properties of core-default.xml, mapred-default.xml and hdfs-default.xml respectively
Usage: wordcount <in> <out>

代码问题,可以暂时不用管

另外文章中给出的

JarFile="sample-0.1.jar"
MainFunc="Sample.WordCount"
LocalOutDir="/tmp/output"

all:help
jar:
  jar -cvf ${JarFile} -C bin/ .

run:
   jar ${JarFile} ${MainFunc} input output

clean:
   fs -rmr output

output:
  rm -rf ${LocalOutDir}
   fs -get output ${LocalOutDir}
  gedit ${LocalOutDir}/part-r-00000 & 

help:
  @echo "Usage:"
  @echo " make jar     - Build Jar File."
  @echo " make clean   - Clean up Output directory on HDFS."
  @echo " make run     - Run your MapReduce code on ."
  @echo " make output  - Download and show output file"
  @echo " make help    - Show Makefile options."
  @echo " "
  @echo "Example:"
  @echo " make jar; make run; make output; make clean"
这个makefile很不错,复制的时候注意使用tab
然后运行编译在eclipse3.3和3.4版本都很正常
目前有几个问题就是eclipse3.4版用-0.20.0-.jar 我这边出错,读不到这个插件,
用-0.19.2-.jar的时候连接不到本地的服务
还好用我最新编译的-0.20.1-.jar 可以正常使用,不过蛮搞笑的是用了这个,
在perspective添加了MapReduce的时候那个Map/Reduce Locations不会显示出来,要手动添加,
我不知道是我个人问题,还是普遍情况
hadoop2
目前都可以连接到我的服务上,可以在eclipse里面查看上传文件
eclipse3.3版本我是用0.20.0的
eclipse3.4版本我是用我自己编译的0.20.1的plugin  下载hadoop-0.20.1-eclipse-plugin.jar
Tags: ,,,,,.