Thursday, December 25, 2008

Naming and Version Number of Debian Packages

Debian package naming convention:
  • package name_version number-debian revision_architecture.deb
Version Number:
  • [epoch:]upstream_version[-debian_revision]
For examples:
  • amarok_1.4.10-0ubuntu3_i386.deb
    • 1.4.10: original version number
    • 0ubuntu3: Ubuntu build number
    • i386: architecture
  • libplasma3_4:4.1.85-0ubuntu1~intrepid1~ppa1_i386.deb
    • 4: epoch, usually single unsigned integer. It is intended to be used in case of a change in version numbering scheme, or if a mistake is made.
    • 4.1.85: original version number
    • 0ubuntu1~intrepid1~ppa1: Ubuntu build number
    • i386: architecture
Version Number Comparison:
  • When comparing two version numbers, first the epoch of each are compared, then the upstream_version if epoch is equal, and then debian_revision if upstream_version is also equal. epoch is compared numerically. The upstream_version and debian_revision parts are compared by the package management system using the following algorithm:

    The strings are compared from left to right.

    First the initial part of each string consisting entirely of non-digit characters is determined. These two parts (one of which may be empty) are compared lexically. If a difference is found it is returned. The lexical comparison is a comparison of ASCII values modified so that all the letters sort earlier than all the non-letters and so that a tilde sorts before anything, even the end of a part. For example, the following parts are in sorted order from earliest to latest: ~~, ~~a, ~, the empty part, a.

    Then the initial part of the remainder of each string which consists entirely of digit characters is determined. The numerical values of these two parts are compared, and any difference found is returned as the result of the comparison. For these purposes an empty string (which can only occur at the end of one or both version strings being compared) counts as zero.

    These two steps (comparing and removing initial non-digit strings and initial digit strings) are repeated until a difference is found or both strings are exhausted.

    Note that the purpose of epochs is to allow us to leave behind mistakes in version numbering, and to cope with situations where the version numbering scheme changes. It is not intended to cope with version numbers containing strings of letters which the package management system cannot interpret (such as ALPHA or pre-), or with silly orderings (the author of this manual has heard of a package whose versions went 1.1, 1.2, 1.3, 1, 2.1, 2.2, 2 and so forth).



--

Ref
  1. Package Systems
  2. Debian Policy Manual

Rebuild Ubuntu deb Package

deb packages needed
  • build-essential
  • devscripts: debuild
  • fakeroot
Related apt-get parameters
  • apt-get sourc foo
  • apt-get build-dep foo: download related sources
Process
  1. apt-get source foo
  2. apt-get build-dep foo
  3. cd foo
  4. source editing
  5. debuild -us -uc: -us and -uc are the parameters passed to dpkg-buildpackage
    • -us Do not sign the source package.
    • -uc Do not sign the .changes file.
  6. sudo dpkg -i ../foo.deb

Monday, December 15, 2008

Quadro vs GeForce

Quadro family get the following hardware support which is not appeared among GeForce family and usually appeal to software solutions.
  1. Antialias
  2. OpenGL Per-Fragment Logic Operation
    • Overlay Plane Support
    • Highlighted by the Cursor
  3. Clip Regions
    • Overlapped Windows
  4. Hardware-Accelerated Clip Planes (lesser unnecessary triangles)
  5. Two-Sided Lighting
  6. Overlay Plane Support
  7. Quad-Buffered Stereo
  8. P4 Optimizations (NetBurst)
    • The more frequently the more efficiently
  9. Unified Driver Architecture
  10. Application Support and Optimization

Friday, December 12, 2008

Applying *.diff.gz patch

zcat foo.diff.gz | patch -p1

The argument of patch, "-p1" in this example, depends on where the patch file is and where the target directory is

Monday, December 01, 2008

"Wir Sind Helden - Nur ein Wort" und "楊丞琳 - 太煩惱"

Wir Sind Helden - Nur ein Wort [original version]


Ich sehe, dass du denkst
Ich denke, dass du fühlst
Ich fühle, dass du willst
Aber ich hör dich nicht, ich

Hab mir ein Wörterbuch geliehen
Dir A bis Z ins Ohr geschrien
Ich stapel tausend wirre Worte auf
Die dich am Ärmel ziehen

Und wo du hingehen willst
Ich häng an deinen Beinen
Wenn du schon auf den Mund fallen musst
Warum dann nicht auf meinen

Oh bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein
Bitte bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein
Bitte bitte gib mir nur ein Wort

Es ist verrückt, wie schön du schweigst
Wie du dein hübsches Köpfchen neigst
Und so der ganzen lauten Welt und mir
Die kalte Schulter zeigst

Dein Schweigen ist dein Zelt
Du stellst es mitten in die Welt
Spannst die Schnüre und staunst
Stumm wenn
Nachts ein Mädchen drüber fällt

