2013年12月24日 星期二

Linux Traffic Control

Ubuntu 12.04 LTS


Traffic Shaping, Bandwidth Shaping, Packet Shaping with Linux tc htb
http://www.iplocation.net/tools/traffic-control.php
Strange....
I use his script, but found that setting 10kbit is actually 200kbit in real traffic. So I set 70kbit for 1400kbit.


Traffic Control HOWTO
http://linux-ip.net/articles/Traffic-Control-HOWTO/

A Practical Guide to Linux Traffic Control
http://blog.edseek.com/~jasonb/articles/traffic_shaping/

Bandwidth Limiting with IP Masquerade - Howto
http://www.szabilinux.hu/bandwidth/

Bandwidth Monitoring

Freshmeat.
These following tools are recommended:
bwm ==> very simple, ncurses based, for quick and easy overall network summary.
iptraf ==> very robust, ncurses based, my favorite, without kernel patch it lets you monitor specific host based on MAC Addresses
connmon ==> ncurses and gtk interfaces. With kernel patch you can monitor individual ip bandwidths

2013年12月23日 星期一

[GIT] Finding a branch point

Finding a branch point with Git? - Stack Overflow
http://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git

git config --global alias.oldest-ancestor '!zsh -c '\''diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | head -1'\'' -'

2013年12月19日 星期四

tmux

C+b c 開新視窗
C+b n 或 space 切換到下一個視窗
C+b P 切換到上一個視窗
====視窗分割功能======
C+b " 水平分割視窗
C+b % 垂直分割視窗
C+b up or down 切換分割視窗
C+b + Ctrl + 方向鍵上/下/左/右
指令 exit 跳出當前分割視窗

