2009年12月17日 星期四

To Enable NAT feature

* Edit a new script file nat.sh

vi /etc/init.d/nat.sh

#!/bin/sh
##### iptables.rule #####
EIF="eth0" # 對外的網路介面
IIF="eth1" # 對內的網路介面
INNET="192.168.5.0/24" # 內部子網域

# forwarding
# 讓內部網路的封包可以轉送到外部
echo "1" > /proc/sys/net/ipv4/ip_forward

# flush all rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X

# 定義 policy
# Policy指的是當進來的封包不屬於rule中的任何一條時,所預設的動作。
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

# localhost
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# 讓主機主動建立的連線可以進來
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# 設定主機上提供的服務可讓外部網路存取
iptables -A INPUT -i $EIF -p udp --dport 22 -j ACCEPT #ssh
iptables -A INPUT -i $EIF -p udp --dport 22 -j ACCEPT
iptables -A INPUT -i $EIF -p tcp --dport 80 -j ACCEPT # http
# ... 其餘省略

# enable any connection for local LAN
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A OUTPUT -o eth1 -j ACCEPT

# NAT
iptables -t nat -A POSTROUTING -o $EIF -s $INNET -j MASQUERADE


* add the file into /etc/rc.local


Reference:
http://ljhuang.pixnet.net/blog/post/15029442


To enable dhcp server for mutil-interface

Under Ubuntu 8.04.3

* get DHCP server
sudo apt-get install dhcp3-server

* enable networking interface for DHCP server
sudo vi /etc/default/dhcp3-server

# what interface provide DHCP service
INTERFACES="wlan0 eth1"


* edit the DHCP server parameter
sudo vi /etc/dhcp3/dhcpd.conf

ddns-update-style none;
log-facility local7;

subnet 192.168.5.0 netmask 255.255.255.0 {
option routers 192.168.5.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.5.255;
option domain-name-servers 172.16.100.1, 172.16.100.16;
# option ntp-servers 172.16.100.1;
# option netbios-name-servers 172.16.100.1;
option netbios-node-type 2;
default-lease-time 86400;
max-lease-time 86400;

range 192.168.5.21 192.168.5.30;
}


Reference:
https://help.ubuntu.com/community/dhcp3-server



2009年12月6日 星期日

To access USB serial port

* In order to pre-mount USB device file system when system boot-up, to add parameter to /etc/fstab (in linux kernel 2.6)
$ vi /etc/fstab

none /proc/bus/usb usbfs defaults,devmode=0666 0 0

* Auto mount it
$ mount -a


ex: you can access USB serial port by device file /dev/ttyUSB0 or ttyUSB1


2009年12月2日 星期三

The "request_suspend_state"

request_suspend_state() in kernel/power/earlysuspend.c

u-boot setting, kernel loaded from SD card or TFTP

Kernel loader from SD card, uboot setting
nand unlock
nand ecc sw
setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init videoout=omap24xxvout omap_vout.video1_numbuffers=4 omap_vout.vid1_static_vrfb_alloc=y ip=192.168.5.10
setenv bootcmd 'mmcinit; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'
saveenv

Kernel loaded from TFTP, uboot setting
nand unlock
nand ecc sw
setenv serverip 192.168.5.1
setenv ipaddr 192.168.5.10
setenv netmask 255.255.255.0
setenv bootfile 'uImage'
setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init videoout=omap24xxvout omap_vout.video1_numbuffers=4 omap_vout.vid1_static_vrfb_alloc=y ip=192.168.5.10
setenv bootcmd 'tftp 81c00000 uImage;bootm'
saveenv

Print environment parameter
printenv

Boot immediately
boot


busybox's telnetd on Android

build busybox
下載 busybox source code
在busybox source code 目錄下,
$ make menuconfig

Busybox Settings -> Build Options ->
[*] Build BusyBox as a static binary (no shared libs)
Cross Compiler prefex
/opt/toolchain/arm-2008q3/bin/arm-none-linux-gnueabi-
Busybox Settings -> Installation Options->
[*] Don’t use /usr

$ make -I./opt/toolchain/arm-2008q3/arm-none-linux-gnueabi/libc/usr/include/
$ make install
$ cd _install/bin
$ tar zcvf busybox.tgz *

安裝 busybox 在 Android's myfs
$ mkdir $MYFS/data/busybox
$ cp busybox.tgz $MYFS/data/busybox
$ cd $MYFS/data/busybox
$ tar zxvf busybox.tgz

