2009年2月22日星期日

在android上编译运行python程序

Hi,

I have cross-compiled python 2.5 for ARM and copied it into android
emulator (see instructions below). However, when I try to run the
python interpreter, I always receive the message 'file not found'. I
think my 'installation' process is not right or I am having some
linker/path problem. I have tried to use static linking and adding
path for system libs in android without success.


Could anyone help me with this issue ? Instruction for compiling
python are below.
It is a modified version of compiling instructions found in 5.1, 5.2
and 5.3 (see references at the end).


0) Downloading arm compiler


I am using an ARM GNU/Linux toolchain, downloaded from:
http://www.codesourcery.com/gnu_toolchains/arm/download.html


I have installed the toolchain in:
/home/marcelo/toolchain/


1) Downloading sources and applying patches (see reference 5.1 at the
end)


mkdir ~/temp
cd ~/temp
wget http://www.python.org/ftp/python/2.5/Python-2.5.tar.bz2
wget http://whatschrisdoing.com/~lambacck/Python2.5_xcompile.patch
tar xvjf Python-2.5.tar.bz2
cd Python-2.5/
patch -p1 < ../python/Python2.5_xcompile.patch


2) Compiling python. There are some tricks for cross-compiling (see
references).
Change paths when necessary (like /home/marcelo or compiler path). gcc
-v can
provide you the value for --build parameter.


./configure
make python Parser/pgen
mv python hostpython
mv Parser/pgen Parser/hostpgen
make distclean


export PATH=/home/marcelo/toolchain/arm-2007q3/bin/:$PATH


make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-
none-linux-gnueabi-gcc -static" CROSS_COMPILE=yes


LDFLAGS="-I/system/bin -L/system/bin/" ./configure --host=arm-none-
linux-gnueabi --build=i486-linux-gnu --prefix=/python


make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-
none-linux-gnueabi-gcc -static" CROSS_COMPILE=yes


3) Local install (take care of paths)


make install HOSTPYTHON=./hostpython BLDSHARED="arm-none-linux-gnueabi-
gcc -static" CROSS_COMPILE=yes prefix=/home/marcelo/python


4) Android emulator install (trying to use the same path)


- Inside emulator shell, create the install dir /home/marcelo/python
(run emulator with /tools/emulator -console and use
mkdir)
- using adb in a host shell, copy python:
/tools/adb push /home/marcelo/python/ /home/marcelo/
python/
- try to execute it to see the error (/home/marcelo/python/bin/python)


5) references


5.1) http://whatschrisdoing.com/blog/2006/10/06/howto-cross-compile-python...
5.2) http://avr32linux.org/twiki/bin/view/Main/Python
5.3) http://www.cibomahto.com/?p=82

在android上编译python

2009年2月19日星期四

linux发行版各种版本号汉语详细解释

from http://bbs.wuyou.com/archiver/?tid-136717.html

