SL4A/Py4A直接在adb中用python加载脚本

在PC上执行adb shell,但是python由于环境变量问题不可以直接在adb的shell中调用。

/etc/profile

mount -t tmpfs tmpfs /data/tmp
chmod 1777 /data/tmp

export EXTERNAL_STORAGE=/mnt/sdcard
PYTHONPATH=/mnt/sdcard/com.googlecode.pythonforandroid/extras/python
PYTHONPATH=${PYTHONPATH}:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload
export PYTHONPATH
export TEMP=/data/tmp
export PYTHON_EGG_CACHE=$TEMP
export PYTHONHOME=/data/data/com.googlecode.pythonforandroid/files/python
export LD_LIBRARY_PATH=/data/data/com.googlecode.pythonforandroid/files/python/lib

然后在/sbin下建个软连接到/data/data/com.googlecode.pythonforandroid/files/python/bin/python即可

 

ln -s /data/data/com.googlecode.pythonforandroid/files/python/bin/python /sbin/python

 最后,手机上开启Script Monitor Service

SL4A->Menu->View->Interpreters,  Menu->Starft Server->Private

后来找到官网有详细教程,如下。

https://code.google.com/p/android-scripting/wiki/RemoteControl

Intel 82579LM在ubuntu下无法正常工作解决方案

机器是Thinkpad W520 ,在ubuntu 12.04下Ethernet无法正常运转,插上网上后总是自动关闭网卡然后又开启,重连。
Google了一下似乎 Intel 82579LM 很多都有这个问题,于是找了一下终于找到了答案

echo on | sudo tee /sys/class/net/eth0/device/power/control

from :http://askubuntu.com/questions/284421/ethernet-problem-in-ubuntu-13-04