2010年9月19日 星期日

PDF 處理工具 : pdftk

!!! 注意:PDF 檔名不能有中文 !!!
  • Merge Two or More PDFs into a New Document
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

or (Using Handles):
pdftk A=1.pdf B=2.pdf cat A B output 12.pdf

or (Using Wildcards):
pdftk *.pdf cat output combined.pdf
  • Split Select Pages from Multiple PDFs into a New Document
pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf

  • Rotate the First Page of a PDF to 90 Degrees Clockwise
pdftk in.pdf cat 1E 2-end output out.pdf
  • Rotate an Entire PDF Document's Pages to 180 Degrees
pdftk in.pdf cat 1-endS output out.pdf

Reference:
http://www.accesspdf.com/pdftk/

2010年9月3日 星期五

GPT vs MBR : use parted 切 gpt 分割區

Create a GPT partition via parted
  • 確認要切割的為 /dev/sdb
cat /proc/partitions
major minor  #blocks  name

   8     0  142577664 sda
   8     1   11719386 sda1
   8     2          1 sda2
   8     5   48829536 sda5
   8     6   82027858 sda6
   8    16 5855465280 sdb
  • run the follow in parted ( sudo parted /dev/sdb)
  • 確認空間與單位數
print free
Model: LSI MegaRAID SAS RMB (scsi)
Disk /dev/sdb: 5996GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
        17.4kB  5996GB  5996GB  Free Space   
  • 使用 GPT格式並分割一塊 xfs 的分割區
mklabel gpt
mkpartfs primary xfs 0 5996G
  • 離開,並格式化
quit
sudo mkfs.xfs /dev/sdb1
  • Done


GPT(GUID Partition Table)

一、定義簡說
二、OS支援
三、GPT、NTFS轉換
四、問題、應用

一、定義簡說

由於使用上的限制,Intel+Microsoft在2004年合作開發EFI(Extensible Firmware Interface)計畫,算是一種主機板、儲存磁碟的升級方案,GPT(GUID Partition Table)為計畫裡的一部分,不過,並非一定要搭配EFI才能用,搭配一般BIOS也能用,只是不能作為開機系統。

MBR磁碟的Partition資料,存放在Master(我們俗稱第0軌)
GPT磁碟的每個Partition資料,都有各自的GUID,此為主要差異。

GPT磁碟有保護區,小小佔用空間,依照作業系統不同:
  • Windows:128MB
  • MAC:200MB

支援分割區單一分割區最高容量
MBR(Master Boot Record) 4(延伸分割不計) 2TB
GPT(GUID Partition Table) 沒有限制,但是Windows只能128個 18TB

二、OS支援(Windows)
1.一般支援:
  • Windows XP 64 Bit
  • Windows 2003 Server + SP1
  • Windows Vista
以後的皆有支援,此處支援,乃指『可辨識、存取』,不包含開機(作為系統磁碟)

2.開機支援(作為系統磁碟):
主機板必須支援EFI

三、GPT、NTFS轉換

在Windows環境,磁碟系統GPT轉換回NTFS的指令:
diskpart
選項:
  • list disk 列出目前磁碟
  • select disk n 選擇目標,n為代號
  • clean all 清除所有分割資料,之後,即可重新分割

如果是新的磁碟(超過2TB,包含RAID),自然會顯示出『GPT磁碟』選項,無須另外處理

Reference:
http://en.wikipedia.org/wiki/GUID_Partition_Table
http://bigcandy.blog.ithome.com.tw/post/2158/72554

2010年9月2日 星期四

鎖定套件避免 apt 升級部份套件的方法

Q: 如何避免 apt 雞婆的更新部份你想要裝 或 不想要更新的套件呢?
A: 修改 /etc/apt/preferences 就好了,內容會像是:
Package: PACKAGE_NAME
Pin: PIN
Pin-Priority: PIN_PRIORITY
以 syslinux 為例
Package: syslinux
Pin: version 3.8*
Pin-Priority: 100
所以優先順序填成下面的值,會造成不同的結果:

1001 # 永不更新,如果現存的版本比較新(優先順序比較低)還會作降級的動作
1000 # 跟 1001 一樣,不過 apt 不會作降級的動作
990 # 如果有比較高的版本用 "APT::Default-Release" 標示的會昇級
500 # 比 0.8* 還高的版本就會昇級,不過 0.8* 還是較低版本裡面的第一選擇
100 #syslinux 裡面有更高的版本就會不管 0.8* ,但如果沒有其它的版本先安裝了的話,就會先裝 0.8*
-1 # 避免裝 0.8* 這個版本

Reference:
http://antontw.blogspot.com/2009/06/linux-apt.html

Linux清除ARP 暫存

一、這樣可以清除單一IP的ARP緩存
arp -d IP
二、清除192.168.0.0網段的所有暫存

for((ip=2;ip<255;ip++));do \
    arp -d 192.168.0.$ip &>/dev/null; \
done

三、清除所有ARP

arp -n|awk '/^[1-9]/ {print "arp -d "$1}' | sh


Reference:
http://www.linuxzh.org/Linux/arp-clean.html

2010年8月19日 星期四

電腦各種符號英文唸法

Reference: http://wuyy.idv.tw/blog/index.php/computer-sign-english-read/

電腦各種符號英文唸法


Symbol 符號

Description 說明 Chinese 中文/中式說法

~
Tilde 取代符號/毛毛蟲

!
Exclamation point 驚歎號

@
At sign, at At符號/小老鼠

#
Number sign 數字符號/井號

£
Pound sign 英鎊符號

$
Dollar sign 錢符號

%
Percent, percent sign 百分比,百分比符號

^
Caret 脫字符號/小三角

&
Ampersand And符號

*
Asterisk 星號/米字號

(
Open parenthesis 左括號

)
Close parenthesis 右括號

–
Dash 破折號

—
Double dash 雙破折號

_
Underscore 底線

+
Plus, plus sign 加,加號

=
Equals 等號

|
Vertical bar 垂直線/直線號

\
Backslash 反斜線

{
Open brace 左大括號

}
Close brace 右大括號

[
Open bracket 左方括號

]
Close bracket 右方括號

:
Colon 冒號

;
Semicolon 分號

“
Quote 雙引號

‘
Single quote 單引號

,
Comma 逗號

.
Period, dot 句號,點

>
Greater than 大於

<
Less than 小於

?
Question mark 問號

/
Slash 斜線

//
Double slash 雙斜線

…
Ellipsis 省略符號/點點點

-
Hyphen 連字號

Ceasar's Photo

www.flickr.com