設定init.rc
$ vi /init.rc
export PATH /data/busybox:/sbin:........................

service telnetd /data/busybox/busybox telnetd -l /system/bin/sh
oneshot


reference:


2009年12月1日 星期二

重建mutil OS boot loader - GRUB

如果GRUB 原本安裝在MBR區
  • 準備WINGRUB, 在XP下將 grub 安裝到MBR
重建GRUB
  • 準備 linux live-CD, 開機進入live-CD mode
  • 在終端機執行 grub
  • grub> root (hd0,0)
    grub> setup (hd0)
    grub> quit



colinux Root FS image for ubuntu8.04

colinux Root FS image for ubuntu8.04

1. execute stable-coLinux-20080416.exe to install on c:\colinux folder or other folder.

2. extract ubuntu8colinux.rar to D:\

3. run cai.bat on d:\ubuntu8colinux folder.

4. ID/passwd is root/root

5. you can install ubuntu softwares with apt-get install xxx/apt-get update/apt-get upgrade

6. It is a tips, if you use local install ubuntu package.
Please use below steps:
(1)You can copy *.deb file to d:\ubuntu8colinux\xfs folder on the windows
(2) mv /opt/*.deb /var/cache/apt folder in the colinux command line.
(3) apt-get xxx package name to install ubuntu packages.

Detail to access http://www.colinux.org

other documents: to download ubuntu8colinux.cai.rar file from http://groups.google.com/group/iyaf site


1)ubuntu8colinux.rar下載地址http://www.fs2you.com/files/79fe4b00-13d1-11dd-9776-0014221f3995/

ubuntu8colinux.rar

2)others documents:
http://groups.google.com/group/iyaf
ubuntu8colinu.cai.rar

3)deb files:
http://www.fs2you.com/files/2c5caae1-db2b-11dc-9f83-00142218fc6e/
deb.rar
copy *.deb file to /var/cache/apt/archives and install with apt-get install xxx.



reference:

build Android under Ubuntu 9.10

  • Ubuntu 9.10 users may need to install a newer version of standard C++ library
$sudo apt-get install libstdc++6 
  • Ubuntu 9.10 users may need to add the old Jaunty repos to their /etc/apt/sources.list to install sun-java5-jdk
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse


Reference: http://omappedia.org/wiki/Android_Getting_Started

2009年11月25日 星期三

source list for ubuntu 8.04.3

# /etc/apt/source.list

deb http://ftp.twaren.net/Linux/Ubuntu/ubuntu/ hardy main universe restricted multiverse
deb-src http://ftp.twaren.net/Linux/Ubuntu/ubuntu/ hardy main universe restricted multiverse

deb http://ftp.twaren.net/Linux/Ubuntu/ubuntu/ hardy-security universe main multiverse restricted
deb-src http://ftp.twaren.net/Linux/Ubuntu/ubuntu/ hardy-security universe main multiverse restricted

deb http://ftp.twaren.net/Linux/Ubuntu/ubuntu/ hardy-updates universe main multiverse restricted
deb-src http://ftp.twaren.net/Linux/Ubuntu/ubuntu/ hardy-updates universe main multiverse restricted


deb ftp://os.nchc.org.tw/ubuntu/ hardy main universe restricted multiverse
deb-src ftp://os.nchc.org.tw/ubuntu/ hardy main universe restricted multiverse
deb ftp://os.nchc.org.tw/ubuntu/ hardy-security universe main multiverse restricted
deb-src ftp://os.nchc.org.tw/ubuntu/ hardy-security universe main multiverse restricted
deb ftp://os.nchc.org.tw/ubuntu/ hardy-updates universe main multiverse restricted
deb-src ftp://os.nchc.org.tw/ubuntu/ hardy-updates universe main multiverse restricted



# if your PC connect to internet via proxy, please add below command into ~/.bashrc
# export http_proxy=http://192.168.0.12:8080
# export ftp_proxy=http://192.168.0.12:8080

under cygwin, update Android source code via repo

* Install cygwin
* make sure git version is 1.5.4 or greater than.
* Install repo

* Repo Installation

Repo is a tool that makes it easier to work with GIT in the context of Android. For more information about Repo, see Using Repo and GIT.

To install, initialize, and configure Repo, follow these steps:

1. Make sure you have a ~/bin directory in your home directory, and check to be sure that this bin directory is in your path:
$ cd ~
$ mkdir bin
$ echo $PATH

2. Download the repo script and make sure it is executable:
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo



2009年11月24日 星期二

repo behind proxy

To use GIT behind a proxy, have a look at:

http://www.aptgetupdate.de/2007/07/27/git-hinterm-proxy-nutzen/

Basically the steps are:
1 - sudo apt-get install socket
2 - in your home directory, put a shell script called "proxy-cmd.sh"
containing (replace YOUR_PROXY and YOUR_PROXY_PORT with your own proxy
parameters)
:
#! /bin/bash
(echo "CONNECT $1:$2 HTTP/1.0"; echo; cat ) | socket YOUR_PROXY
YOUR_PROXY_PORT | (read a; read a; cat )
3 - chmod +x proxy-cmd.sh
4 - export GIT_PROXY_COMMAND=/proxy-cmd.sh

Enjoy,
Matthieu


http://groups.google.com/group/android-developers/browse_thread/thread/4afd67a3d4ac93da

2009年4月17日 星期五

好用的免費軟體

爬文時有網友介紹才知道這個freeware 資料網站
阿榮福利味網站http://azo-freeware.blogspot.com/


在mobile01 有網友也整理了一篇freeware 文章
覺得收集一下別人介紹的免費軟體也不錯, 以後也常用的到.
來源 http://www.mobile01.com/topicdetail.php?f=300&t=1020879

WPS Office 2007 (繁中、網頁)由中國金山所開發的Office軟體,檔案極小。其內容可以說100%和MS Office 2003相同。不用花錢,也不用重新學習新版的Office即可使用。

GIMP (英文、網頁)又名為Linux界的Photoshop,是套美術軟體。在Windows下不清楚是否有內建中文。另外似乎有"可攜"版的GIMP。

Notepad++ (繁中、可攜、網頁)這軟體能夠讓語法以高亮度顯示,並有語法摺疊的功能,且附有許多自訂的功能,能讓您更方便的撰寫程式。這款似乎也是100%台灣製造喔~另外PSPad也是個不錯的選擇。

色胚子 (繁中、可攜)擷取螢幕色碼、混色,只要有關顏色的東西交給他就對了。

Clonezilla (繁中、網頁)俗稱再生龍的備份軟體,本套為隨身碟版。將裡面的檔案複製到隨身碟後,依照說明檔使用。有用系統備份、還原的人絕對不能錯過這套免費的備份軟體。本軟體為100%台灣製造,麻雀雖小五臟俱全。不管Windows還是Linux都能使用。下載時請選擇clonezilla-live.zip,光碟版請選擇clonezilla-live.iso。

7-Zip (繁中)壓縮率超高的壓縮軟體,介面簡單。若覺得介面太醜,裡面有附加整套的佈景圖示,包您滿意。(圖示和介面保證換的比WinRAR好看)

Microsoft Office Word Viewer (繁中)沒錢買MSO又不想使用盜版,就用這個來開啟doc、docx檔吧。這套軟體只供檢視、列印,不能編輯。

Microsoft Office Excel Viewer (繁中)同上,開啟xml、xmlx的Excel檢視器。

Microsoft Office PowerPoint Viewer (繁中)同上,開啟ppt、pptx的投影片檢視器。

OpenOffice.org (繁中、網頁)除了自己的格式外,這套office還能夠編輯MS Office、PDF檔。但因難免有格式上的差異,所以不能完全取代其他office系統。可以使用上面的MSO Viewer來補足。

Adobe Reader (繁中、網頁)開啟PDF用的辦公軟體。

Ant Renamer 2 (繁中、可攜)重新命名軟體,可方便大量重新命名檔案。

Avira Antivir Personal (英文)德國防毒軟體免費版,偵測率極高,占用較少的系統資源。

CCleaner (繁中、可攜、網頁)一個相當穩定的磁碟清掃軟體,附有登錄檔清掃和其他自訂功能。

DoubleKiller (英文、可攜)這個軟體能找出同樣的檔案,方便刪除硬碟內重複檔案的軟體。

Dropbox 0.6.402 (英文)若有重要資料需要備份,或是常常分享檔案給別人,很適合使用。按裝後會將特定資料夾內的檔案備份到網路空間。詳細介紹請看這裡

ETD7.0.4.0 (繁中、驅動)筆記型電腦觸控板的驅動,可讓觸控板擁有iPhone的多指功能。

Freeraser (繁中、可攜)若您有像蠢冠希一樣的嗜好,本軟體能夠將您想刪掉的檔案徹底摧毀。

Greenfish Icon Editor Pro 172tw (繁中)編輯圖示、ICO、PNG的軟體,內涵豐富的外掛、特效。

Hamana (繁中、可攜)相當實用的圖片檢視器,能夠直接開啟壓縮檔內的圖片。並且可選擇兩頁並排,和翻書一樣閱覽,若遇到較寬的圖片,會自動以單張顯示。

HDTune (繁中、可攜)硬碟測試工具,可精準的測出您的硬碟是否壞軌。以及顯示硬碟資訊、測試硬碟速度。

Http File Server (英文、可攜)若有自己的網路,可將資料夾以網頁的樣是給別人下載。也可利用它來架設簡易的HTTP網站。

iF的佈景自行修改的EEEPC圖示,其中包含仿Ubuntu佈景。詳細介紹請看這裡

Java Disk Report v1.31 (英文)將資料夾的使用量以圖表顯示,可清楚的看出哪些檔案吃掉你的硬碟。

Mobile Meter (中文、可攜)以圖表CPU速度、硬體溫度、充電、用電量的軟體。相當適合給筆電使用,占用資源極小。本站已經將圖示換過,較好看。另外在iF佈景.zip裡也有別的樣式。

PhotoCab (繁中)一套外觀不怎樣的圖片修改軟體。介面雖舊,但功能卻很強。

Rainlender (繁中、可攜)簡潔又美觀的桌面行事曆軟體。

Recuva (繁中、可攜)檔案救援軟體,可將誤刪的檔案找回來。前提是分割磁區必須存在。介面簡單易用,適合初學者。

RMClock (中文、網頁)調整CPU時脈、電壓的超頻、降頻軟體。功能豐富,適合初學者使用。

RocketDock (繁中)仿MAC蘋果電腦的工作列,占用資源少。

RoyaleWindows Media Center的佈景主題,使用XP的人常用。

StormCodec 6.04.08 (繁中)看影片專用的輕巧播放解碼器。安裝時建議把QuickTime解碼器取消,避免解碼器衝突。

StrEdit v4.1.1 (繁中)超好用的影片字幕編輯器,內含簡繁轉換、統一修改時間表等功能。

Sweet Little Piano 32 (繁中)MIDI樂器,能把你的電腦變成樂器,例如鋼琴、吉他、喇叭等。本軟體已參考維基百科繁體中文化。

SyncBack (繁中)同步檔案複製工具,功能簡單扼要。檔案名稱不支援萬國碼,僅支援繁體中文、英文。

Taskbar Suffle (英文)可自由調整、移動工具列的排列方式,包括右邊的小圖示。

TeamViewer (繁中、可攜)免安裝遠端連線軟體,使用時雙方電腦都需下載此軟體才可執行。

THG Clock (英文、可攜)湯姆硬體指南提供的CPU時脈偵測工具。本工具測出的似乎是壓迫過的時脈,並非原始時脈。

Trayit v4.655 (英文)安裝後用滑鼠右鍵按X可將視窗縮小到工具列右下角。還有其它進階設定,例如特定名稱的視窗直接縮到右下角、更改圖示。

TweakUI (繁中、可攜)MS出的XP修改工具。能夠更改捷徑圖示、桌面圖示等視窗功能。

Ubuntu theme for XP喜歡Ubuntu卻沒只能用XP的朋友可以裝個心酸。其中當然沒有像Ubuntu那樣的扭動特效。本程式需要破解XPtheme限制。

uTorrent (繁中、可攜)簡潔省資源又迅速的BT軟體。

ViOrb R1能讓XP開始按鈕變得和Vista一樣,能自行更換PNG圖案。由於是Beta階段,部分電腦可能會讓CPU跑到100,逐一修正中。

WindClick (繁中、可攜)功能豐富的滑鼠連點軟體。可以設定特定視窗上的座標連續點選,讓使用者能邊用滑鼠做別的事,邊瘋狂點螢幕。

Windows Live 8.5 (繁中)離線版的Live 8.5,內含Messenger、手寫功能、Mail、Writer、Photo、登入小幫手,可分開安裝。

Xentient Thumbnails安裝後所有圖檔的圖示都會用圖片縮圖顯示。

關鍵字:免費、正版、軟體、下載