<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Just My Life &#187; Linux</title>
	<atom:link href="http://imrgill.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://imrgill.com</link>
	<description>I&#039;m mrGilL, I&#039;m Newbie Admin</description>
	<lastBuildDate>Mon, 21 May 2012 09:18:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>การ Config SAN Multipath I/O บน Ubuntu Server</title>
		<link>http://imrgill.com/2012/05/15/how-to-config-multipath-io-san-storage-on-ubuntu-server.html</link>
		<comments>http://imrgill.com/2012/05/15/how-to-config-multipath-io-san-storage-on-ubuntu-server.html#comments</comments>
		<pubDate>Tue, 15 May 2012 08:36:13 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[msa p2000]]></category>
		<category><![CDATA[multipath]]></category>
		<category><![CDATA[multipath i/o]]></category>
		<category><![CDATA[multipath-tools]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=695</guid>
		<description><![CDATA[สวัสดีครับ วันนี้จะมาแนะนำวิธีการคอนฟิก Multipath I/O สำหรับ SAN Storage บน Ubuntu Server กันครับ อะไรคือ Multipath ตามความเข้าใจของผมคือ สมมติว่าเราสร้าง Volume หรือ LUN ไว้บน Storage ไว้ 1 Volume/LUN แต่เรา Present Volume หรือ LUN นั้นออกมาจาก Port FC 2 Port เพื่อป้องกันการ Fail ของอุปกรณ์ จะทำให้เครื่อง Server เห็น Volume/LUN นั้นเป็น Disk 2 ลูก ทั้งที่จริงแล้วมันคือ Volume/LUN เดียวกัน ดังนั้นเราจำเป็นต้องทำการ Map ให้เครื่อง Server ของเราเห็น Disk เพียงลูกเดียวด้วยการทำ Multipath [...]]]></description>
			<content:encoded><![CDATA[<p>        สวัสดีครับ วันนี้จะมาแนะนำวิธีการคอนฟิก Multipath I/O สำหรับ SAN Storage บน Ubuntu Server กันครับ<br />
อะไรคือ Multipath ตามความเข้าใจของผมคือ สมมติว่าเราสร้าง Volume หรือ LUN ไว้บน Storage ไว้ 1 Volume/LUN แต่เรา Present Volume หรือ LUN นั้นออกมาจาก Port FC 2 Port เพื่อป้องกันการ Fail ของอุปกรณ์ จะทำให้เครื่อง Server เห็น Volume/LUN นั้นเป็น Disk 2 ลูก ทั้งที่จริงแล้วมันคือ Volume/LUN เดียวกัน ดังนั้นเราจำเป็นต้องทำการ Map ให้เครื่อง Server ของเราเห็น Disk เพียงลูกเดียวด้วยการทำ Multipath</p>
<p>ในตัวอย่างนี้ผมใช้ Ubuntu 10.04.3 LTS Server กับ SAN Storage HP MSA P2000 นะครับ</p>
<p>สำหรับ Ubuntu นั้นมี Package ตัวนึงที่ชื่อ multipath-tools ซึ่งเราสามารถติดตั้งด้วยใช้คำสั่ง</p>
<div class="codesnip-container" >
<pre>
root@server1:~# apt-get install multipath-tools
</pre>
</div>
<p>ติดตั้งเสร็จแล้วก็ทำการสร้างไฟล์ /etc/multipath.conf โดยจะคำสั่ง vi สร้างไฟล์ขึ้นมาใหม่หรือจะใช้ cat ตามตัวอย่างด้านล่างก็ได้</p>
<div class="codesnip-container" >
<pre>
root@server1:~# cat &#60;&#60;EOF > /etc/multipath.conf
defaults {
       user_friendly_names     yes
       path_grouping_policy    group_by_serial
       path_checker            tur
}

blacklist {
       devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
       devnode "^sda"
       # blacklist any other locally attached block devices here
}
EOF
</pre>
</div>
<p>จากนั้นสั่ง restart service multipath-tools สักรอบ</p>
<div class="codesnip-container" >
<pre>
root@agoldap:~# /etc/init.d/multipath-tools restart
</pre>
</div>
<p>ดูผลด้วยคำสั่ง multipath -lv</p>
<div class="codesnip-container" >
<pre>
root@server1:~# multipath -lv
mpath0 (3600c0ff000134ec320b7334f02000000) dm-0 ,
[size=149G][features=0][hwhandler=0]
\_ round-robin 0 [prio=0][active]
 \_ #:#:#:#  -   #:#   [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 0:0:1:14 sdb 8:16  [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:0:14 sdc 8:32  [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:1:14 sdd 8:48  [active][undef]
</pre>
</div>
<p>ผมก็จะได้ประมาณนี้ โดยเวลาเราจะอ้างถึง raw disk ก็อ้างชื่อเป็น mpath0 ซึ่งอยู่ใน /dev/mapper/mpath0<br />
ลองทดสอง fdisk กันเลย</p>
<div class="codesnip-container" >
<pre>
root@server1:~# fdisk /dev/mapper/mpath0

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/mapper/mpath0: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8ca1da99

              Device Boot      Start         End      Blocks   Id  System
/dev/mapper/mpath0p1   *           1       19452   156248158+  83  Linux

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/mapper/mpath0: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8ca1da99

              Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19452, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-19452, default 19452):
Using default value 19452

Command (m for help): p

Disk /dev/mapper/mpath0: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8ca1da99

              Device Boot      Start         End      Blocks   Id  System
/dev/mapper/mpath0p1               1       19452   156248158+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
</pre>
</div>
<p>ดู Partition ที่เราสร้างโดยการเข้าไปเช็คที่ /dev/mapper</p>
<div class="codesnip-container" >
<pre>
root@server1:~# cd /dev/mapper/
root@server1:/dev/mapper# ls -l
total 0
crw-rw---- 1 root root  10, 59 2012-05-15 14:14 control
brw-rw---- 1 root disk 251,  0 2012-05-15 15:25 mpath0
brw-rw---- 1 root disk 251,  1 2012-05-15 15:25 mpath0-part1
root@server1:/dev/mapper#
</pre>
</div>
<p>Partition ที่เราเพิ่งสร้างคือ mpath0-part1<br />
ทีนี้ลองมา format มันเป็น ext4 กัน</p>
<div class="codesnip-container" >
<pre>
root@server1:~# mkfs.ext4 /dev/mapper/mpath0-part1
mke2fs 1.41.11 (14-Mar-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
9773056 inodes, 39062039 blocks
1953101 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1193 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
	4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
</pre>
</div>
<p>เสร็จแล้วก็ลอง mount ไปใช้ดู</p>
<div class="codesnip-container" >
<pre>
root@server1:~# mount /dev/mapper/mpath0-part1 /backup
root@server1:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p1     130G  2.1G  121G   2% /
none                  3.9G  236K  3.9G   1% /dev
none                  4.0G     0  4.0G   0% /dev/shm
none                  4.0G  104K  3.9G   1% /var/run
none                  4.0G     0  4.0G   0% /var/lock
none                  4.0G     0  4.0G   0% /lib/init/rw
none                  130G  2.1G  121G   2% /var/lib/ureadahead/debugfs
/dev/mapper/mpath0-part1
                      147G  188M  140G   1% /backup
</pre>
</div>
<p>หากต้องการจะให้มัน mount เองทุกครั้งตอนเปิดเครื่องก็เข้าไปแก้ไขไฟล์ /etc/fstab เองนะครับ<br />
เป็นอันเสร็จครับ</p>
<p>แหล่งข้อมูล : <a href="https://www.sit.auckland.ac.nz/Configuring_SAN_access_with_Linux_multipath" target="_blank">https://www.sit.auckland.ac.nz/Configuring_SAN_access_with_Linux_multipath</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2012/05/15/how-to-config-multipath-io-san-storage-on-ubuntu-server.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>วิธีแปลง Unix Time (POSIX Time) เป็นเวลาที่คนธรรมดาอ่านรู้เรื่องบน Linux</title>
		<link>http://imrgill.com/2012/03/19/how-to-convert-unix-time-to-normal-time-format-on-linux.html</link>
		<comments>http://imrgill.com/2012/03/19/how-to-convert-unix-time-to-normal-time-format-on-linux.html#comments</comments>
		<pubDate>Mon, 19 Mar 2012 08:22:00 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily command]]></category>
		<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[posix time]]></category>
		<category><![CDATA[unix time]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=691</guid>
		<description><![CDATA[วันนี้เป็น Tip สั้นๆ ครับมาไวไปไว สำหรับใครที่ไปเจอ Unix time แล้วอ่านไม่รุ้เรื่องว่ามันคืออะไรลองเอาคำสั่งนี้ไปใช้ดูครับ ใช้คำสั่ง date -d @xxxxxxxxxx root@agoldap:~# date -d @xxxxxxxxxx โดยที่ xxxxxxxxxx เป็น unix time ที่เราต้องการจะ convert ตัวอย่าง root@agoldap:~# date +%s 1332144867 root@agoldap:~# root@agoldap:~# root@agoldap:~# root@agoldap:~# root@agoldap:~# date -d @1332144666 Mon Mar 19 15:11:06 ICT 2012 root@agoldap:~# จบ ข้อมูลเกี่ยวกับ Unix time : http://en.wikipedia.org/wiki/Unix_time]]></description>
			<content:encoded><![CDATA[<p>วันนี้เป็น Tip สั้นๆ ครับมาไวไปไว สำหรับใครที่ไปเจอ Unix time แล้วอ่านไม่รุ้เรื่องว่ามันคืออะไรลองเอาคำสั่งนี้ไปใช้ดูครับ<br />
ใช้คำสั่ง date -d @xxxxxxxxxx </p>
<pre>
<div class="codesnip-container" >root@agoldap:~# date -d @xxxxxxxxxx</div>
</pre>
<p>โดยที่ xxxxxxxxxx เป็น unix time ที่เราต้องการจะ convert</p>
<p>ตัวอย่าง</p>
<pre>
<div class="codesnip-container" >root@agoldap:~# date +%s
1332144867
root@agoldap:~#
root@agoldap:~#
root@agoldap:~#
root@agoldap:~#
root@agoldap:~# date -d @1332144666
Mon Mar 19 15:11:06 ICT 2012
root@agoldap:~#</div>
</pre>
<p>จบ</p>
<p>ข้อมูลเกี่ยวกับ Unix time : <a href="http://en.wikipedia.org/wiki/Unix_time">http://en.wikipedia.org/wiki/Unix_time</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2012/03/19/how-to-convert-unix-time-to-normal-time-format-on-linux.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>อยากรู้ว่าเครื่อง Ubuntu แสนรักของเราใส่แรมได้สูงสุดเท่าไหร่ทำไงหนอ</title>
		<link>http://imrgill.com/2011/12/19/how-to-find-maximum-of-ram-memory-on-ubuntu.html</link>
		<comments>http://imrgill.com/2011/12/19/how-to-find-maximum-of-ram-memory-on-ubuntu.html#comments</comments>
		<pubDate>Mon, 19 Dec 2011 11:23:49 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily command]]></category>
		<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=684</guid>
		<description><![CDATA[วันนี้เป็น How To สั้นๆ ครับ สำหรับใครที่อยากรู้ว่าเครื่องคอมพิวเตอร์ที่ติดตั้ง Ubuntu ของตัวเองใส่ Ram ได้สูงสุดกี่ GB คำสั่งมีดังนี้ ง่ายแค่สั่ง sudo dmidecode --type memory ผลที่ได้ mrgill@mrgill-laptop:~$ sudo dmidecode --type memory [sudo] password for mrgill: # dmidecode 2.9 SMBIOS 2.6 present. Handle 0x0016, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None [...]]]></description>
			<content:encoded><![CDATA[<p>วันนี้เป็น How To สั้นๆ ครับ สำหรับใครที่อยากรู้ว่าเครื่องคอมพิวเตอร์ที่ติดตั้ง Ubuntu ของตัวเองใส่ Ram ได้สูงสุดกี่ GB คำสั่งมีดังนี้<br />
ง่ายแค่สั่ง</p>
<pre>
<div class="codesnip-container" >sudo dmidecode --type memory</div>
</pre>
<p>ผลที่ได้</p>
<pre>
<div class="codesnip-container" >mrgill@mrgill-laptop:~$ sudo dmidecode --type memory
[sudo] password for mrgill:
# dmidecode 2.9
SMBIOS 2.6 present.

Handle 0x0016, DMI type 16, 15 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	<u>Maximum Capacity: 8 GB</u>
	Error Information Handle: Not Provided
	Number Of Devices: 2

Handle 0x0017, DMI type 17, 28 bytes
Memory Device
	Array Handle: 0x0016
	Error Information Handle: No Error
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 4096 MB
	Form Factor: SODIMM
	Set: 1
	Locator: DIMM_A
	Bank Locator: Not Specified
	Type: <OUT OF SPEC>
	Type Detail: Synchronous
	Speed: 1333 MHz (0.8 ns)
	Manufacturer: 0198
	Serial Number: 8C1CE17A
	Asset Tag: 1137
	Part Number: 99U5428-040.A01G  

Handle 0x0018, DMI type 17, 28 bytes
Memory Device
	Array Handle: 0x0016
	Error Information Handle: No Error
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 4096 MB
	Form Factor: SODIMM
	Set: 1
	Locator: DIMM_B
	Bank Locator: Not Specified
	Type: <OUT OF SPEC>
	Type Detail: Synchronous
	Speed: 1333 MHz (0.8 ns)
	Manufacturer: 80CE
	Serial Number: 673855AF
	Asset Tag: 1120
	Part Number: M471B5273DH0-CH9</div>
</pre>
<p>จากตัวอย่างเครื่อง Notebook Dell Inspiron N4010 ของผมสามารถใส่ Ram ได้สูงสุดแค่ 8GB และยังบอกอีกว่าใช้ DIMM ไหนไปบ้าง</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/12/19/how-to-find-maximum-of-ram-memory-on-ubuntu.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>วิธีติดตั้ง Visual CertExam Suite บน Ubuntu 11.10</title>
		<link>http://imrgill.com/2011/12/11/how-to-visual-certexam-suite-on-ubuntu-11-10.html</link>
		<comments>http://imrgill.com/2011/12/11/how-to-visual-certexam-suite-on-ubuntu-11-10.html#comments</comments>
		<pubDate>Sun, 11 Dec 2011 11:38:31 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[.vce]]></category>
		<category><![CDATA[visual certexam]]></category>
		<category><![CDATA[wine]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=681</guid>
		<description><![CDATA[วันนี้ขอแนะนำ Dark Side Technical เกี่ยวกับการติดตั้งโปรแกรม Visual CertExam Suite สำหรับท่านที่ต้องการลองทำข้อสอบจำลอง Certify ต่างบน Ubuntu กันครับ ในที่นี้ผมขอใช้ version 1.9.987 นะครับ อันนี้ Search หาใน Google กันได้เลยมี Key ให้เรียบร้อยผมแนะนำแค่นี้พอละกัน ส่วนใหญ่จะเป็น zip ไฟล์มีทั้งตัวติดตั้งและ Registry Key สำหรับ Activate ขั้นตอนการติดตั้ง 1. หาที่ download ไฟล์กันมาก่อน อันนี้หาเองครับลอง search ใน google ดู key ประมาณ Visual CertExam Suite with reg key ก็จะเจอ 2. ได้ไฟล์ .zip มาก็แตกมันออกครับ 3. [...]]]></description>
			<content:encoded><![CDATA[<p>วันนี้ขอแนะนำ Dark Side Technical เกี่ยวกับการติดตั้งโปรแกรม Visual CertExam Suite สำหรับท่านที่ต้องการลองทำข้อสอบจำลอง Certify ต่างบน Ubuntu กันครับ ในที่นี้ผมขอใช้ version 1.9.987 นะครับ<br />
อันนี้ Search หาใน Google กันได้เลยมี Key ให้เรียบร้อยผมแนะนำแค่นี้พอละกัน ส่วนใหญ่จะเป็น zip ไฟล์มีทั้งตัวติดตั้งและ Registry Key สำหรับ Activate</p>
<p>ขั้นตอนการติดตั้ง<br />
1. หาที่ download ไฟล์กันมาก่อน อันนี้หาเองครับลอง search ใน google ดู key ประมาณ Visual CertExam Suite with reg key ก็จะเจอ<br />
2. ได้ไฟล์ .zip มาก็แตกมันออกครับ<br />
3. ติดตั้ง package wine หากใครมีอยู่แล้วก็ไม่ต้องติดตั้ง<br />
4. เปิด Terminal แล้ว cd เข้าไปยัง Directory ที่เก็บไฟล์ที่แตกออกมาเมื่อกี้<br />
5. ใช้คำสั่ง</p>
<pre>
<div class="codesnip-container" >$ wine visual_certexam_suite_setup.exe</div>
</pre>
<p>หรือจะคลิกขวาที่ไฟล์ visual_certexam_suite_setup.exe แล้วเลือก Open With Wine Windows Program Loader<br />
จากนั้นทำตามขั้นตอน step next ไปเรื่อยๆ จนเสร็จ<br />
6. เมื่อติดตั้งเสร็จแล้วจะเข้า Registry Key เข้าไปยังไงนี่แหละปัญหา มัน Double Click ติดตั้งไม่ได้เหมือนใน Windows เรามีวิธีแก้ไม่ยากครับ ให้เปิด Terminal ขึ้นมา จากนั้นใช้คำสั่ง</p>
<pre>
<div class="codesnip-container" >mrgill@mrgill-laptop:~$ regedit</div>
</pre>
<p>7. จะมีหน้าต่างโปรแกรม Registry Editor ขึ้นมาเหมือนใน Windows คลิกที่เมนู Registry -> เลือกเมนู Import Registry File&#8230;<br />
8. ลองเรียกโปรแกรม Visual CertExam กันเลย ลอง Add ไฟล์ .vce กันได้เลย</p>
<p>เท่านี้ก็พร้อมใช้งานแล้วครับผม</p>
<p>โชคดีในการสอบ</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/12/11/how-to-visual-certexam-suite-on-ubuntu-11-10.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>สูตรคำนวณพื้นที่ Disk สำหรับติดตั้ง Zimbra</title>
		<link>http://imrgill.com/2011/12/07/example-formula-for-calculate-disk-storage-for-install-zimbra.html</link>
		<comments>http://imrgill.com/2011/12/07/example-formula-for-calculate-disk-storage-for-install-zimbra.html#comments</comments>
		<pubDate>Wed, 07 Dec 2011 07:11:26 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[zimbra]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=678</guid>
		<description><![CDATA[STORAGE CALCULATION EXAMPLE (Based on ‘Mailbox Usage of 200 MB’ and 500 users) + User Data: 500 users with 200 MB = 100 GB user data + MySQL data: 5% of 100 GB (User Data): 5 GB + Zimbra binaries: 10 GB + Zimbra logs: 20 GB + Zimbra indexes: 25% of 100GB (User Data) [...]]]></description>
			<content:encoded><![CDATA[<p><strong>STORAGE CALCULATION EXAMPLE</strong><span style="font-size: x-small;"><br />
(Based on ‘Mailbox Usage of 200 MB’ and 500 users)<br />
</span><br />
+ User Data: 500 users with 200 MB = 100 GB user data<br />
+ MySQL data: 5% of 100 GB (User Data): 5 GB<br />
+ Zimbra binaries: 10 GB<br />
+ Zimbra logs: 20 GB<br />
+ Zimbra indexes: 25% of 100GB (User Data) = 25 GB<br />
<strong><br />
SUBTOTAL:</strong> 100 + 5 + 10 + 20 + 25 = 160 GB<br />
<strong>Backups:</strong> 160 % of Subtotal: 160 * 160% = 256 GB for backups<br />
<strong>TOTAL:</strong> 160 + 256 = 416 GB</p>
<p>อ้างอิง : <a href="http://blog.zimbra.com/blog/archives/2009/05/6-tips-for-a-smooth-zimbra-server-install.html">http://blog.zimbra.com/blog/archives/2009/05/6-tips-for-a-smooth-zimbra-server-install.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/12/07/example-formula-for-calculate-disk-storage-for-install-zimbra.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>แก้ปัญหา Emesene connect ไม่ได้บน Ubuntu</title>
		<link>http://imrgill.com/2011/11/11/%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-emesene-connect-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b9%84%e0%b8%94%e0%b9%89%e0%b8%9a%e0%b8%99-ubuntu.html</link>
		<comments>http://imrgill.com/2011/11/11/%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-emesene-connect-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b9%84%e0%b8%94%e0%b9%89%e0%b8%9a%e0%b8%99-ubuntu.html#comments</comments>
		<pubDate>Fri, 11 Nov 2011 04:08:10 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=667</guid>
		<description><![CDATA[ตอนนี้หลายที่คนใช้ Emesene บน Ubuntu คงประสบปัญหาน้ำท่วมกันแถมยัง connect หรือ login เจ้า emesene ไม่ได้อีกใช่ไหมครับ ปัญหาดังกล่าวเกิดมาจากทาง Server ของ Live Messenger จึงทำให้ Third-party MSN Client ไม่สามารถ login ได้ วิธีแก้ไขปัญหาชั่วคราวตอนนี้ก็ให้ Download Emesene จากลิงค์ข้างล่างมาใช้ไปก่อนครับ Download Emesene Snapshot โหลดมาแล้วก็ Extract มันออกมาครับแล้วเข้าไปในไดเรกทอรี emesene -> ดัลเบิลคลิกที่ emesene เลือก Run จากนั้นก็กรอกข้อมูล login ปกติได้เลยครับ หลังจาก login สำเร็จ ระบบอาจแจ้งเตือนว่า profile เรา broken ถ้าเรากด Yes มันก็จะให้เรา login เข้าไปใน Live [...]]]></description>
			<content:encoded><![CDATA[<p>ตอนนี้หลายที่คนใช้ Emesene บน Ubuntu คงประสบปัญหาน้ำท่วมกันแถมยัง connect หรือ login เจ้า emesene ไม่ได้อีกใช่ไหมครับ<br />
ปัญหาดังกล่าวเกิดมาจากทาง Server ของ Live Messenger จึงทำให้ Third-party MSN Client ไม่สามารถ login ได้<br />
วิธีแก้ไขปัญหาชั่วคราวตอนนี้ก็ให้ Download Emesene จากลิงค์ข้างล่างมาใช้ไปก่อนครับ</p>
<p><a href="https://github.com/emesene/emesene/zipball/master">Download Emesene Snapshot</a></p>
<p>โหลดมาแล้วก็ Extract มันออกมาครับแล้วเข้าไปในไดเรกทอรี emesene -> ดัลเบิลคลิกที่ emesene เลือก Run<br />
จากนั้นก็กรอกข้อมูล login ปกติได้เลยครับ<br />
หลังจาก login สำเร็จ ระบบอาจแจ้งเตือนว่า profile เรา broken ถ้าเรากด Yes มันก็จะให้เรา login เข้าไปใน Live profile เพื่อแก้ไข profile ได้ครับ</p>
<p>สำหรับหรับใครที่จะใช้ emesene ตัวนี้เป็นการถาวรก็ mv directory emesene ของใหม่ไปทับของเก่าที่ /usr/share/emesene/ ได้เลยครับ</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~# mv /usr/share/emesene/emesene /usr/share/emesene/emesene.backup #backup ตัวเก่าเก็บไว้ก่อน
root@mrgill-laptop:~# mv Desktop/emesene-emesene-00cd2cc/emesene/ /usr/share/emesene/ #ย้ายตัวใหม่มาไว้แทนที่ของเก่า</div>
</pre>
<p>จบครับ</p>
<p>ขอบคุณข้อมูลจาก : <a href="http://www.omgubuntu.co.uk/2011/11/emesene-not-connecting-quick-fix/">http://www.omgubuntu.co.uk/2011/11/emesene-not-connecting-quick-fix/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/11/11/%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-emesene-connect-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b9%84%e0%b8%94%e0%b9%89%e0%b8%9a%e0%b8%99-ubuntu.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การติดตั้ง Notepad++ บน Ubuntu 11.10</title>
		<link>http://imrgill.com/2011/10/15/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-notepad-plus-plus-%e0%b8%9a%e0%b8%99-ubuntu-11-10.html</link>
		<comments>http://imrgill.com/2011/10/15/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-notepad-plus-plus-%e0%b8%9a%e0%b8%99-ubuntu-11-10.html#comments</comments>
		<pubDate>Sat, 15 Oct 2011 05:47:07 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[notepad++]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=658</guid>
		<description><![CDATA[เมื่อวานเพิ่งติดตั้ง Ubuntu 11.10 สดร้อนๆ เลยครับ ก็พยายามติดตั้งโปรแกรมต่างๆ ให้เหมือนเดิม หนึ่งในนั้นคือ Notepad++ editor ที่น่าใช้ตัวนึง น่าเสียดายที่ตอนนี้ Notepad++ ยังไม่มี version ที่สามารถติดตั้งบน Linux ได้ แต่ก็ไม่ใช่ว่าจะไม่สามารถติดตั้งได้ซะทีเดียว เราสามารถติดตั้ง .exe ได้โดยใช้ความสามารถของ wine เข้ามาช่วย อย่างแรกคุณต้องติดตั้ง wine ก่อน sudo installl wine จากนั้นเข้าไป download Notepad++ จาก http://notepad-plus-plus.org/download/ โหลดเสร็จแล้วเปิด terminal ขึ้นมาครับ ผม save npp.5.9.4.Installer.exe ไว้ที่ ~/Downloads ก็ cd ไปที่ ~/Downloads save ไว้ที่ไหนก็เข้าไปที่นั้นแหละครับ cd ~/Downloads มาเริ่มติดตั้งกันเลยโดยใช้คำสั่ง wine npp.5.9.4.Installer.exe จากนั้นจะมี [...]]]></description>
			<content:encoded><![CDATA[<p>เมื่อวานเพิ่งติดตั้ง Ubuntu 11.10 สดร้อนๆ เลยครับ<br />
ก็พยายามติดตั้งโปรแกรมต่างๆ ให้เหมือนเดิม หนึ่งในนั้นคือ Notepad++ editor ที่น่าใช้ตัวนึง<br />
น่าเสียดายที่ตอนนี้ Notepad++ ยังไม่มี version ที่สามารถติดตั้งบน Linux ได้<br />
แต่ก็ไม่ใช่ว่าจะไม่สามารถติดตั้งได้ซะทีเดียว เราสามารถติดตั้ง .exe ได้โดยใช้ความสามารถของ wine เข้ามาช่วย<br />
อย่างแรกคุณต้องติดตั้ง wine ก่อน</p>
<pre>
<div class="codesnip-container" >sudo installl wine</div>
</pre>
<p>จากนั้นเข้าไป download Notepad++ จาก<a href="http://notepad-plus-plus.org/download/" title="Notepad++" target="_blank"> http://notepad-plus-plus.org/download/</a><br />
โหลดเสร็จแล้วเปิด terminal ขึ้นมาครับ ผม save npp.5.9.4.Installer.exe ไว้ที่ ~/Downloads ก็ cd ไปที่ ~/Downloads save ไว้ที่ไหนก็เข้าไปที่นั้นแหละครับ</p>
<pre>
<div class="codesnip-container" >cd ~/Downloads</div>
</pre>
<p>มาเริ่มติดตั้งกันเลยโดยใช้คำสั่ง</p>
<pre>
<div class="codesnip-container" >wine npp.5.9.4.Installer.exe</div>
</pre>
<p>จากนั้นจะมี Wizard ขี้นมาก็ next อย่างเดียวได้เลยครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/10/15/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-notepad-plus-plus-%e0%b8%9a%e0%b8%99-ubuntu-11-10.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>วิธีเพิ่ม Swap โดยไม่ต้องสร้าง Partition ใหม่</title>
		<link>http://imrgill.com/2011/07/13/how-to-increase-swap-size-with-out-add-new-partition.html</link>
		<comments>http://imrgill.com/2011/07/13/how-to-increase-swap-size-with-out-add-new-partition.html#comments</comments>
		<pubDate>Wed, 13 Jul 2011 10:01:29 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily command]]></category>
		<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[swapoff]]></category>
		<category><![CDATA[swapon]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=647</guid>
		<description><![CDATA[ขั้นตอนง่ายๆ ครับ ไม่มีอะไร ไม่ต้องแบ่ง partition ใหม่ให้ยุ่งยาก แค่สร้าง dump file ขึ้นมาให้เท่ากับขนาดของ swap ที่ต้องการได้เลยโดยใช้คำสั่ง 1. สร้างพื้นที่สำหรับใช้เป็น swap root@mrgill-laptop:~# dd if=/dev/zero of=/tmp/newswap bs=1MB count=1024 ตัวอย่างผมสร้างไฟล์ขนาด 1GB เพื่อจะใช้เป็น swap (อยากได้กี่ GB ก็คำนวนเอานะครับ x * 1024) 2. เมื่อได้ไฟล์ /tmp/newswap มาแล้วก็ถึงขั้นตอนการสร้าง newswap ให้เป็น swap โดยใช้คำสั่ง root@mrgill-laptop:~# mkswap /tmp/newswap 3. เรียกใช้งาน newswap ที่เพิ่งสร้างไปจากขั้นตอนที่ 2 โดยใช้คำสั่ง root@mrgill-laptop:~# swapon /tmp/newswap 4. ทดสอบเรียกดูว่า swap เพิ่มขึ้นหรือเปล่าด้วยคำสั่ง [...]]]></description>
			<content:encoded><![CDATA[<p>ขั้นตอนง่ายๆ ครับ ไม่มีอะไร ไม่ต้องแบ่ง partition ใหม่ให้ยุ่งยาก แค่สร้าง dump file ขึ้นมาให้เท่ากับขนาดของ swap ที่ต้องการได้เลยโดยใช้คำสั่ง</p>
<p>1. สร้างพื้นที่สำหรับใช้เป็น swap</p>
<div class="codesnip-container" >root@mrgill-laptop:~# dd if=/dev/zero of=/tmp/newswap bs=1MB count=1024</div>
<p>ตัวอย่างผมสร้างไฟล์ขนาด 1GB เพื่อจะใช้เป็น swap (อยากได้กี่ GB ก็คำนวนเอานะครับ x * 1024)</p>
<p>2. เมื่อได้ไฟล์ /tmp/newswap มาแล้วก็ถึงขั้นตอนการสร้าง newswap ให้เป็น swap โดยใช้คำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# mkswap /tmp/newswap</div>
<p>3. เรียกใช้งาน newswap ที่เพิ่งสร้างไปจากขั้นตอนที่ 2 โดยใช้คำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# swapon /tmp/newswap</div>
<p>4. ทดสอบเรียกดูว่า swap เพิ่มขึ้นหรือเปล่าด้วยคำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# free -m</div>
<p>5. หากต้องการให้ swap ที่สร้างถูกเรียกใช้งานเองทุกครั้งที่ restart server ก็ให้ไปเพิ่มบรรทัดด้านล่างเข้าไปในไฟล์ /etc/fstab ดังนี้ครับ</p>
<div class="codesnip-container" >/tmp/newswap       swap           swap             defaults            0    0</div>
<p>ถ้าต้องการเอาไฟล์ swap ไฟล์ที่สร้างเองออกก็ใช้คำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# swapoff /tmp/newswap<br />
root@mrgill-laptop:~# rm -rf /tmp/newswap</div>
<p>ลบแล้วก็อย่าลืมไปเอาบรรทัดที่เพิ่มเข้าไปในไฟล์ /etc/fstab ออกด้วยนะครับ<br />
ไม่งั้นเดี่ยวจะติดปัญหาตอน boot ต้องใช้แผ่น rescure เข้าไปแก้ไฟล์ /etc/fstab ยุ่งยากไปกันใหญ่</p>
<p>แหล่งข้อมูล : <a href="http://www.linuxreaders.com/2009/10/28/how-to-modify-swap-size/" target="_blank">http://www.linuxreaders.com/2009/10/28/how-to-modify-swap-size/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/07/13/how-to-increase-swap-size-with-out-add-new-partition.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ขนาดใหญ่สุดของ ASM Disk สำหรับ Oracle</title>
		<link>http://imrgill.com/2011/07/13/maximum-asm-disk-size-2tb.html</link>
		<comments>http://imrgill.com/2011/07/13/maximum-asm-disk-size-2tb.html#comments</comments>
		<pubDate>Wed, 13 Jul 2011 04:42:41 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[asm]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rhel 5.5]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=645</guid>
		<description><![CDATA[ได้รับมอบหมายให้สร้าง Volume บน SAN เพื่อ Present Disk ให้เครื่อง Database Server ครับ DBA ขอ Volume ขนาด 3.5 TB มาครับ ก็จัดให้ไป เขาไปติดตั้ง Oracle RAC บน RHEL 5.5 x86_64 ถึงตอนติดตั้ง Oracle เขาก็เอา 3.5 TB ไปให้ตรงๆ เลยแบ่งแค่ Partition เดียวขนาด 3.5 TB เลย ใช้ parted ในการสร้าง Partition Disk ขนาด 3.5 TB เพราะใช้ fdisk แบ่ง Partition สูงสุดได้ไม่เกิน 2.2 TB เอา Partition [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>ได้รับมอบหมายให้สร้าง Volume บน SAN เพื่อ Present Disk ให้เครื่อง Database Server ครับ</p>
<p>DBA ขอ Volume ขนาด 3.5 TB มาครับ ก็จัดให้ไป</p>
<p>เขาไปติดตั้ง Oracle RAC บน RHEL 5.5 x86_64</p>
<p>ถึงตอนติดตั้ง Oracle เขาก็เอา 3.5 TB ไปให้ตรงๆ เลยแบ่งแค่ Partition เดียวขนาด 3.5 TB เลย</p>
<p>ใช้ parted ในการสร้าง Partition Disk ขนาด 3.5 TB เพราะใช้ fdisk แบ่ง Partition สูงสุดได้ไม่เกิน 2.2 TB</p>
<p>เอา Partition 3.5 TB ที่สร้างได้ไป Map กับ Oracle ASM ชื่อ DISK1</p>
<p>มาถึงขั้นตอนการติดตั้ง Grid Clusterware ตอน Verify มันก็บอกว่า ASM Disk fail ก็ DBA ก็เลยลอง Ignore ผ่านไปจนมาถึงขั้นตอนรัน root.sh</p>
<p>มันก็ฟ้องมาเลยครับว่า Maximum ASM Disk มีขนาดใหญ่สุดต่อก้อนได้ไม่เกิน 2TB ดังรูป</p>
<p><a href="http://farm7.static.flickr.com/6129/5932755954_f84a1e76e6_b.jpg" rel="lightbox[645]"><img src="http://farm7.static.flickr.com/6129/5932755954_f84a1e76e6.jpg" alt="Oracle Maximum ASM Size" width="500" height="313" /></a></p>
<p>&nbsp;</p>
<p>ซึ่งวิธีแก้ปัญหานี้ก็ไม่ยากครับ ก็แค่แบ่ง Partition ใหม่โดยแบ่ง 3.5 TB ออกเป็น 1.75 TB 2 Partition แล้ว Add เข้าไปเป็น DISK1 และ DISK2</p>
<p>Oracle จะนำพื้นที่มา Stripe รวมกันให้เอง</p>
<p><a href="http://farm7.static.flickr.com/6142/5932797422_398093c24e_b.jpg" rel="lightbox[645]"><img src="http://farm7.static.flickr.com/6142/5932797422_398093c24e.jpg" alt="3.4 TB" width="500" height="313" /></a></p>
<p>เรียบร้อยโรงเรียนกิว</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/07/13/maximum-asm-disk-size-2tb.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>วิธี Decode Base64 Mail MIME ด้วย Munpack</title>
		<link>http://imrgill.com/2011/04/02/how-to-decode-base64-mail-mime-attachment-with-munpack-on-ubuntu.html</link>
		<comments>http://imrgill.com/2011/04/02/how-to-decode-base64-mail-mime-attachment-with-munpack-on-ubuntu.html#comments</comments>
		<pubDate>Sat, 02 Apr 2011 02:34:52 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[munpack]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=640</guid>
		<description><![CDATA[เรื่องมันมีอยู่ว่าผมใช้งาน TOTNetCall ครับ แล้วที่นี้ผมก็รอให้ระบบส่ง User กับ Password มาให้ รอแล้วรอเล่าก็ยังไม่มีอะไรส่งมาเลย มีแต่ mail welcome ส่งมาให้ซึ่งดูเหมือน Mailscan ของ TOT จะแจ้งว่ามันเป็น Spam ด้วย เลยทำให้เนื้อ mail ที่แท้จริงถูกส่งมาเป็นไฟล์แนบชื่อว่า noname ซึ่งไม่สามารถเปิดด้วย text editor ทั่วไปได้เพราะถูกเข้ารหัสเป็น base64 มาเห้อ root@mrgill-laptop:~/Desktop# cat noname Received: from BACKOFFICE (unknown [203.113.125.93]) by mail.totbb.com (Postfix) with ESMTP id F05323F9DE for ; Thu, 31 Mar 2011 19:37:58 +0700 (ICT) MIME-Version: 1.0 [...]]]></description>
			<content:encoded><![CDATA[<p>เรื่องมันมีอยู่ว่าผมใช้งาน TOTNetCall ครับ แล้วที่นี้ผมก็รอให้ระบบส่ง User กับ Password มาให้ รอแล้วรอเล่าก็ยังไม่มีอะไรส่งมาเลย มีแต่ mail welcome ส่งมาให้ซึ่งดูเหมือน Mailscan ของ TOT จะแจ้งว่ามันเป็น Spam ด้วย เลยทำให้เนื้อ mail ที่แท้จริงถูกส่งมาเป็นไฟล์แนบชื่อว่า noname ซึ่งไม่สามารถเปิดด้วย text editor ทั่วไปได้เพราะถูกเข้ารหัสเป็น base64 มาเห้อ</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~/Desktop# cat noname
Received: from BACKOFFICE (unknown [203.113.125.93])
	by mail.totbb.com (Postfix) with ESMTP id F05323F9DE
	for
<phmont@gmail.com>; Thu, 31 Mar 2011 19:37:58 +0700 (ICT)
MIME-Version: 1.0
From: TOTnetcall <totnetcall@tot.co.th>
To: phmont@gmail.com
Date: 31 Mar 2011 19:37:58 +0700
Subject: =?utf-8?B?4Lii4Li04LiZ4LiU4Li14LiV4LmJ4Lit4LiZ4Lij4Lix4Lia4Liq4Li54LmI4Lia4Lij4Li04LiB4Liy4LijIFRPVCBuZXRjYWxsIChXZWxjb21lIHRvIFRPVCBuZXRjYWxsIFNlcnZpY2Up?=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Message-Id: <20110331123758.F05323F9DE@mail.totbb.com>

PGJyPuC4ouC4tOC4meC4lOC4teC4leC5ieC4reC4meC4o+C4seC4muC4hOC4
uOC4kyAgTW9udHJlZSAgUGhvbWthbSDguYDguJvguYfguJnguKrguKHguLLg
uIrguLTguIEgVE9UIG5ldGNhbGw8L2JyPlVzZXJuYW1lIDogMDYwMDA0NzU5
NiAgUGFzc3dvcmQgOiBGR0MxWEM8YnI+4LmC4Lib4Lij4LmC4Lih4LiK4Lix
4LmI4LiZIDogUHJlcGFpZDwvYnI+PGJyPuC4q+C4oeC4suC4ouC5gOC4q+C4
leC4uCA6IFVzZXJuYW1lICDguITguLfguK0gVE9UIG5ldGNhbGwgSUQg4LiC
4Lit4LiH4LiE4Li44LiTPC9icj48YnI+PC9icj48YnI+V2VsY29tZSB0byBU
T1QgbmV0Y2FsbCBTZXJ2aWNlPC9icj48YnI+UHJvbW90aW9uOiBQcmVwYWlk
LCBVc2VybmFtZTogMDYwMDA0NzU5NiwgUGFzc3dvcmQ6IEZHQzFYQzwvYnI+
PGJyPioqKiBEb3dubG9hZCBTb2Z0cGhvbmUgIOC5hOC4lOC5ieC4l+C4teC5
iCAgaHR0cDovL3d3dy50b3RuZXRjYWxsLmNvbSA8L2JyPjxicj5UaGFuayB5
b3U8L2JyPg==</div>
</pre>
<p>ผม mail ไปหา support@totnetcall.net ระบบมันก็แจ้งว่าได้รับ Ticket แล้ว ณ วันนี้ยังไม่มี Support ของ totnetcall สักตัวโทรมาหาผมเลย (รักลูกค้าจริงๆ) ผมเลยต้องหาทางแก้ปัญหาของผมเอง ก็อาศัย google อีกเช่นเคยหา key word ที่เกี่ยวกับการ decode base64 ก็ได้เจอจาก blog guru ท่านนึงเค้าได้เขียนไว้ว่าให้ติดตั้ง mpack บน ubuntu ผมก็ลองทำดูโดย</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~# apt-get install mpack</div>
</pre>
<p>เมื่อติดตั้งแล้วก็จะมี tool ที่ชื่อว่า munpack มาด้วย วิธีการใช้งาน munpack นั้นแสนง่ายเพียงแค่ cat ไฟล์แนบที่ส่งมาแล้ว pipe ไปหา munpack เราก็จะได้ไฟล์ที่อยู่ในไฟล์แนบออกมา</p>
<p>ตัวอย่างที่ผมทำ</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~/Desktop# cat noname | munpack
munpack: reading from standard input
Did not find anything to unpack from standard input</div>
</pre>
<p>เนื่องจากไฟล์แนบที่ผมได้รับจาก mailscan ของ totnetcall ไม่มีไฟล์แนบอยู่ในนั้นเลยทำให้ไม่ได้ output ที่เป็นไฟล์แนบข้างใน แต่ munpack จะสร้างไฟล์ tempdesc.txt มาให้ซึ่งเป็นเนื้อข้อความที่อยู่ในไฟล์ noname ออกมาซึ่งก็คือ</p>
<p><a href="http://farm6.static.flickr.com/5304/5580616445_5b7a8c7a41_b.jpg" rel="lightbox[640]"><img class="aligncenter" src="http://farm6.static.flickr.com/5304/5580616445_5b7a8c7a41.jpg" alt="munpack tempdesc.txt output" /></a></p>
<p>จะเห็นว่าเมื่อผม cat tempdesc.txt ก็จะเห็นเนื้อข้อความใน mail ที่แท้จริง(ถูกถอดรหัสแล้วนั้นเอง)</p>
<p>สุดท้ายนี้ฝากผู้ดูแลของ TOTNetCall ช่วยดู Mailscan ของท่านด้วยครับ มันได้สร้างความลำบากให้กับลูกค้าอย่างผมเป็นอย่างมาก(เซ็ง TOT)</p>
<p>ใครอยากลองทำก็ลองโหลด <a href="http://imrgill.com/myfiles/noname">noname</a> ของผมไปเล่นดูก็ได้ครับ</p>
<p>ขอบคุณแหล่งข้อมูล : <a href="http://linux.dsplabs.com.au/munpack-mime-base64-multi-part-attachment-php-perl-decode-email-pdf-p82/">http://linux.dsplabs.com.au/munpack-mime-base64-multi-part-attachment-php-perl-decode-email-pdf-p82/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/04/02/how-to-decode-base64-mail-mime-attachment-with-munpack-on-ubuntu.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