C+b [ 捲動, 用PgUp/PgDn, q跳出

tmux ls :list sessions
tmux attach -t TARGET_SESSION: attach session

tmux教學 | 在水一方
http://blog.vic.mh4u.org/2012/707

使用 tmux 與 tmuxifier 打造 Console 開發環境(比 screen 更棒) - 玩物尚誌
http://blog.lyhdev.com/2013/01/tmux-tmuxifier-console-screen.html

終端機必備的多工良伴:tmux - @ChingHanHo
http://blog.chh.tw/posts/tmux-terminal-multiplexer/

Tmux 教學 + Screen 到 Tmux 的無痛轉換 - Tsung's Blog
http://blog.longwin.com.tw/2011/04/tmux-learn-screen-config-2011/

tmux 指令速查 | Midashuang's Blog
http://midashuang.wordpress.com/2010/12/07/tmux-%E6%8C%87%E4%BB%A4%E9%80%9F%E6%9F%A5/

2013年12月17日 星期二

DNP stands for "Do Not Populate" in schematics



Schematics says DNP... what do I put in ?
http://www.edaboard.com/thread32000.html
"Do Not Populate" means exactly what it says - do not put a resistor there.


2013年12月11日 星期三

Some 32-bit pre-built binary not work in 64-bit Ubuntu


Ubuntu 12.04.3 amd64 desktop

Some 32-bit pre-built binary might not work in 64-bit environment, e.g.:

# XXXX -v
bash: XXXX: No such file or directory
Some would report "bash: XXXX: Not found".

With 64-bit Ubuntu, install the following package fixed my problem:
apt-get install libc6:i386

64 bit - What happened to the ia32-libs package? - Ask Ubuntu
http://askubuntu.com/questions/107230/what-happened-to-the-ia32-libs-package

2013年12月8日 星期日

運動時間與脂肪的消耗

登山前一定要知道的事 – 燃料耗盡引起的疲勞 | 山姆伯伯工作坊
http://www.unclesam.cc/blog/what-food-should-you-take-hiking/

這些燃料能夠維持幾個小時的能量供給呢?若不休息持續的運動,脂肪可以維持「一星期」;而碳水化合物只能維持「不到1.5個小時」。因為即便是碳水化合物與脂肪各半燃燒,登山3小時後,碳水化合物就會先耗盡。
但碳水化合物即使不與脂肪混合也會燃燒,但脂肪卻必須與碳水化合物混合才能燃燒。因此,若碳水化合物耗盡,即使脂肪還存留許多,肌肉還是會變得無法運作的。
將碳水化合物視為燃燒脂肪時的燃燒觸媒,應該比較容易理解。因此,為了健康而想要多燃燒一些脂肪的話,反而應該要邊行走邊積極補充碳水化合物才是。什麼都不吃的行走方式,不僅會感到疲疲,也沒有燒到脂肪,等於是徒勞無功。
為什麼運動時間拉長,消脂效果更好? - iFit 愛瘦身
http://www.i-fit.com.tw/context/105.html
有氧運動的強度與能量消耗來源的介紹 (減重、燃脂) | 山姆伯伯工作坊
http://www.unclesam.cc/blog/aerobic-exercise-intensity-and-energy-source/
在最大心跳的65~70%,持續60~90分鐘,消耗的脂肪是60%,而碳水化合物是40%。隨著強度愈高,消耗碳化化合物的比重就愈高。
燃脂:使用體脂肪做為燃料,而非碳水化合物(上) | 山姆伯伯工作坊
http://www.unclesam.cc/blog/fat-burning-using-body-fat-instead-of-carbohydrates-as-fuel/
影響脂肪氧化的因素(Factors affecting fat oxidation)【運動強度】Fatmax為強度為「最大攝氧量的62%~63% 或 最大心跳率的 70%~75%」;而鮮少進行訓練的人,Fatmax大約在最大心跳率的50%。

【飲食效果】高碳水化合物的飲食會抑制 脂肪氧化,而低碳水化合物的飲食導致提高脂肪氧化。在運動前數個小時,攝取碳水化合會提高胰島素的分泌並抑制脂肪氧化,幅度高達35%。用餐之後,胰島素 對於脂肪氧化的影響可能會持續6至8個小時,這意味著,禁食一夜之後,脂肪氧化速度會達到最高。
燃脂:使用體脂肪做為燃料,而非碳水化合物(下) | 山姆伯伯工作坊
http://www.unclesam.cc/blog/fat-burning-using-body-fat-instead-of-carbohydrates-as-fuel-2/
咖啡因(Caffeine)
燃燒體脂肪作為長跑的能量 @ 獵豹的瑣事 :: 痞客邦 PIXNET ::
http://jack197247.pixnet.net/blog/post/30504646-%E7%87%83%E7%87%92%E9%AB%94%E8%84%82%E8%82%AA%E4%BD%9C%E7%82%BA%E9%95%B7%E8%B7%91%E7%9A%84%E8%83%BD%E9%87%8F

2013年12月4日 星期三

DDR3 related

[wiki] DDR3
http://en.wikipedia.org/wiki/Ddr3

[wiki] CAS latency
http://en.wikipedia.org/wiki/CAS_latency

[wiki] DIMM
http://en.wikipedia.org/wiki/DIMM

[wiki] SO-DIMM
http://en.wikipedia.org/wiki/SO-DIMM

[wiki] Serial presence detect (SPD)
http://en.wikipedia.org/wiki/Serial_presence_detect

Annex K: Serial Presence Detect (SPD) for DDR3 SDRAM Modules
Document Release 3
http://www.jedec.org/sites/default/files/docs/4_01_02_11R21.pdf
SPD Revision 1.0
http://www.jedec.org/sites/default/files/docs/4_01_02_11R20.pdf

Understanding DDR3 Serial Presence Detect (SPD) Table
http://www.simmtester.com/page/news/showpubnews.asp?num=153 

[wiki] On-Die Termination (ODT)
http://en.wikipedia.org/wiki/On_Die_Termination

AN520: DDR3 SDRAM Memory Interface Termination and Layout Guidelines - an520.pdf
http://www.altera.co.jp/literature/an/an520.pdf

2013年11月19日 星期二

2013/10/12-14 手作步道在同禮

我們的島 第734集 鋪一條路回家 (2013-11-25) - YouTube
http://youtu.be/QyidWNi2M4U


【大愛全紀錄】20131117 - 被遺忘的藝術 - YouTube
http://youtu.be/E1E9N8-9eDU


20131013同禮部落手作步道工作假期_神秘谷之歌 - YouTube
http://youtu.be/opSgYVfFSs4


20131013同禮部落手作步道工作假期_你若高興你就 - YouTube
http://youtu.be/dtHsKJqeCAk


20131013同禮部落手作步道工作假期_哈利路亞 - YouTube
http://youtu.be/iQJTQYCbxbA


20131014同禮部落手作步道工作假期_Abu的歌聲 - YouTube
http://youtu.be/51LXUXW2ANg


2013年11月12日 星期二

WINE with GPS bluetooth device

Wasted lots of time in regedit, but all I need is just chmod. regedit should not be needed. The link name "com1" is case sensitive.

sudo apt-get install wine
cd ~/.wine/dosdevices
ln -s /dev/ttyUSB1 com1

sudo chmod uag+rw /dev/ttyUSB1
I use putty for testing. Choose Serial, input: COM1, 115200. The COM1 is NOT case-sensitive.




WINE
On configuration of serial ports on wine - Ask Ubuntu
http://askubuntu.com/questions/331594/on-configuration-of-serial-ports-on-wine

WineHQ - Other Things to Configurehttp://www.winehq.org/docs/wineusr-guide/misc-things-to-configure

Wine and COM serial ports
http://forum.winehq.org/viewtopic.php?f=8&t=18385

Getting X-CTU in Wine to detect your serial ports
http://www.downtowndougbrown.com/2013/03/getting-x-ctu-in-wine-to-detect-your-serial-ports/
(I cannot achieve the same with Ubuntu 12.04+X-CTU)



Ubuntu + GPS bluetooth device

Bluetooth and serial ports | www.mycrofters.com
http://www.mycrofters.com/content/bluetooth-and-serial-ports

Using Bluetooth GPS
http://ubuntuforums.org/showthread.php?t=200142

Using Bluetooth GPS - Linux Ubuntu 9.10 - Memorymap Wine
http://www.stonefisk.com/index.php/2009/12/14/using-bluetooth-gps-linux-ubuntu-9-10-me

BluetoothGPS - Ubuntu Wiki
https://wiki.ubuntu.com/BluetoothGPS


2013年11月5日 星期二

美國手機預付卡


台灣到美國短期旅遊出差之手機使用問題 @ 灣區生活萬花筒 :: 痞客邦 PIXNET ::
http://goldendonkey.pixnet.net/blog/post/13588084-%E5%8F%B0%E7%81%A3%E5%88%B0%E7%BE%8E%E5%9C%8B%E7%9F%AD%E6%9C%9F%E6%97%85%E9%81%8A%E5%87%BA%E5%B7%AE%E4%B9%8B%E6%89%8B%E6%A9%9F%E4%BD%BF%E7%94%A8%E5%95%8F%E9%A1%8C

【2012飛去旅行】美國手機預付卡& 上網篇 (T-Mobile Prepaid SIM Card 與 GPS租借) BY CH @ Sylvia's Fantasyland :: 痞客邦 PIXNET ::
http://hakunamatata123.pixnet.net/blog/post/42243605-%E3%80%902012%E9%A3%9B%E5%8E%BB%E6%97%85%E8%A1%8C%E3%80%91%E7%BE%8E%E5%9C%8B%E6%89%8B%E6%A9%9F%E9%A0%90%E4%BB%98%E5%8D%A1%26-%E4%B8%8A%E7%B6%B2%E7%AF%87-%28t-mo

美國一天兩元手機行動上網/講電話/簡訊吃到飽 (t-mobile) @ Beer :: 痞客邦 PIXNET ::
http://beergt.pixnet.net/blog/post/47313668-us3g

美國 T-Mobile 手機預付卡 - 美國手機預付卡, 美國上網/美國3G上網預付卡, 國際電話卡, 國外旅遊電話卡 - CT 國際電話服務站
http://www.callingtaiwan.com.tw/p/t-mobile%E7%BE%8E%E5%9C%8B%E9%A0%90%E4%BB%98%E5%8D%A1

2013年10月30日 星期三

Decompile MIPS binary

Reverse Engineering Resources - Decompilers
http://www.backerstreet.com/decompiler/decompilers.htm

The Decompilation Wiki
http://www.program-transformation.org/Transform/DeCompilation

Boomerang Decompiler
http://boomerang.sourceforge.net/index.php

sudo apt-get install libgc-dev libcppunit-dev libexpat1-dev xutils-dev
./configure;
make remote;
make;
make install
(prebuilt binary has no MIPS support...)

REC Decompiler Home Page
http://www.backerstreet.com/rec/rec.htm

de-mips - A simple MIPS decompiler - Google Project Hosting
http://code.google.com/p/de-mips/

Source Checkout - de-mips - A simple MIPS decompiler - Google Project Hosting
http://code.google.com/p/de-mips/source/checkout

Retargetable Decompiler
http://decompiler.fit.vutbr.cz/
(Cannot take u-boot bin file)


2013年10月29日 星期二

California Marathons


California Marathons
http://marathons.ahotu.com/calendar/marathon/california

2013 Running Events in California
http://roadracerunner.com/Races/RunningCalendar.aspx?state=ca

Hiking near San Jose - Best Hikes, Guides, and Trail Maps | EveryTrail
http://www.everytrail.com/best/hiking-san-jose-california

San Jose Trails - Best San Jose camping, hiking & biking trails | AllTrails.com
http://alltrails.com/us/california/san-jose

Bike Rentals San Jose
http://www.yelp.com/search?cflt=bikerentals&find_loc=San+Jose%2C+CA

Road Bike Rental San Jose California - UDC
http://udcbikerental.com/bike-rental-san-jose.php

2013年10月28日 星期一

Create symbol table

Analysis of an unknown binary
http://old.honeynet.org/reverse/results/sol/sol-06/analysis.html

The Honeynet Project
http://old.honeynet.org/index.html

Reverse-Engineering Malware Paper by Lenny Zeltser
http://zeltser.com/reverse-malware-paper/

Create core dump file

gcore
core

debugging - Is it possible to get a core dump of a running process and it's symbol table? - Stack Overflow
http://stackoverflow.com/questions/68160/is-it-possible-to-get-a-core-dump-of-a-running-process-and-its-symbol-table

Core File Generation - Debugging with GDB
https://sourceware.org/gdb/onlinedocs/gdb/Core-File-Generation.html

gdb - Core dump file analysis - Stack Overflow
http://stackoverflow.com/questions/5115613/core-dump-file-analysis

Getting the call stack without a frame pointer

Getting the call stack without a frame pointer
http://www.yosefk.com/blog/getting-the-call-stack-without-a-frame-pointer.html

x86 bt: a script getting the call stack from a core file without relying on gdb's bt command but relying on its disassemble command.
http://yosefk.com/sw/bt



fcamel 技術隨手記: 用 python gdb 客製化 backtrace 的結果

http://fcamel-life.blogspot.tw/2013/08/python-gdb-backtrace.html

How does GDB find the symbol of a function when backtracing in MIPS Linux? - Stack Overflow
http://stackoverflow.com/questions/1051872/how-does-gdb-find-the-symbol-of-a-function-when-backtracing-in-mips-linux

2013年10月25日 星期五

12.04LTS and the Telstra AirCard 320U 4G mobile wireless modem

Ubuntu 12.04.3 LTS, 3.5.0-41-generic #64-precise1-Ubuntu SMP
Notice: My ubuntu has been updated. My LTE environment might not be completed, for it is the eNodeB that I'm testing.

Sierra Wireless - Support Center
http://mycusthelpadmin.net/SIERRAWIRELESS/_cs/AnswerDetail.aspx?sSessionID=5180C4D3AD1341438EDD065089DFC5A4QTKEYQOQ&aid=44

I have ttyUSB0-4, 1-3 is created by the adapter. And minicom can connect to ttyUSB3 and send AT command.

115200-8N1, no flow control.

Do check the /var/log/syslog with "tail -f /var/log/syslog". Sometimes I got error when the minicom halt:

[268038.108951] sierra_net 2-4:1.7: wwan0: Submit SYNC failed -32
[268038.108965] sierra_net 2-4:1.7: wwan0: Send SYNC failed, status -32
I fixed it by unplug and plug the adapter again.

"ati5" shows modem IMEI and Firmware

"at+cgdcont ?" shows created profiles
"at!scprof=<profile_id>,"",1,0,0,0" set profile to auto connect
"at+cfun=1" turn on radio
"at!scact=1,<profile_id>" manual connect
"at!scact=0,<profile_id>" manual disconnect
"at!scdftprof=<profile_id>" set default profile
"at!scpaddr=<profile_id>" shows the IP address get by profile

First, I use the AT command to have the adapter get connected. However, somehow, the network manager doesn't know that it is connected. So I get the IP by the AT command (at!scpaddr), says 192.168.1.150, and set it by ifconfig:
ifconfig wwan0 192.168.1.150



Re: 12.04LTS and the Telstra 4G mobile wireless modem
http://www.mail-archive.com/ubuntu-au@lists.ubuntu.com/msg05253.html
http://www.mail-archive.com/ubuntu-au@lists.ubuntu.com/msg05260.html

How To Get Telstra 4G Mobile Broadband Working With Linux | eigenmagic
http://www.eigenmagic.com/2012/03/14/how-to-get-telstra-4g-mobile-broadband-working-with-linux/
Forcing 4G Mode
"AT+ZSNT=6,0,0" force the modem into 4G mode
"AT+ZSNT=0,0,0" put the modem into auto-negotiate mode
Telstra 4G Mobile Broadband Setup
http://ubuntuforums.org/showthread.php?t=2074518

2013年10月20日 星期日

Disassemble u-boot.bin

This script not only disassemble u-boot.bin, but also regenerate a elf that could be used for GDB.

./disassemble.pl <offset> <binary_file>
./disassemble.pl 0xc0000000 u-boot.bin

GPL:disassemble.pl - CHDK Wiki
http://chdk.wikia.com/wiki/GPL:disassemble.pl#
#!/usr/bin/perl
 
# disassemble alien binary blobs
# look for "ldr .., [pc + #nn]" etc. 
# and add strings and values it refers to
#
# (c) 2008 chr
# GPL V3+
#
# v0.2.1:
# * create labels for branch targets
# v0.2:
# * catch unaligned strings
# * note on strings
# * check for integer overflow
 
# use Data::Dumper;
# $Data::Dumper::Sortkeys = 1;
 
# Added to support execution of disassembler.pl
# when not in the same folder as binary file to
# be disassembled.
use Cwd;
$firmware_basepath = getcwd;
 
# adjust these for your needs (note final slash):
#$path = "$ENV{'HOME'}/gcc-4.1-arm/bin/";
$path = "";
 
# note on "strings": default is a minimum length of 4 chars.
# So if u are hunting for e.g. "FI2" add -n3
# However, it gives a lot of false positive.
$strdump = "strings -t x";
$objdump = "${path}arm-elf-objdump";
$objcopy = "${path}arm-elf-objcopy";
 
if (@ARGV != 2) {
	die("Usage: $0 0x ");
}
 
$offset  = $ARGV[0];
$binfile = $ARGV[1];
$firmware_file_path = "$firmware_basepath/$ARGV[1]";
 
# check if we wrap over
die "error stat($firmware_file_path): $!" unless ($flen = (stat($firmware_file_path))[7]);
 
if ( hex($offset) + $flen - 1 > 0xffffffff) {
	die "offset + filesize - 1 > 0xffffffff. We can't wrap around!\n\ngame over"
}
 
#####
print "string dump\n";
my %strings;
open(IN, "$strdump \"$firmware_file_path\" |") or die "cannot start $strdump \"$firmware_file_path\": $!";
open(OUT,">$firmware_file_path.strings") or die "cannot write to $firmware_file_path.strings: $!";
while () {
	/^ *([[:xdigit:]]*) (.*)/;
	my $addr     = hex($1) + hex($offset);
	my $addr_str = sprintf("%08x", $addr);
	$strings{$addr_str} = $2;
 
	print OUT "$addr_str $2\n"; 
 
	# align string address so unaligned strings appears in disassemble
	$addr_str = sprintf("%08x", $addr & ~0x3);
	my $offs = $addr & 0x3;
	$strings{$addr_str} = '.' x $offs . $2;
 
}
close IN;
close OUT;
 
#$strings{'ff810164'} = "TEST test";
#$strings{'ff810420'} = "add test";
#print Dumper(\%strings);
#exit;
 
#####
print "create elf file\n";
 
`$objcopy --change-addresses=$offset -I binary -O elf32-littlearm -B arm \"$firmware_file_path\" \"$firmware_file_path.elf\"`;
`$objcopy --set-section-flags .data=code,load,alloc,content \"$firmware_file_path.elf\"`;
 
#####
print "label scan\n";
my %labels;
open(IN, "$objdump -d \"$firmware_file_path.elf\" |")
      or die "cannot start $objdump \"$firmware_file_path\": $!";
open(OUT,">$firmware_file_path.labels") or die "cannot write to $firmware_file_path.labels: $!";
 
while () {
        if (my ($addr, $dest) = $_ =~ /^ *([[:xdigit:]]+):[ \t]+[[:xdigit:]]+[ \t]+[Bb][[:alpha:]]*[ \t]+([[:xdigit:]]+)/) {
                if ($labels{$dest} lt 1) {
                        print OUT "$dest ($addr)\n";
                }
                $labels{$dest} += 1;
                print "\r0x$addr  ";
        }
}
close IN;
close OUT;
 
#####
print "\ndisassemble and string lookup\n";
 
open(IN, "$objdump -d \"$firmware_file_path.elf\" |")
      or die "cannot start $objdump \"$firmware_file_path\": $!";
open(OUT,">$firmware_file_path.dis") or die "cannot write to $firmware_file_path.dis: $!";
open(BIN, "<$firmware_file_path") or die "cannot read $firmware_file_path";
 
binmode BIN;
 
while () {
	if ($_ eq "	...\n") { print OUT $_; next;}
 
	my ($addr, $line) = $_ =~ /^ *([[:xdigit:]]*):(.*)/ or next;
 
	# ff810b98:	e51f2060 	ldr	r2, [pc, #-96]	; ff810b40 <_binary_dump_bin_start xb40="">
	# ff815dd4:	e28f10dc 	add	r1, pc, #220	; 0xdc
	if (
		($line =~ /^(.*\tldr.*\[pc, #([-\d]+).*; )/) ||
		($line =~ /^(.*\tadd.*pc, #([-\d]+).*; )/)
	) {
		$line = $1;
		my $off = hex($addr) - hex($offset) + $2 + 8;
		my $point = sprintf("%08x", hex($addr) + $2 + 8);
		my $value = &get_word($off);
		$line .= "$point: ($value) ";
		if (my $str = $strings{$point}) {
			# add pointed string
			$line .= qq| *"$str"|;
		}
		elsif (my $str = $strings{$value}) {
			# pointer to pointer ...
			$line .= qq| **"$str"|;
		}
	} 
	# ff815e1c:	e24f0090 	sub	r0, pc, #144	; 0x90
	elsif ($line =~ /^(.*\tsub.*pc, #([-\d]+).*; )/) {
		$line = $1;
		my $off = hex($addr) - hex($offset) - $2 + 8;
		my $point = sprintf("%08x", hex($addr) - $2 + 8);
		my $value = &get_word($off);
		$line .= "$point: ($value) ";
		if (my $str = $strings{$point}) {
			$line .= qq| *"$str"|;
		}
		elsif (my $str = $strings{$value}) {
			$line .= qq| **"$str"|;
		}
	}
        # ff81015c:       3afffffc        bcc     ff810154 <_binary__blah ...="">
        elsif ($line =~ /^([ \t]*[[:xdigit:]]+[ \t]+[Bb][[:alpha:]]*[ \t]+)([[:xdigit:]]+)/) {
                $line = "$1loc_$2"
        }
        # insert label
        if ($labels{$addr} gt 1) {
                print OUT "loc_$addr: ; $labels{$addr} refs\n";
        } elsif ($labels{$addr} gt 0) {
                print OUT "loc_$addr:\n";
        }
	# add string comment
	if (my $str = $strings{$addr}) {
		print OUT qq|"$str":\n|;
	}
	print OUT "$addr: $line\n"; 
	print "\r0x$addr  ";
}
close IN;
close OUT;
 
#####
print "\njob complete!\n";
 
sub get_word {
	my $off = shift;
	my $ret;
 
	seek(BIN, $off, 0);
	my $c = read(BIN, $ret, 4);# or die "off: $off $! ($ret)";
	return ($c > 0 ? sprintf("%08x", unpack("I", $ret)) : '???');
}


With the following changes:
diff --git a/disassemble.pl b/disassemble.pl
index fea0761..1a85518 100644
--- a/disassemble.pl
+++ b/disassemble.pl
@@ -27,12 +27,16 @@ $firmware_basepath = getcwd;
 #$path = "$ENV{'HOME'}/gcc-4.1-arm/bin/";
 $path = "";
  
+#$cross = "arm-elf-";
+$cross = "mips64-octeon-linux-gnu-";
 # note on "strings": default is a minimum length of 4 chars.
 # So if u are hunting for e.g. "FI2" add -n3
 # However, it gives a lot of false positive.
 $strdump = "strings -t x";
-$objdump = "${path}arm-elf-objdump";
-$objcopy = "${path}arm-elf-objcopy";
+$objdump = "${path}${cross}objdump";
+$objcopy = "${path}${cross}objcopy";
+#$objcopy_param = " -I binary -O elf32-littlearm -B arm ";
+$objcopy_param = "-I binary -O elf32-ntradbigmips -B mips:octeon2 ";
  
 if (@ARGV != 2) {
        die("Usage: $0 0x ");
@@ -79,7 +83,7 @@ close OUT;
 #####
 print "create elf file\n";
  
-`$objcopy --change-addresses=$offset -I binary -O elf32-littlearm -B arm \"$firmware_file_path\" \"$firmware_file_path.elf\"`;
+`$objcopy --change-addresses=$offset ${objcopy_param} \"$firmware_file_path\" \"$firmware_file_path.elf\"`;
 `$objcopy --set-section-flags .data=code,load,alloc,content \"$firmware_file_path.elf\"`;
  
 #####





Linux下如何反汇编arm raw binary文件 - ZhengKarl的专栏 - 博客频道 - CSDN.NET
http://blog.csdn.net/zhengkarl/article/details/5663042


GPL Disassembling - CHDK Wiki
http://chdk.wikia.com/wiki/GPL_Disassembling

linux下的arm反汇编-CPU与编译器-ChinaUnix.net
http://bbs.chinaunix.net/thread-1948607-1-1.html

The following works:
mips64-octeon-linux-gnu-objdump  u-boot.bin -b binary -D -m mips:octeon2 -M reg-names=n32,reg-names=octeon2 -EB | head

u-boot.bin:     file format binary


Disassembly of section .data:

0000000000000000 <.data>:
       0:    1000013f     b    0x500
       4:    00000000     nop
       8:    424f4f54     c0    0x4f4f54


Emulating Digicam with QEMU - page 4 - General Discussion and Assistance - CHDK Forum
http://chdk.setepontos.com/index.php/topic,1918.msg20065.html#msg20065
Emulating Digicam with QEMU - page 5 - General Discussion and Assistance - CHDK Forum
http://chdk.setepontos.com/index.php?topic=1918.msg28546#msg28546
disassemble_with_stubs_funcs-v1.0.zip 
http://chdk.setepontos.com/index.php?action=dlattach;topic=1918.0;attach=2786


2013年10月18日 星期五

Debugging Octeon u-boot with GDB+BDI2000

You can use GDB either in Octeon SDK (mips64-octeon-linux-gnu-gdb) or Linux multiarch version GDB (gdb-multiarch).

Do the following In GDB shell, or, edit .gdbinit at directory that you run gdb
# Give -nx will prevent prevent .gdbinit from executed

set architecture mips:octeon2
set heur 0
set remoteti 10
set mips abi n64
set os none
set endian big

target remote [BDI2000_IP]:2001


x/i $pc

n(next)
c(conti)
bt(backtrace)
br(break)



ddd --debugger mips64-octeon-linux-gnu-gdb



 GDB: Error: Remote 'g' packet reply is too long:
  1. Mismatch of architecture. To show supported architectures:
    set architecture
  2. (?) --with-expat 
  3. (?)gdb-multiarch
  4. (?)modifying gdbstub.c (in qemu sources) to send 64bit registers

qt4 - Problem gdb remote debugging - Remote 'g' packet reply is too long - Stack Overflow
http://stackoverflow.com/questions/4896316/problem-gdb-remote-debugging-remote-g-packet-reply-is-too-long

gdb - Remote 'g' packet reply is too long - Stack Overflow
http://stackoverflow.com/questions/8662468/remote-g-packet-reply-is-too-long

Question #193249 : Questions : GCC ARM Embedded
https://answers.launchpad.net/gcc-arm-embedded/+question/193249


gdb-remote
http://www.cs.sfu.ca/~fedorova/Tech/simics-guides-3.0.26/simics-reference-manual-public-all/topic96.html



 Whenever BDI2000 get connected,  the PC get reset.
- TARGET: processing power-up delay
- TARGET: processing user reset request
- Core#0: ID code is 0x19400399
- Core#0: IMP reg is 0xA1404001
- TARGET: resetting target passed
- TARGET: processing target startup ....
- TARGET: processing target startup passed
cnMIPS#0>info
    Core state        : debug mode
    Debug entry cause : JTAG break request
    Current PC        : 0xffffffffbfc00000
    Current SR        : 0x505000e4
    Current LR  (r31) : 0xffffffffc003c86c
    Current SP  (r29) : 0xffffffffffff9710
FIX: check the BDI cfg file, which might be tftped from your tftp server, under [TARGET] section, and see if there is a command "RESET JTAG". If so, comment the line. (If not, god bless you.....)


gdb + BDI2000
Home - Abatron AG
http://www.abatron.ch
Older Products - Abatron AG
http://www.abatron.ch/products/bdi-family/older-products.html
GNU Support - Abatron AG
http://www.abatron.ch/products/debugger-support/gnu-support.html
JTAG debug interface for GNU Debugger
http://www.abatron.ch/fileadmin/user_upload/products/pdf/ManGdb55xx-3000.pdf

bdiGDB
http://www.ultsol.com/index.php/component/content/article/8/31-bdigdb

Kernel Debugging with GDB
http://dslab.lzu.edu.cn:8080/docs/publications/kernel_gdb.pdf

USI AN#02-001a: Using the Abatron BDI2000 to Debug a Linux Kernel
http://www.recipes4linux.com/recipes/bdi2000/kerneldebug/Tool%20Talk%2002-001a-Debug-Linux%20Kernel.pdf

USI AN#03-001: Installing, Configuring and Using GDB for the PowerPC
http://www.ultsol.com/pdfs/Tool_Talk_03-001-Using-GDB-for-PowerPC.pdf

BDI2000Usage < Training < DENX
http://www.denx.de/wiki/view/Training/BDI2000Usage

DebuggingUBoot < DULG < DENX 
http://www.denx.de/wiki/DULG/DebuggingUBoot

BDI2000和GDB联合调试mips_智慧居_百度空间
http://hi.baidu.com/whvyawpbmtanove/item/b772c4a548d397f614329b13

Debugging on DaVinci using BDI2000 - Texas Instruments Wiki
http://processors.wiki.ti.com/index.php/Debugging_on_DaVinci_using_BDI2000








MIPS64


MIPS64™ Architecture For Programmers Volume I:
Introduction to the MIPS64™ Architecture
http://www.ece.lsu.edu/ee4720/mips64v1.pdf

4.1 CPU Instructions, Grouped By Function
(.....................)
Each instruction is 32 bits long
MIPS64® Architecture For Programmers Volume II:
The MIPS64® Instruction Set
http://scc.ustc.edu.cn/zlsc/lxwycj/200910/W020100308600769158777.pdf

MIPS IV Instruction Set
http://math-atlas.sourceforge.net/devel/assembly/mips-iv.pdf

CS4617 Computer Architecture Lecture 4: Instruction Set Architectures 2
http://www.cs.ucc.ie/~jvaughan/cs4617/slides/lecture4.pdf

[wiki] MIPS architecture
http://en.wikipedia.org/wiki/MIPS_architecture#cite_note-2
http://en.wikipedia.org/wiki/MIPS_architecture#Compiler_register_usage

MIPS Quick Tutorial
http://logos.cs.uic.edu/366/notes/mips%20quick%20tutorial.htm


assembly - MIPS stack frame (and "addiu" instruction confusion) - Stack Overflow
http://stackoverflow.com/questions/6835724/mips-stack-frame-and-addiu-instruction-confusion

MIPS Assembly/Instruction Formats - Wikibooks, open books for an open world
http://en.wikibooks.org/wiki/MIPS_Assembly/Instruction_Formats

(MIPS)指令表示法
http://www.cis.nctu.edu.tw/~info27/ch3/repre.htm

Register Usage in MIPS ABI
http://www.inf.ed.ac.uk/teaching/courses/car/Notes/slide03.pdf

MIPS $gp register - Stack Overflow
http://stackoverflow.com/questions/2618790/mips-gp-register

The rules for MIPS call convention
http://www.cs.umb.edu/cs641/MIPscallconvention.html
http://www.cs.ucsb.edu/~franklin/30/spim/BookCallConvention.htm

[wiki] MIPS architecture - Compiler register usage
http://en.wikipedia.org/wiki/MIPS_architecture#Compiler_register_usage 

2013年9月17日 星期二

How to open a file in terminal?


How can I open a file in my terminal, like nautilus does it? - Ask Ubuntu
http://askubuntu.com/questions/157942/how-can-i-open-a-file-in-my-terminal-like-nautilus-does-it

xdg-open — opens a file or URL in the user's preferred application

Switch default application
$ xdg-mime query default application/pdf
AdobeReader.desktop
$ xdg-mime default evince.desktop application/pdf
$ xdg-mime query default application/pdf
evince.desktop

[SOLVED] How to open files from terminal
http://ubuntuforums.org/showthread.php?t=823620
gnome-open mypicture.jpg




rpm2cpio

rpm2cpio <file> | cpio -di

rpm2cpio & cpio -- 如何將.rpm裡的檔案抽取出來 @ 小雞的故事 :: 痞客邦 PIXNET ::
http://chiakie.pixnet.net/blog/post/4934812-rpm2cpio-%26-cpio----%E5%A6%82%E4%BD%95%E5%B0%87.rpm%E8%A3%A1%E7%9A%84%E6%AA%94%E6%A1%88%E6%8A%BD%E5%8F%96%E5%87%BA%E4%BE%86

Using rpm2cpio
http://www.rpm.org/max-rpm/s1-rpm-miscellania-rpm2cpio.html

结合rpm,rpm2cpio,cpio提取rpm包的特定文件 - 小蜗牛技术之家 - 51CTO技术博客
http://snailwarrior.blog.51cto.com/680306/145588

2013年9月15日 星期日

Ubuntu 12.04

apt-get install

vim htop tree rpm2cpio meld

minicom tftp-hpa tftpd-hpa openssh-server samba

git-core git-svn git-cvs git-email tig subversion cvs ctags 

bison cpp flex g++ gcc gettext texinfo patch patchutils libncurses5-dev uboot-mkimage python-xcbgen automake texlive libtool build-essential libncurses5-dev zlib1g-dev gawk ccache gettext libssl-dev xsltproc g++ zlib1g-dev gawk libncurses5-dev

virtualbox

firefox addon
xmark

Webex
mkl Note: Download and Install Java on Ubuntu 12.04
http://mkl-note.blogspot.tw/2013/09/download-and-install-java-for-linux.html

中文
mkl Note: Ubuntu 12.04中文輸入法的安裝
http://mkl-note.blogspot.tw/2013/08/ubuntu-1204.html

2013年9月12日 星期四

No entry for terminal type "vt100"

No entry for terminal type "vt100"
using dumb terminal settings.

SETTING TERMINAL TYPE
http://www.rahul.net/howto/termcap.html

Terminal codes (ANSI/VT100) introduction [Bash Hackers Wiki]
http://wiki.bash-hackers.org/scripting/terminalcodes

[Chapter 5] 5.3 Setting the Terminal Type When You Log In
http://docstore.mik.ua/orelly/unix/upt/ch05_03.htm

No entry for terminal type "vt100" ?? - The macosxhints Forums
http://hintsforums.macworld.com/showthread.php?t=16178


sshfs

  1. Install
    apt-get install sshfs
  2. Add user xyz permission to use fuse
    usermod -a -G fuse xyz
  3. Mount
    sshfs abc@aaa.bbb.com:/bla/bla/bla mountpoint
  4. Unmount
    fusermount -u mountpoin

Mount remote file system by ssh(sftp) - sshfs @ 複雜的人生,複雜的自己。 :: 痞客邦 PIXNET ::
http://lagunawang.pixnet.net/blog/post/26042587-mount-remote-file-system-by-ssh%28sftp%29---sshfs

Ubuntu 安裝 SSHFS
http://www.arthurtoday.com/2009/11/sshfs-for-linux.html

使用 SSHFS 連線遠端檔案系統
http://www.arthurtoday.com/2010/06/sshfs.html#.UjHVJ7xuGBs

2013年9月10日 星期二

How to change/disable password complexity test when changing password?

11.10 - How to change/disable password complexity test when changing password? - Ask Ubuntu
http://askubuntu.com/questions/113682/how-to-change-disable-password-complexity-test-when-changing-password

Change the following line in /etc/pam.d/passwd
password    [success=1 default=ignore]  pam_unix.so obscureminlen=1 sha512

2013年9月3日 星期二

Download and Install Java on Ubuntu 12.04, 15.10

Download Java software for Linux
https://www.java.com/en/download/linux_manual.jsp

Install - Java for Linux Platforms
https://www.java.com/en/download/help/linux_install.xml#Java%20for%20Linux%20Platforms

sudo mkdir -p /usr/java
sudo tar xf ~/Downloads/jre-XXXXX-linux-i586.tar.gz  -C /usr/java/

Enable and Configure
https://www.java.com/en/download/help/linux_install.xml#enable
killall firefox-bin firefox
sudo mkdir -p /usr/lib/firefox-addons/plugins/
sudo ln -s /usr/java/jreX.Y.Z.AAA/lib/i386/libnpjp2.so /usr/lib/firefox-addons/plugins/
Or, for 64-bit:
sudo ln -s /usr/java/jreX.Y.Z.AAA/lib/amd64/libnpjp2.so /usr/lib/firefox-addons/plugins/
Or, to find it by script:
find /usr/java -name "libnpjp*"
sudo ln -sv $(find /usr/java -name "libnpjp*" | tail -n 1) /usr/lib/firefox-addons/plugins/
Test: How do I test whether Java is working on my computer?
https://www.java.com/en/download/testjava.jsp

Or,
In Firefox, type about:plugins in the Location bar to confirm that the Java Plugin is loaded. 

How do I download and install 32-bit Java for Linux?
https://www.java.com/en/download/help/linux_install.xml#download

在 Ubuntu Linux 中啟用瀏覽器
http://www.java.com/zh_TW/download/help/enable_browser_ubuntu.xml

How to add java plugin for Firefox on Linux? - Stack Overflow
http://stackoverflow.com/questions/14491322/how-to-add-java-plugin-for-firefox-on-linux

Google Form

設計問卷調查快速免費,新版線上 Google form 表單教學 -電腦玩物
http://www.playpcesor.com/2013/01/google-form.html

Google Form進階應用
http://www.cc.ntu.edu.tw/chinese/epaper/0021/20120620_2108.html

2013年8月28日 星期三

Ubuntu 12.04中文輸入法的安裝

Ubuntu 12.04中文輸入法的安裝_IT客
http://tc.itkee.com/os/detail-23a4.html

  1. Install Language support
    [System Settings] -> [Language Support] -> [Install/Remove Language]
  2. sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4
  3. im-switch -s ibus
  4. sudo apt-get install ibus-chewing
    Or more: ibus-pinyin ibus-googlepinyin ibus-sunpinyin
  5. ibus-setup
    [General] -> [Next input method]] -> change to control-shift
    [Input Method] -> enable [Customize active input methods]
    Then, select the input methods that you wants to active.
找回消失的IBus圖標: ibus-daemon -drx

2013年8月24日 星期六

Merging branch in git-svn

Is git-svn dcommit after merging in git dangerous? - Stack Overflow
http://stackoverflow.com/questions/190431/is-git-svn-dcommit-after-merging-in-git-dangerous

When git merge branch by Fast-Forward, no commit is generated. This might lead git-svn commit to the wrong branch.

Says, I have branch "trunk" and "work", and I merge "work" in "trunk" with fast-forward. Later, when I dcommit the changes of "trunk" to SVN, git-svn commit to "work" instead of "trunk".

Use "git svn dcommit -n" to verify whether the destination branch is correct or not.

Use "git merge --no-ff <branch>" to merge branches when using git-svn.

"git merge --squash <branch>" would also work with git-svn, but it doesn't has the merge information left.

2013年8月22日 星期四

20130815-17同禮部落手作步道工作假期

花蓮秀林鄉同禮部落自然生態自治協進會
https://sites.google.com/site/tarokoecotour/home
活動相片 - 花蓮秀林鄉同禮部落自然生態自治協進會
https://sites.google.com/site/tarokoecotour/links/huo-dong-xiang-pian


春文的相簿
https://plus.google.com/116244243791925495773/photos
20130815手作步道在同禮第一日出發 
https://plus.google.com/photos/116244243791925495773/albums/5913645737089230417
20130816手作步道在同禮第二日-1https://plus.google.com/photos/116244243791925495773/albums/5913657175785391329
20130816手作步道在同禮第二日-2
https://plus.google.com/photos/116244243791925495773/albums/5913671120390954961
20130816手作步道在同禮第二日晚間 
https://plus.google.com/photos/116244243791925495773/albums/5913690676053233937
20130817手作步道在同禮第三日  
https://plus.google.com/photos/116244243791925495773/albums/5913728167361236401


芸姿: 20130815-17同禮部落手作步道工作假期
https://plus.google.com/photos/107973375310153064236/albums/5914499332549929281

麗雲: 1020814-17 同禮手作步道
https://www.facebook.com/liyun0701/media_set?set=a.659600220719143.1073741840.100000075135720&type=1


Iting Chiang: 201308同禮部落步道工作假期
https://www.facebook.com/iting.chiang.37/media_set?set=a.10201199082635799.1073741831.1132708002&type=1

"神祕谷之聲"合唱
https://www.facebook.com/photo.php?v=406405669465804




芸姿:20130703-06再訪同禮部落
https://plus.google.com/u/0/photos/107973375310153064236/albums/5898230920060489569

lituk simi的相簿
https://plus.google.com/photos/110381575016440656965/albums

2013年8月1日 星期四

Linux Plumbers Conference

Linux Plumbers Conference
http://www.linuxplumbersconf.org/

Linux Plumbers Conference 2013
http://www.linuxplumbersconf.org/2013/

Linux Plumbers Conference 2012
http://www.linuxplumbersconf.org/2012/

Plug: the brain of your devices

Plug: the brain of your devices by The CGC team — Kickstarter
http://www.kickstarter.com/projects/cloud-guys/plug-the-brain-of-your-devices

喲哪桑 Speaking 之專案工作日誌: 看來,我還算不上是一個好的產品經理呢!
http://jonathanspeaking.blogspot.tw/2013/07/blog-post_14.html

distributed, dropbox-like one big space, sync automatically.
uPnP or DLNA,
decentralized P2P VPN
version control
backup
compatible with backup services such as BackBlaze or CrashPlan
replace all memory, instead a folder only (?)
SDK


allow others access specific files/directly by a link temporarily or permanently.send a file/directly to a Plug in another group

Access files on web site

Plug app supported on Apple products (iPod, iPad, iPhone), Windows, Linux,  Android
streamed from Internet if the file doesn't fit in the device
select files to view offline


Maybe I would buy it. But it doesn't really fit my need. To me, the most important feature is the concept  "dropbox-like one big space".

The device really make me think about what is missing with current RAID+NAS products.

  1. size is not scalable
  2. buying one more device means one more location, or dropping the old one to garbage...
  3. home-use level product doesn't really protect data, but make it more difficult to get data back when something happen...


I need a device that could help me build a "private dropbox", which has:
  1. (distributed, P2P) multiple device, each has multiple harddisk
  2. dropbox-like one big space, one see all the file even if the file doesn't exist on nearest device.
  3. RAID-like data protection/backup, remote backup
  4. automatically sync each other
  5. file version control
(other feature could be added, but not really important)


BitTorrent Labs
http://labs.bittorrent.com/

BitTorrent Sync
http://labs.bittorrent.com/experiments/sync/mobile.html

BitTorrent Sync FAQ - BitTorrent Sync - BitTorrent Forums
http://forum.bittorrent.com/topic/16410-bittorrent-sync-faq/

2013年7月24日 星期三

Connect to a Windows VPN

Kubuntu 12.04
[Add] -> [PPTP]

Fill Gateway, Login, and Password
Goto [Advance]


Remember to enable [Use MPPE Encryption] and [Use stateful encryption] for Windows VPN.


2013年7月8日 星期一

肉桂


肉桂類天然香料的成分與應用
http://www.tfri.gov.tw/main/download.aspx?dlfn=%E5%B0%88%E9%A1%8C4-836048583.pdf

肉桂
http://el.mdu.edu.tw/datacos//09622712039A/96%E8%82%89%E6%A1%82.pps

100年12月03日中天『今日台灣』專訪中寮鄉肉桂節
http://www.youtube.com/watch?v=nb5nYjJ2eIg

秋天 雨水 後一個月採收

土肉桂煉精油 校樹成搖錢樹-民視新聞
http://www.youtube.com/watch?v=U_JWEt80s1g

考慮做各副業?賣新鮮肉桂葉 @ show :: 隨意窩 Xuite日誌
http://blog.xuite.net/ta510366/myblog/14289531-%E8%80%83%E6%85%AE%E5%81%9A%E5%90%84%E5%89%AF%E6%A5%AD%EF%BC%9F%E8%B3%A3%E6%96%B0%E9%AE%AE%E8%82%89%E6%A1%82%E8%91%89


肉桂葉能幫助血液循環帶給肌膚光澤 CINNAMON Leaf 效:是一強勁抗菌劑,幫助呼吸道減輕感冒症狀,減輕消化不良症狀、肌肉酸痛、對筋疲力竭和虛弱、沮喪的安撫功效絕佳。 
將肉桂葉放入蒸好的飯中,再放回電鍋蒸一下,可增添米飯的風味;同時肉桂葉也具有去腥的作用。 可以襯托出其他辛香料的最佳配角,不搶味的特性以及珍貴成分,可緩和流行性感冒、舒緩消化道的反胃等不適現象。 肉桂的外形有粉狀、片狀二種,廣泛的使用在藥用與中西餐點上。
製作肉桂粉
你將肉桂葉放入可微波的容器中 不需要封上保鮮膜 看你葉子的量 調整微波的時間 葉子完全乾燥後 很輕易的就能變成你要的粉嘍!
可把葉子拿來泡茶有飲用可治療胃痛、腹瀉、頭痛、發燒、感冒在抗寒及克服憂鬱有極佳的效果。 也可以用來烹調肉類、魯肉、燉排骨、爌肉、滷味、香腸、蛋糕、餅乾等,可加入土肉桂葉調味,風味絕佳!
台灣土肉桂葉含量成份分析整理 - 陳耀南的數位歷程檔
http://lms.ctl.cyut.edu.tw/2009032/doc/57210

花蓮鳳林臺灣土肉桂
http://subtpg.tpg.gov.tw/web-life/taiwan/9704/9704-05.htm

台灣森林特產物—土肉桂
http://ejournal.stpi.narl.org.tw/NSC_INDEX/Journal/EJ0001/9902/9902-05.pdf

栽培地區及生長季節對土肉桂葉精油含量成分之影響 - 林業試驗所台灣林業科學 - 行政院農業委員會林業試驗所
http://www.tfri.gov.tw/main/science_in.aspx?mnuid=5111&modid=1&cid=129&cid2=769&nid=2309
一年中,精油收率最高之時期為7 月至9月。主成分桂皮醛之平均百分比達70%以上,但是,不同營養系及不同栽植地樣品中桂皮醛含量時序變化則並不十分一致。
萃取時間及次數對土肉桂葉子精油成分及其抗腐朽活性的影響 
http://ntur.lib.ntu.edu.tw/bitstream/246246/143652/1/84.pdf

植物精油萃取技術及其改良
http://www.tfri.gov.tw/main/download.aspx?dlfn=%E6%A4%8D%E7%89%A9%E7%B2%BE%E6%B2%B9%E8%90%83%E5%8F%96%E6%8A%80%E8%A1%93%E5%8F%8A%E5%85%B6%E6%94%B9%E8%89%AF+%E6%9E%97%E6%A5%AD%E5%8F%A2%E5%88%8A232%E8%99%9F.pdf

台灣土肉桂精油萃取大公開 - 279順福天然農場 - Yahoo!奇摩部落格
http://tw.myblog.yahoo.com/jw!o8uD7FGTERbKvGj4VSbESEQ-/article?mid=7064

農作物儲存新方法 煉精油製成商品 - 新唐人亞太電視台
http://ap.ntdtv.com/b5/20110922/video/74947.html

簡易粹取肉桂精油 - 如虹有機生態農場 - Yahoo!奇摩部落格
http://tw.myblog.yahoo.com/ruhon-farm/article?mid=3850&sc=1


2013年7月3日 星期三

工作假期可以做什麼? 造窯、做步道、蓋涼亭,甚至房子


11/19-21趁著秋涼,到阿朗壹來做步道!工作假期志工召募中! « 台灣步道志工網 - 用手作步道愛護環境!
http://www.tmitrail.org.tw/trails-volunteer/?p=711

【已結束】福安木造涼亭與黏土PIZZA窯工作假期 - 阿不的心靈花園 - PChome 個人新聞台
http://mypaper.pchome.com.tw/zero/post/1324049431

【土窯工作假期】102.6.1-2、8-9苗栗太陽氣動靜心樂活村披薩窯 - 協力築夢
https://sites.google.com/site/xielizhumeng/tu-yao-huo-dong-xun-xi/-tu-yao-gong-zuo-jia-qi-102-6-1-2-8-9miao-li-tai-yang-qi-dong-jing-xin-le-huo-cun-pi-sa-yao

【柴燒土窯工作假期】6/1-2、8-9苗栗太陽氣動淨心樂活村披薩窯 | 台灣環境資訊協會-環境資訊中心
http://e-info.org.tw/node/85021

【活動】「田間書屋」之協力造屋工作假期 - 遇見台灣百合 - Yahoo!奇摩部落格
http://tw.myblog.yahoo.com/lilium-formosanum/article?mid=727&next=721&l=f&fid=9

FAITH HOPE CHARITY ‧ 部落: 後壁協力造屋工作假期
http://bestemma-liao.blogspot.tw/2011/12/blog-post_20.html

阿不帶領: 2011 田間書屋之「創意造屋工作假期」 (代轉) - 香巷綠園 - PChome 個人新聞台
http://mypaper.pchome.com.tw/scentiye1/post/1322266225

陰香 vs 土肉桂


陰香  一個美麗的錯誤?
http://mail.tmue.edu.tw/~fireant/epaper10008/brochure_Cinnamomum.pdf

因土肉桂葉片大小、形狀變異相當大,幾乎涵蓋了陰香的變異範圍,故無法用為比較依據。但是,土肉桂的小枝淡綠色,葉片為亞革質,葉表面淡綠色,葉背面灰綠色;而陰香小枝紅色,葉片為紙質,葉表面深綠色,葉背面淡綠色,故可據以區別,尤其是在小苗時期,可供
鑑定依據。

正視陰香對土肉桂的衝擊
http://www.forest.gov.tw/public/Attachment/912210572371.pdf

樟科-土肉桂與陰香 - 水晶蘭的種子花草格 - Yahoo!奇摩部落格
http://tw.myblog.yahoo.com/fannie-blog/article?mid=18117

陰香
http://www.sles.ntpc.edu.tw/mediafile/584/news/414/2013-3/2013-3-25-8-57-30-nf1.pdf


「陰香」假冒土肉桂 台林試所研發辨別方式
http://www.epochtimes.com/b5/7/6/24/n1753367.htm

土肉桂與陰香如何區分
http://www.wetland.org.tw/trip/class/plant/plant_3/net/cm.html

誰來教我分辨土肉桂與陰香-看到以前討論過的文章了 - 植物種植的技術及介紹討論 - 2home 打造桃花源 - Powered by Discuz!
http://www.2home.com.tw/bbs/viewthread.php?tid=23553

(也有人說紅枝不能做分辨土肉桂和陰香的代表,可是我猜他是肉桂醛型陰香)

是土肉桂還是陰香(上)
http://clpsenviroment.files.wordpress.com/2012/10/e698afe59c9fe88289e6a182e98284e698afe999b0e9a699.doc



陰香與土肉桂的分辨 @ 喬薇的開心樂園 :: 痞客邦 PIXNET ::

http://kissmm29.pixnet.net/blog/post/49237482-%E9%99%B0%E9%A6%99%E8%88%87%E5%9C%9F%E8%82%89%E6%A1%82%E7%9A%84%E5%88%86%E8%BE%A8
陰香吃了會引起腎臟病變.....

林務局造林 種印尼肉桂危生態
http://web.pts.org.tw/php/news/pts_news/detail.php?NEENO=225593
==花蓮肉桂農 溫仁財===
那吃了會死喔
它最主要的東西像是樟腦油一樣
早期人自殘沒用農藥
就用這個 吃了會死
根據林試所的說法,陰香有7種化學品系。跟樟腦油的成分比對起來的確有些成分相同,但個別毒性則不清楚

個人沒根據且不負責任的猜測:肉桂醛型陰香可當作土肉桂來用,但是其他某些型則不行,可能對身體有害。


對樟腦油了解知多少? - ㄚ發果園 - Yahoo!奇摩部落格
http://tw.myblog.yahoo.com/jw!PZlPIQ6eRkBL_EpVDa9t/article?mid=21657
樟腦油的危險性:

1.是那種毒性成份?(中毒作用機轉)

樟腦油為氫芳香環松烯(hydroaromatic terpene)族的環狀酮體。松烯(terpene)為趨酯性,具有快速的神經毒性,其毒性包括興奮及抑制作用。在體內,樟腦油被代謝成camphorol,並被帶至肝臟去毒性。去毒性的作用藉由羥基化(hydroxylation),然後和葡萄糖醛酸(glucuronic acid)結合而產生。最後此不活化物被帶至腎臟而排出體外。

所以造成中毒的成分,它會影響你的中樞神經,還有刺激胃腸粘膜,長期暴露可能喪失嗅覺敏感性、傷害腎臟、肝臟、生殖系統等。
作物蟲害之非農藥防治資材 二、精油類
http://ir.tari.gov.tw:8080/ir/bitstream/345210000/3291/2/publication_no...
樟腦油(camphoroil)提煉自樟樹,粗製樟腦原料是將樹幹切成木片,以水蒸氣蒸餾生產樟腦及樟腦油。樟腦油成分包括:d-樟腦(d-camphor,C10H16O)、桉油精(cineole)、黃樟油醚(safrole),尚含僮腦醇(campherenol)、樟腦酮(campherenone)及d-蒎烯、莰烯、水芹烯(phellandrene)、α-檸檬烯(α-limonene)、杜松烯(cadinene)、龍腦奧等。樟腦油可用以製香皂、香料、化妝品等,是傳統中藥材,據說用以按摩身體具有去風濕,通經絡之效。





2013年6月22日 星期六

2013年6月16日 星期日

馬拉松訓練計畫


馬拉松賽前 應不應該先練習42K?
http://www.sportsnote.com.tw/RUNNING/view_article.aspx?id=aa92290f-ad9e-4f98-9a7e-7e67b5d992e1

打造自己的三階段訓練計畫
http://www.sportsnote.com.tw/RUNNING/view_article.aspx?id=a0a7e225-1173-4c83-beeb-1078db769251

我的2011年太魯閣馬拉松計畫--2011.4.30 @ 獵豹的瑣事 :: 痞客邦 PIXNET ::
http://jack197247.pixnet.net/blog/post/30510108

2011年太魯閣馬拉松訓練記錄 @ 獵豹的瑣事 :: 痞客邦 PIXNET ::
http://jack197247.pixnet.net/blog/category/935248

挑戰太魯閣 180天日記 (上)
http://www.sportsnote.com.tw/RUNNING/view_article.aspx?id=a5d9db3a-8e91-4e45-b816-58398022df40

挑戰太魯閣 180天日記 (中)
http://www.sportsnote.com.tw/RUNNING/view_article.aspx?id=55c20de6-b22a-41f3-9183-46658c60c26e

挑戰太魯閣 180天日記 (下)
http://www.sportsnote.com.tw/RUNNING/view_article.aspx?id=193f1f05-4b87-40a0-a8b3-1c7d711c2705

2011太魯閣峽谷馬拉松--辛苦的雪恥成功啦 @ 獵豹的瑣事 :: 痞客邦 PIXNET ::
http://jack197247.pixnet.net/blog/post/38774128

2013年5月23日 星期四

2013年5月9日 星期四

ACPI

What is Linux: Linux下的Hibernate(Suspend to Disk) – ACPI定義的睡眠模式之一
http://juergenchiu.blogspot.tw/2008/09/linuxhibernatesuspend-to-disk-acpi.html

2013年4月14日 星期日

Google Map API Key

Sign Up for the Google Maps API - Google Maps API — Google Developers
https://developers.google.com/maps/signup
申請 Google Maps API - Google Maps API — Google Developers
https://developers.google.com/maps/signup?hl=zh-tw

Google Maps JavaScript API V2 Basics - Google Maps JavaScript API 第 2 版 (已不適用) — Google Developers
https://developers.google.com/maps/documentation/javascript/v2/introduction?hl=zh-TW#Obtaining_Key

Google APIs Console
https://code.google.com/apis/console/

2013年4月11日 星期四

Linux 燒錄光碟

cdrecord -scanbus
cdrecord -v -eject  dev=0,1,0 test.iso 

linux burn cd
http://csc.ocean-pioneer.com/docum/linux_burn.html

3. 燒錄光碟
http://www.linux.org.tw/CLDP/HOWTO/hardware/CD-Writing-HOWTO/CD-Writing-HOWTO-3.html


鳥哥的 Linux 私房菜 -- Linux 的檔案壓縮與打包 - cdrecord
http://linux.vbird.org/linux_basic/0240tarcompress.php#cdrecord

Linux 燒錄光碟(CD/DVD/DVD-RW)
http://www.php5.idv.tw/html.php?mod=article&do=show&shid=26

2013年3月28日 星期四

CNS3420VB cannot boot with Linux versions 3.3 and after (to v3.9-rc1)

The build procedure is as following:

make ARCH=arm cns3420vb_defconfig
make ARCH=arm zImage

The upstream Linux doesn't boot with version 3.3 and after with following message:
## Starting application at 0x04000000 ...
Uncompressing Li done, booting t

The suspect is located after git bisect:
commit 0536bdf33faff4d940ac094c77998cfac368cfff
Author: Nicolas Pitre <nicolas.pitre@linaro.org>
Date:   Thu Aug 25 00:35:59 2011 -0400

    ARM: move iotable mappings within the vmalloc region
  
    In order to remove the build time variation between different SOCs with
    regards to VMALLOC_END, the iotable mappings are now allocated inside
    the vmalloc region.  This allows for VMALLOC_END to be identical across
    all machines.
  
    The value for VMALLOC_END is now set to 0xff000000 which is right where
    the consistent DMA area starts.
  
    To accommodate all static mappings on machines with possible highmem usage,
    the default vmalloc area size is changed to 240 MB so that VMALLOC_START
    is no higher than 0xf0000000 by default.
  
    Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
    Tested-by: Stephen Warren <swarren@nvidia.com>
    Tested-by: Kevin Hilman <khilman@ti.com>
    Tested-by: Jamie Iles <jamie@jamieiles.com>

Commit 34ae6c96a6a7db4ed8ec0524bf7fa1086b9ab2ba has similar issue.

issue 1: if two iotable mappings overlapped, Linux boot failed with "Uncompressing Li done, booting t"

issue2: if mapping is good, but somehow GIC is not configured, Linux boot failed with "Calibrating delay loop...", for GIC is not set up properly.


FIX1: github mkl0301/linux branch cns3420vb-fix-3.2-not-boot


However even with the patch on v3.9-rc1 still doesn't boot, with the same message. While bisect-ing (with the patch, of course), it is found that sometimes it "half works", which likes scu/gic not set causes jiffies not updated, stuck at "Calibrating delay loop...".


The first commit that has this issue:
commit 384a290283fde63ba8dc671fca5420111cdac19a
Author: Nicolas Pitre
Date:   Wed Apr 11 18:55:48 2012 -0400

    ARM: gic: use a private mapping for CPU target interfaces
   
    The GIC interface numbering does not necessarily follow the logical
    CPU numbering, especially for complex topologies such as multi-cluster
    systems.
   
    Fortunately we can easily probe the GIC to create a mapping as the
    Interrupt Processor Targets Registers for the first 32 interrupts are
    read-only, and each field returns a value that always corresponds to
    the processor reading the register.
   
    Initially all mappings target all CPUs in case an IPI is required to
    boot secondary CPUs.  It is refined as those CPUs discover what their
    actual mapping is.
   
    Signed-off-by: Nicolas Pitre
    Acked-by: Will Deacon
ARM® Generic Interrupt Controller Architecture Specificationhttp://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ihi0048a/index.html

It seems that in function gic_dist_init(), the cpumask read from register GIC_DIST_TARGET is 0x0, which cause this issue.

It seems the arch/arm/common/gic.c has been modified many times, for the issue doesn't occur every time while bisecting. So this is only a temporary fix.

FIX2: github mkl0301/linux branch cns3420vb-fix-3.8-not-boot

Now we finally reach to the original issue
## Starting application at 0x04000000 ...
Uncompressing Li done, booting t

bisecting v3.9-rc1 and commit 384a2902. The first commit that doesn't boot is:

commit b8b499c86be58cb309964fcab5b62ac4a240a878
Author: Alexander Shiyan
Date:   Wed Dec 12 08:32:11 2012 +0100

    ARM: 7602/1: Pass real "__machine_arch_type" variable to setup_machine_tags() procedure
   
    This modification is needed to proper boot the custom machines with
    the IDs that are not described in the mach-types.h table.
   
    Signed-off-by: Alexander Shiyan
    Signed-off-by: Russell King
According to Documentation/arm/Booting, "5. Calling the kernel image", r1 should store the machine type number. This machine type number will be stored to variable __machine_arch_type before calling start_kernel() in arch/arm/kernel/head-common.S.

The variable __machine_arch_type is supposed to be used by setup_arch() to determine the machine type. But before commit  b8b499c8, it is machine_arch_type, which is a predefined machine number, instead of the __machine_arch_type, determines the machine type.

So there was no issues using u-boot command "go", which doesn't put machine type to r1 until commit  b8b499c8. But after commit  b8b499c8, Linux use the machine number given by the bootloader to determine the machine type. u-boot command "go" doesn't fulfil the requirement any more.

FIX3: The proper fix of this will be: using uImage+u-boot command "bootm".
(But I just hack the u-boot and have the command "go" store machine number in r1 with zImage....)

Finally, I could boot v3.9-rc1 with FIX1+FIX3.