Zu deinen Füssen red ich mich
Um Kopf und Kragen
Ich will in deine tiefen Wasser
Große Wellen schlagen

Oh bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein
Bitte bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein
Bitte bitte gib mir nur ein Wort

In meinem Blut werfen
Die Endorphine Blasen
Wenn hinter deinen stillen
Hasenaugen die Gedanken rasen

Oh bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein
Bitte bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein Oh
Bitte gib mir nur ein
Bitte bitte gib mir nur ein Wort

楊丞琳 - 太煩惱 [cover version]



一樣的化妝 一樣的頭髮
大家通通太像 多無聊啊

剪雜誌不如自己想 學誰不如自己闖
每個人總會有 一件事 要比別人強

沒有那麼漂亮就更用心化妝
當身材沒有辦法想 努力微笑放光芒

我煩惱 太被動並不好
煩惱 太衝動也不好
煩惱 自信在動搖
煩惱煩惱 鑽進了牛角

我煩惱 太聰明並不好
煩惱 太愚蠢更不好
煩惱 誰都不明瞭
煩惱煩惱 太煩惱的苦惱

別讓昨天變圍牆 要拿今天當翅膀
可以失戀不能失去了 對幸福的渴望

暗戀最好撐把傘 小雨大雪都會下
愛就像高跟鞋 越美的越容易拐一下

難免受傷重要的是不要留下疤
沒有陰影才不害怕
為了夢想 痛著成長

Thursday, November 20, 2008

Concatenate Sequential Pictures into a Montage Thumbnail

Quite useful when you're trying to show some sports motion clips for analyzing.

Tool:
ImageMagick
works both on Linux and Windows

Example:
montage -mode concatenate -tile 4x [input images] [output image]

4 is the number of columns
Arguments of -tile is also possible as being x3 also

Saturday, November 08, 2008

Adept 3.0 Beta4 3rd Party Packages Missing

[Bug 287000] Re: Adept does not list Third Party software
Here is a workaround solution

"sudo update-apt-xapian-index"
After doing that, 3rd Party Packages will show up in Adept fine.

Wednesday, August 20, 2008

private setting backup in Linux

yes | cp -riP /home/leno/.[^.]* /backup/leno/

-R, -r, --recursive
copy directories recursively

-i, --interactive
interactive, prompt before overwrite

-P, --no-dereference
never follow symbolic links in SOURCE

.[^.]*
any file and directory start with . but not ..

Sunday, May 11, 2008

Kubuntu 7.10 Kaffeine Play Encrypted DVD

Repost from here.

1) sudo /usr/share/doc/libdvdread3/install-css.sh

2) In Kaffeine
Go to to Settings->xine Engine Parameters
Select “Media” section
Select the “Expert Options” tab
Find an option labelled “CSS decryption method”
Change setting from “key” to “title”.

It just works (after a few steps).




Sunday, March 09, 2008

WMA to MP3 using mplayer and lame

for i in *.wma ; do
mplayer -vo null -vc dummy -af resample=44100 -ao pcm:wavehead $i
lame -m mo audiodump.wav "${i%.wma}.mp3"
done

Install Source Code as an Ubuntu deb Package

The easiest way is as following...

Take foo.tar.bz2 as an examples.

1. tar jxvf foo.tar.bz2
2. cd foo
3. ./configure ; make
4. sudo checkinstall

Installed and deb package generated

Saturday, March 08, 2008

16:9 rmvb to iPod format

mencoder
-ovc lavc -lavcopts vcodec=mpeg4
-vf scale=320:-3,expand=:240:::1::
video filter
scale
320: Width
−3: Calculate w/h using the other dimension and the original aspect ratio.
expand
240: Expanded height
1: OSD/subtitle rendering On
-oac faac
-o intermediate.mp4 input.rmvb

ffmpeg
-vcodec xvid -b 350 -qmax 10 -bufsize 4096 -g 300
-acodec aac -ab 96 -ac 2
-s 320x240
-aspect 4:3
-i intermediate.mp4
output.mp4

Tuesday, March 04, 2008

SNL: Democratic Debate #2

Democratic Debate #2
Hillary and Obama face off again

Monday, March 03, 2008

My experience of CSS

Use descendant selectors carefully, especially for build in html text labels such as <p> and <span>. Descendant selector is convenient to specify general text style only when you already have a whole picture what your website should be look like, or the descendant selector rules may contradict the selector which you want to another kind of style for a identified paragraph. An example:

#container p {
font-color: #000000;
font-size: 16px;
}

#container #someDiv .identifiedP {
font-color: #ff0000;
font-size: 12px;
}

<div id="container">

<div id="someDiv">

<p id="identifiedP">
Text here will be black rather than red as you specify.
</p>

</div>

</div>