Wednesday, February 8, 2012

How to check the distribution and kernel version of Linux?

  1. $ cat /etc/*-release
    It will tell you the distribution name and version.
  2. $ lsb_release -a
    Same as above.
  3. $ uname -mrs
    It will tell you the linux kernel version and type (x86 or x64).

Saturday, January 14, 2012

How to adjust the output quality when using Handbrake to convert DVDs to MP4/Mkv

There are 3 methods which can do the same thing to you.
They are easy and helpful.

1. Set the estimated output file size:
Handbrake with calculate the best bitrate for you. For DVDs with the best converting quality. Set the output file size equals or slightly smaller than the original DVD size. That can yield the best output quality.

2. Set the average bitrate:
480P(720x480) h.264
excellent bitrate=4266 kbps,
good bitrate=2346 kbps,
normal bitrate=1493 kbps,

480P(720x480)mpeg4
excellent bitrate=4665 kbps,
good bitrate=2565 kbps,
normal bitrate=1632 kbps.

3. Set the constant quality:
For preserving the DVD quality, set RF=20.
For smaller output file size, set RF=28.

Thursday, December 22, 2011

Linux/Unix下用SCP傳輸檔案之用法

傳檔案過去遠端主機

scp -p source.file user@DomainName:/TargetPath/

抓檔案過來

scp user@DomainName:/SourcePath/file /home/user/TargetPath

Tuesday, December 20, 2011

How to update/install Firefox 9.0 in Ubuntu?

  1. 新增Firefox 9.0 repository
    sudo add-apt-repository ppa:mozillateam/firefox-next
  2. 更新套件版本資料
    sudo apt-get update
  3. 更新系統套件版本,或者直接安裝Firefox 9.0
    sudo apt-get upgrade or sudo apt-get install firefox
  4. 搞定收工

移除Gnome Class介面中Top Bar的捷徑圖示

Question: How to remove the icon from the top bar in Gnome classic interface?

Ans: Alt+滑鼠右鍵。

Monday, August 22, 2011

空字串與Null

聽說在Oracle DB中,空字串==Null是成立的,
但是在其他地方不是。

空字串:一個字串沒有東西,但仍有字串結尾,例如/0。
Null:什麼都沒有。

自己做了一點小實驗,
string aaa="";
string bbb=null;

對aaa與bbb取長度,則aaa=0,bbb不給取,編譯就會出現exception。
對aaa與bbb進行==null判斷,aaa為false, bbb為true。