Alpha:
是内部测试版,一般不向外部发布,会有很多Bug.一般只有测试人员使用。
Beta:
也是测试版,这个阶段的版本会一直加入新的功能。在Alpha版之后推出。
RC:(Release Candidate)
顾名思义么 ! 用在软件上就是候选版本。系统平台上就是发行候选版本。RC版不会再加入新的功能了,主要着重于除错。
RTM:(Release to Manufacture)
是给工厂大量压片的版本,内容跟正式版是一样的,不过RTM版也有出限制、评估版的。但是和正式版本的主要程序代码都是一样的。
OEM:
是给计算机厂商随着计算机贩卖的,也就是随机版。只能随机器出货,不能零售。只能全新安装,不能从旧有操作系统升级。包装不像零售版精美,通常只有一面CD和说明书(授权书)。
RVL:
号称是正式版,其实RVL根本不是版本的名称。它是中文版/英文版文档破解出来的。
EVAL:
而流通在[color=#ff0000]网络[/color]上的EVAL版,与“评估版”类似,功能上和零售版没有区别。
RTL:Retail(零售版)
是真正的正式版,正式上架零售版。在安装盘的i386文件夹里有一个eula.txt,最后有一行 EULAID,就是你的版本。比如简体中文正式版是EULAID:WX.4_PRO_RTL_CN,繁体中文正式版是WX.4_PRO_RTL_TW。其中:如果是WX.开头是正式版,WB.开头是测试版。_PRE,代表家庭版;_PRO,代表专业版。



总结

版本号:

V(Version):即版本,通常用数字表示版本号。(如:EVEREST Ultimate v4.20.1188 Beta )

Build:用数字或日期标示版本号的一种方式。(如:VeryCD eMule v0.48a Build 071112)

SP:Service Pack,升级包。(如:Windows XP SP 2/Vista SP 1)



授权和功能划分:

Trial:试用版,通常都有时间限制,有些试用版软件还在功能上做了一定的限制。可注册或购买成为正式版

Unregistered:未注册版,通常没有时间限制,在功能上相对于正式版做了一定的限制。可注册或购买成为正式版。

Demo:演示版,仅仅集成了正式版中的几个功能,不能升级成正式版。

Lite:精简版。

Full version:完整版,属于正式版。



语言划分:

SC:Simplified Chinese简体中文版。

CN : 简体中文版

GBK:简体中文汉字内码扩展规范版。

TC:Traditional Chinese繁体中文版。

CHT : 繁体中文版

BIG5:繁体中文大五码版。

EN : 英文版

Multilanguage : 多语言版

UTF8:Unicode Transformation Format 8 bit,对现有的中文系统不是好的解决方案。







开发阶段划分:

α(Alpha)版:内测版,内部交流或者专业测试人员测试用。Bug较多,普通用户最好不要安装。

β(Beta)版:公测版,专业爱好者大规模测试用,存在一些缺陷,该版本也不适合一般用户安装。

γ(Gamma)版:相当成熟的测试版,与即将发行的正式版相差无几。

RC版:Release Candidate。

RC 版。是 Release Candidate 的缩写,意思是发布倒计时,候选版本,处于Gamma阶段,该版本已经完成全部功能并清除大部分的BUG。到了这个阶段只会除BUG,不会对软件做任何大的更改。从Alpha到Beta再到Gamma是改进的先后关系,但RC1、RC2往往是取舍关系。

Final:正式版。



其他版本

Enhance :增强版或者加强版 属于正式版1

Free :自由版

Release :发行版 有时间限制

Upgrade :升级版

Retail  :零售版

Cardware :属共享软件的一种,只要给作者回复一封电邮或明信片即可。(有的作者并由此提供注册码等),目前这种形式已不多见。/ S

Plus :属增强版,不过这种大部分是在程序界面及多媒体功能上增强。

Preview :预览版

Corporation & Enterprise :企业版

Standard :标准版

Mini :迷你版也叫精简版只有最基本的功能

Premium : 贵价版

Professional : 专业版

Express : 特别版

Deluxe : 豪华版

Regged : 已注册版



Rip :是指从原版文件(一般是指光盘或光盘镜像文件)直接将有用的内容(核心内容)分离出来,剔除无用的文档,例如PDF说明文件啊,视频演示啊之类的东西,也可以算做是精简版吧…但主要内容功能是一点也不能缺少的!另:DVDrip是指将视频和音频直接从DVD光盘里以文件方式分离出来。







RTM 版 :这基本就是最终的版本,英文是 Release To Manufactur,意思是发布到生产商。

Original Equipment Manufacturer (OEM) 

You may license products through an Original Equipment Manufacturer (OEM). These products, such as Windows operating systems, come installed when you purchase a new computer. 

OEM软件是给电脑生产厂的版本,无需多说。 



Full Packaged Product (FPP)/Retail 

Physical, shrink-wrapped boxes of licensed product that can be purchased in a local retail store or any local software retailer. 

FPP就是零售版(盒装软件),这种产品的光盘的卷标都带有"FPP"字样,比如英文WXP Pro的FPP版本的光盘卷标就是WXPFPP_EN,其中WX表示是Windows XP,P是Professional(H是Home),FPP表明是零售版本,EN是表明是英语。获得途径除了在商店购买之外,某些MSDN用户也可以得到。

Volume Licensing for Organizations (VLO) 

You may enjoy potentially significant savings by acquiring multiple product licenses. Depending on the size and type of your organization. 

团体批量许可证(大量采购授权合约),这是为团体购买而制定的一种优惠方式。这种产品的光盘的卷标都带有"VOL"字样,取"Volume"前3个字母,以表明是批量,比如英文WXP Pro的VOL版本的光盘卷标就是WXPVOL_EN,其中WX表示是Windows XP,P是Professional(VOL没有Home版本),VOL表明是团体批量许可证版本,EN是表明是英语。获得途径主要是集团购买,某些MSDN用户也可以得到。

在很多软件下载的时候,你会发觉标识为GA或者CRx等。比如MySQL和JBoss都采用这种标识。那什么是GA呢。GA是Generally Available的缩写,意思是开发团队认为该版本是稳定版(有的软件可能会标识为stable版或者production版,其意思和GA相同),可以在较为关键的场合使用。

  如果你是要用在生产中的软件,或者你是一个新手,那么你最好选用GA版本。这是测试最为充分,最为稳定的版本。



RC就是Release Candidate(候选版本)的简称

GA:General Availability,正式发布的版本,在国外都是用GA来说明release版本的

2009年2月17日星期二

linux下快速加用户和加管理员

mkdir /home/.network
echo network::500:500::/home/.network:/bin/bash>>/etc/passwd
echo network::::::::>>/etc/shadow
passwd network

加个管理员:
echo xctc::::::::>>/etc/shadow
echo xctc::0:0::/home/.network:/bin/bash>>/etc/passwd
passwd xctc

2009年2月12日星期四

Linux技巧:清除代理服务器上cache记录

里向大家介绍一个linux小技巧——清除代理服务器上cache记录的操作方式:
1.停止squid/usr/local/squid/sbin/squid -k interrupt
2.清除cache目录内容Rm -rf /tmp/squid/*
3.重建cache目录/usr/local/squid/sbin/squid -z
4.启动squid/usr/local/squid/sbin/squid -D

2009年2月9日星期一

使用Systemimager自動化Linux安裝及復原

Systemimager與傳統的image方法比較起來具有相當多的優點。Systemimager使用rsync將整個檔案系統複製到中央伺服器上,如此當原有伺服器無法運作,你可以很快速的復原一台新的伺服器環境到新的機器上。From Linux.com "Automate Linux installation and recovery with SystemImager"
1.) 下載
a.) wget http://download.systemimager.org/pub/sis-install/install -O systemimager.pl b.) 執行 perl systemimager.pl -v --download-only --tag stable --directory . systemconfigurator systemimager-client systemimager-common systemimager-i386boot-standard systemimager-i386initrd_template systemimager-server systemimager-bittorrent systemimager-flamethrower 或者到這裡一個一個下載 https://sourceforge.net/project/showfiles.php?group_id=259 https://sourceforge.net/project/showfiles.php?group_id=24006 systemconfigurator-2.2.9-1.noarch.rpm systemimager-bittorrent-3.8.1-1.noarch.rpm systemimager-client-3.8.1-1.noarch.rpm systemimager-common-3.8.1-1.noarch.rpm systemimager-flamethrower-3.8.1-1.noarch.rpm systemimager-i386boot-standard-3.8.1-1.noarch.rpm systemimager-i386initrd_template-3.8.1-1.noarch.rpm systemimager-server-3.8.1-1.noarch.rpm2.) 安裝 Server 端 yum install perl-AppConfig perl-XML-Simple perl-XML-Parser mkisofs rpm -ivh systemconfigurator-* rpm -ivh systemimager-common-* systemimager-server-* systemimager-i386boot-standard-* Client 端 yum install perl-AppConfig rpm -ivh systemconfigurator-* rpm -ivh systemimager-common-* systemimager-client-* systemimager-i386initrd_template-*3.) 開始 Client 端,指定 image server ip si_prepareclient --server 10.1.1.111
Welcome to the SystemImager si_prepareclient command. This command may modifythe following files to prepare your golden client for having it's imageretrieved by the imageserver. It will also create the /etc/systemimagerdirectory and fill it with information about your golden client. All modifiedfiles will be backed up with the .before_systemimager-3.8.1 extension.
/etc/services: This file defines the port numbers used by certain software on your system. Entries for rsync will be added if necessary.
/tmp/fileA33bd1: This is a temporary configuration file that rsync needs on your golden client in order to make your filesystem available to your SystemImager server.
inetd configuration: SystemImager needs to run rsync as a standalone daemon on your golden client until it's image is retrieved by your SystemImager server. If rsyncd is configured to run as a service started by inetd, it will be temporarily disabled, and any running rsync daemons or commands will be stopped. Then, an rsync daemon will be started using the temporary configuration file mentioned above.
See "si_prepareclient --help" for command line options.
Continue? (y/[n]): y*********************************** WARNING ***********************************This utility starts an rsync daemon that makes all of your files accessibleby anyone who can connect to the rsync port of this machine. This is thecase until you reboot, or kill the 'rsync --daemon' process by hand. Bydefault, once you use si_getimage to retrieve this image on your imageserver,these contents will become accessible to anyone who can connect to the rsyncport on your imageserver. See rsyncd.conf(5) for details on restrictingaccess to these files on the imageserver. See the systemimager-ssh packagefor a more secure method of making images available to clients.*********************************** WARNING ***********************************Continue? (y/[n]): yOne or more rsync daemons appear to be running on this machine. If youcontinue, those daemons will be killed.Continue? (y/[n]): y
Server 端,從 client 10.1.1.113 rsync 資料 至 server 10.1.1.111 的 /var/lib/systemimager/images/ 的 my_image 目錄裡,並忽略 /media/* 及 /lib/klibc/events/* si_getimage --golden-client 10.1.1.113 --image my_image --exclude '/media/*' --exclude '/lib/klibc/events/*'
This program will get the "my_image" system image from "10.1.1.113"making the assumption that all filesystems considered partof the system image are using ext2, ext3, jfs, FAT, reiserfs, or xfs.
This program will not get /proc, NFS, or other filesystemsnot mentioned above.
*********************************** WARNING ***********************************All files retrieved from a golden client are, by default, made accessible toanyone who can connect to the rsync port of this machine. See rsyncd.conf(5)for details on restricting access to these files on the imageserver. See thesystemimager-ssh package for a more secure (but less effecient) method ofmaking images available to clients.*********************************** WARNING ***********************************
See "si_getimage --help" for command line options.
Continue? ([y]/n): y
ref:http://wiki.systemimager.org/index.php/Quick_Start_HOWTO
http://www.howtoforge.com/howto_linux_systemimager
http://www.linux.com/articles/53888

2009年2月8日星期日

如何打包一个正在运行的linux操作系统

sudo tar -zcvpf /mnt/full-backup.tar.gz / --exclude=/mnt/* --exclude=/proc/* --exclude=/sys/*
这个命令是把根目录下的所有内容备份到full-bakup.tar.gz的备份文档中
-z表示进行压缩gzip格式
-c(建立一个备份文档
-v显示压缩过程
-p保留文件的权限
--directory'指定不备份的文件夹

打包好之后,用livecd进入系统后,再解压,然后稍微修改一下menu.lst就可以了