Oct 30, 2008

USB vendor id and device id

可以從 /var/lib/usbutils/usb.ids 得知,vendor id & device id

Oct 29, 2008

strace

  1. strace - A very powerful troubleshooting tool for all Linux users
  2. Fun with strace and the GDB Debugger
  3. 5 simple ways to troubleshoot using Strace
  4. reducing Requests-Setup-Costs
  5. strace 命令用法

rtorrent.rc 備份

# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.

# Maximum and minimum number of peers to connect to per torrent.
min_peers = 40
max_peers = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 10
max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
max_uploads = 3

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 0
upload_rate = 10

encoding_list = UTF-8

# Default directory to save the downloaded torrents.
directory = ./

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = ./session

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=./watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.
#schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no

# Port range to use for listening.
port_range = 6890-6999

# Start opening ports at a random position within the port range.
port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no

# Set whetever the client should try to connect to UDP trackers.
#use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
# encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10

screenrc 備份

caption always "%{= wk} %{= KY} [%n]%t @ %H %{-} %= %{= KR} %l %{-} | %{= KG} %Y-%m-%d %{-} "
hardstatus alwayslastline " %-Lw%{= Bw}%n%f %t%{-}%+Lw %=| %0c:%s "

# some environment setting
vbell off
autodetach on
startup_message off
shell -$SHELL
dfscrollback 5000
defencoding utf8
#
# # buttom status bar
#caption always “%{=u .G} %-w%<%{=ub .y}%n %t%{=u .G}%+w ”
#hardstatus alwaysignore
#hardstatus alwayslastline “%{= .K} [%l]%<%=%{= .W}@%H %=%{= .y} %Y/%m/%d%{= .m} %C %A”
#
# # C + left : prev
# # C + right : next
bindkey “^[[1;5C” next
bindkey “^[O5C” next
bindkey “^[[C” next
bindkey “^[[1;5D” prev
bindkey “^[O5D” prev
bindkey “^[[D” prev
#
# # C-a b : encoding big5
# # C-a u : encoding utf8
bind b encoding big5 utf8
bind u encoding utf8 utf8
bind j encoding eucjp utf8
#
# # C-b $num : move current window to number $num
bind -c move 0 number 0
bind -c move 1 number 1
bind -c move 2 number 2
bind -c move 3 number 3
bind -c move 4 number 4
bind -c move 5 number 5
bind -c move 6 number 6
bind -c move 7 number 7
bind -c move 8 number 8
bind -c move 9 number 9
bindkey “^b” command -c move
#
# # F12 : fast kill
bindkey “^[[24~” kill

Oct 27, 2008

Linux MTD Driver Reference

引用至 lazyf's den

MTD NAND Driver Programming Interface

Thomas Gleixner
http://www.linux-mtd.infradead.org/tech/mtdnand/book1.html

HOW TO USE MTD/JFFS2 UNDER µClinux
Patrice KADIONIK, Professor Assistant at the ENSEIRB School of Electrical Engineering, Telecommunication, and Computer Science
http://uuu.enseirb.fr/~kadionik/embedded/uclinux/mtd/howto_mtd.html

Find your Root File System with MTD
http://www.ucdot.org/article.pl?sid=03/01/11/1049210&mode=thread

JFFS2 筆記

JFFS2的特性
  • 其斷電可靠度
  • 在MTD裝置上實做耗損平衡(wear leveling). 可以確保flash 上所有的區塊具有一致的使用率, 因此可以平衡每個區塊的損耗程度
  • 在MTD裝置上實做資料壓縮(data compression). 除了節省空間外, 在使用資料前先將它解壓到RAM上.不過, jffs2不能使用XIP(就地執行eXecute In Place)
  • 有實做垃圾收集(garbage collection). 它可以確保你的應用程式不會成長到到埴滿整個檔案系統.也就是寫入前會先檢查檔案系統的可用空間

Create jffs2 root file system
1. mkfs.jffs2 -d ./rootfs -o rootfs.bin -e 0x40000 --pad=0x02000000
2. file rootfs.bin
rootfs.bin: Linux jffs2 filesystem data little endian


Mount JFFS2 by MTD
1. modprobe jffs2
2. modprobe mtdblock
3. modprobe mtdram
4. dd if=rootfs.bin of=/dev/mtdblock0
5. mkdir /mnt/flash
6. mount -t jffs2 /dev/mtdblock0 /mnt/flash

Save as .....
1. dd if=/dev/mtdblock0 of=./your-modified-fs-image.bin