星期二, 10月 27, 2009

Linux 看 PPS 電影

使用 totem-pps 在 Ubuntu 下完美地观看 PPS 电影
安裝 totem-pps、Greasemonkey、

其它
  • PPS Linux PC版本 (PPS mplayer)
  • https://launchpad.net/~ubuntukylin-members/+archive/ubuntukylin/+build/5794566 (for 14.04 trusty,試用結果無法播放)

星期二, 10月 20, 2009

讀:ubifs support was added in Astfin 2.1

原文:ubifs support was added in Astfin 2.1

較普遍採用,基於 raw flash[註] 的檔案系統有幾年前的 JFFS2YAFFS2,以及較新的 LogFSUBIFS

JFFS2YAFFS2 有 partition scalability 的問題,時間、RAM consumption、及 CPU usage 跟 partition 大小成正比,當 partition 大於 100 MiB 時效能就不太好了。

LogFS 直接對 MTD 操作,且打算取代 jffs2,對 partition scalability 較好,也加了其它特點,但似乎仍在開發中。

UBIFS 擁有上述檔案系統的所有 features,包括壓縮,較好的 partition scalability 等。UBIFS 額外支援 write-back caching。

UBIFS 需要另一個 UBI (Unsorted Block Images) 層,做 ubifs logical blocks 跟 flash chip erase blocks 的對應。

註:基於 raw flash 是指處理器直接使用 flash 晶片。另外一類是 managed flash,是透過管理晶片使用 flash,這些包括 USB flash、SD/MMC card、SSD 等,跟硬碟一樣是 block 裝置,並不適用這些檔案系統。

raw flash 有兩種,NOR flash 容量較小,是 error-free,仍有 wear-leveling
NAND flash 容量大,但需要處理壞 block

參考:http://wiki.openwrt.org/doc/techref/flash.layout

星期三, 10月 07, 2009

git: use Subvision repositary

使用 git svn ... 指令使用 subversion repository。

安裝 git-svn
sudo apt-get install git-svn

使用 Subversion 作為遠端檔案庫

git svn clone --std-layout --prefix=svn/ https://my.server/myproject/trunk myproject
vi some/files
git commit -a -m 'some files modified'
git svn rebase
git svn dcommit
git svn clone 參數:
  • --std-layout:subversion 檔案庫使用標準 trunk, branches, tags 目錄,這些都會當作分支 checkout
  • --prefix=svn/:未加時,上述遠端分支的 refs 是 refs/remotes/分支,建立同樣名稱的 local 分支,其 refs 是 refs/heads/分支。分支切換時,由於遠端跟 local 分支的層級相同,會出現「warning: refname 分支 is ambiguous.」的警告。加 --prefix 後,遠端分支 refs 會多一層 svn/ 變成 refs/remotes/svn/分支,分支切換時才不會有曖昧的情形。
It's generally best to keep your history as linear as possible by rebasing your work and avoiding doing things like simultaneously interacting with a Git remote repository. Don't rewrite your history and try to push again.

在 git 無法做的動作
  • 無法移除 branch
  • 無法移除 property,例如 svn:externals

加進一個 svn repositary

在 .git/conf 加
[svn-remote "svn"]
    url = http://the.svn.repo/project
    fetch = trunk:refs/remotes/svn/trunk
    branches = branches/*:refs/remotes/svn/*
    tags = tags/*:refs/remotes/svn/tags/*
其中 url 指定 svn repositary 位置,fetch 設定的名稱 -- trunk,可自取

參考

  1. Git - SVN Crash Course (git 跟 svn 指令比較)
  2. http://progit.org/book/ch8-1.html

git 入門

安裝
sudo apt-get install git-core

設定個人資訊
git config --global user.name "MyName"
git config --global user.email "MyEmail@some.where"
git config --global core.pager "less -+FRSX -FRX" # git grep 自動換行
git config --global core.editor vi
git config --global color.ui true # 此項應可取代下面所有 color 設定
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.grep auto
或直接編輯 ~/.gitconfig
[user]
name = MyName
email = MyEmail@some.where
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
rb = svn rebase
ci = commit -a
co = checkout

查看
git config -l

建立 repositary
mkdir test
vi test.txt
git init
git add test.txt
git commit -m 'test'

git ssh

  • 認証問題。舊版 rsa key 在 ubuntu 22.04 無法使用,需要 ssh-keygen -t ed25519 產生新 key,將 id_ed25519.pub 放到 git server。
  • locale 問題:可以關掉 SendEnv,包括 /etc/ssh/ssh_config。

參考

  1. Git 原始碼管理
  2. Git 客製化 - Git 配置
  3. Git 首頁
  4. git subvision 
    • git add -p
    • git commit --amend # 修改說明
    • git reset  HEAD^ #重新送交
    • git reset --hard #清除修改