วันจันทร์ที่ 29 มิถุนายน พ.ศ. 2552

Dell XPS M1330

เมื่ออาทิตย์ที่แล้ว Notebook Dell XPS ผมเจ๊ง หน้าจอแสดงเป็นแถบเส้น ๆ บางทีก็มืดไปเลย หลังจากหาข้อมูลในเน็ตอยู่นาน จึงทราบว่าเป็นปัญหาจาก Graphic Card โชคดีของผมที่ยังเหลือประกันอีก 1 เดือน แต่โชคร้ายคือ ผมอยู่ที่ฝรั่งเศส กว่าจะโทรไปเรียกช่างมาซ่อมได้ ผมเพิ่งทราบว่าผมจะต้องทำการ Transfer Services Tag จาก เมืองไทย ไปที่ฝรั่งเศสก่อน ซึ่งใช้เวลาประมาณ 1 สัปดาห์ หลังจากนั้นได้ Services Tag ใหม่แล้วจึงค่อยติดต่อไป

เฮ้อ... อุตส่าห์เลือก Dell ที่มีประกัน World Wide แล้ว แต่ต้องรอเปลี่ยน Service Tag อีก (โทรไปถามที่เมืองไทย ได้คำตอบว่า ถ้าซื้อ Dell ที่ประเทศอื่นแล้ว เข้ามาประเทศไทย ช่างจะไป Service ได้เลย แต่ที่นี่ต้องเปลี่ยน :( อดใช้ Notebook ไปหลายวันเลย )

ดังนั้น ใครที่ซื้อ Dell จากไทย และจะหิ้วมาใช้ที่ฝรั่งเศสนาน ๆ ผมแนะนำให้เปลี่ยน Service Tag ไว้ตั้งแต่เนิ่น ๆ จะได้ไม่ต้องรอซ่อมนะครับ

เปลี่ยนได้ที่ Link นี้ครับ =>
http://www.dell.com/content/topics/reftopic.aspx/pub/ccare/transfer_intl?c=us&cs=19&l=en&s=biz

ยังดี ที่ประกันยังไม่หมด

เบอร์โทรติดต่อ Dell ฝรั่งเศส: 08 25 38 71 29 (ไม่โทรฟรีด้วย)

วันพุธที่ 24 มิถุนายน พ.ศ. 2552

ความแตกต่าง that กับ which

That - "That" is used with restrictive phrases. Restrictive phrases are phrases that are essential to the sentence.

Which - "Which" is used with nonrestrictive phrases. Nonrestrictive phrases are phrases that states non essential information. A phase is nonrestrictive phase if the phase can be from the sentence.

Examples:

  • The shirt that you lent me is in my bag.
  • The shirt, which is red, is in my bag.
  • The house that I wanted to buy has been sold.
  • The house, which I didn't want to buy, has been sold.
  • The food store that I go to all the time is closed today.
  • The store, which is near my house, is not open today.
Ref: http://www.english-the-easy-way.com/Determiners/That_Which.htm

IPSec on Linux

How to use IPSec on Linux (in the same machine)

1. Create IPSec configuration file

root@vosges:/home/wwerapun/Desktop# cat ipsec.conf.esp.1
flush;
spdflush;
add 147.127.240.91 127.0.0.1 esp 2000 -E 3des-cbc "12341234abcdabcd12341234" -A hmac-sha1 "kamekamekamekamekame";
add 127.0.0.1 147.127.240.91 esp 2001 -E 3des-cbc "12341234abcdabcd12341234" -A hmac-sha1 "kamekamekamekamekame";
spdadd 147.127.240.91 127.0.0.1 any -P in ipsec esp/transport//require;
spdadd 127.0.0.1 147.127.240.91 any -P out ipsec esp/transport//require;

root@vosges:/home/wwerapun/Desktop# cat ipsec.conf.esp.2
flush;
spdflush;
add 147.127.240.91 127.0.0.1 esp 2000 -E 3des-cbc "12341234abcdabcd12341234" -A hmac-sha1 "kamekamekamekamekame";
add 127.0.0.1 147.127.240.91 esp 2001 -E 3des-cbc "12341234abcdabcd12341234" -A hmac-sha1 "kamekamekamekamekame";
spdadd 147.127.240.91 127.0.0.1 any -P out ipsec esp/transport//require;
spdadd 127.0.0.1 147.127.240.91 any -P in ipsec esp/transport//require;

--------------- Description ---------------------
flush = delete previous SAs
spdflush = delete previous SPD
add = add SA, SA is uni-directional, then you have to add 2 ways.
2000 = SPI (actually, it's any number, you have to specific in the same number from 2 machines)
spdadd = add SPD , any = encrypt any protocol,
notice that =>
"out" = packet out from 147.127.240.91 to 127.0.0.1
"in" = packet in (enter) from 147.127.240.91 to 127.0.0.1

2. Ask linux to use IPSec using setkey command:

root@vosges:/home/wwerapun/Desktop# setkey -f ipsec.conf.esp.1

root@vosges:/home/wwerapun/Desktop# setkey -f ipsec.conf.esp.2

3. Check the result:

root@vosges:/home/wwerapun/Desktop# setkey -D
127.0.0.1 147.127.240.91
esp mode=transport spi=2001(0x000007d1) reqid=0(0x00000000)
E: 3des-cbc 31323334 31323334 61626364 61626364 31323334 31323334
A: hmac-sha1 6b616d65 6b616d65 6b616d65 6b616d65 6b616d65

....

root@vosges:/home/wwerapun/Desktop# setkey -PD
127.0.0.1[any] 147.127.240.91[any] any
in ipsec
esp/transport//require
created: Jun 24 14:53:38 2009 lastused:
lifetime: 0(s) validtime: 0(s)


4. Test by using:

root@vosges:/home/wwerapun/Desktop# tcpdump src 147.127.240.91
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes


wwerapun@vosges:~$ ping -I eth0 127.0.0.1


The result should be =>

root@vosges:/home/wwerapun/Desktop# tcpdump src 147.127.240.91
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
15:46:01.811793 IP vosges.enseeiht.fr > localhost: ESP(spi=0x000007d0,seq=0xe), length 100
15:46:01.812070 IP vosges.enseeiht.fr.38577 > aquitaine.enseeiht.fr.domain: 27037+ PTR? 91.240.127.147.in-addr.arpa. (45)
15:46:01.813388 IP vosges.enseeiht.fr.60957 > aquitaine.enseeiht.fr.domain: 21218+ PTR? 123.80.127.147.in-addr.arpa. (45)
15:46:02.812633 IP vosges.enseeiht.fr > localhost: ESP(spi=0x000007d0,seq=0xf), length 100
15:46:03.823621 IP vosges.enseeiht.fr > localhost: ESP(spi=0x000007d0,seq=0x10), length 100
15:46:06.810131 arp reply vosges.enseeiht.fr is-at 00:22:19:12:0a:4b (oui Unknown)

...

IKE

There are 2 phases in IKE:

Phase 1: Create key that used in IPSec
- Diffie Hellman
- Pre shared key to encrypt session key
- Asymetric key

Phase 2: Use the key that previous created to encrypt SA for IPSec
- Note: SA is uni-directional, then it needs to create SA in 2 ways.

Diffie-Hellman Key Exchange

(a)^b^c = (a)^c^b = (a)^bc


A puts a session key in side the box, encrypt with Ka and sends to B

A ------------------ B

[]Ka ------------>
[] ---------------->

B gets the box, encrypts with Kb and sends to A

<------------[]Ka
<------------[]Kb

A gets the box, decrypts with Ka and sends to B

[] ------------->
[]Kb--------->

B gets the box, descrypts with Kb and get the session key.

----------------[]
----------------[]

วันจันทร์ที่ 22 มิถุนายน พ.ศ. 2552

Video Capture บน Unbuntu 8

ใช้ xvidcap ในการ configure
ถ้ากด run แล้วมัน segmentation fault ให้ลอง disable audio ออกไป

เวลาจะ capture หน้าจอคอมพิวเตอร์ ให้ใช้ อีกโปรแกรมช่วย
คือ # recordmydesktop /tmp/myComputer.mpeg
เวลาอัดเสร็จแล้ว ก็กด Control + C (กดครั้งเดียว แล้วมันจะ encoding video ให้)
ถ้าเผลอไปกด 2 ครั้ง ที่อัดมาก็หายไปเลย ระวังด้วยละ

Although / in spite of / despite

Although แปลว่า แม้ว่า ใช้เชื่อมประโยคที่ มีความหมายขัดแย้งกัน

ส่วนคำว่า In spite of มีความหมายเหมือนกับ Although ต่างกันที่ว่า In spite of ตามด้วย Noun ส่วน Although ตามด้วยประโยค

ตัวอย่าง
We went out although it was raining.

ส่วนคำว่า In spite of มีความหมายเหมือนกับ Although ต่างกันที่ว่า In spite of ตามด้วย Noun ส่วน Although ตามด้วยประโยค

ตัวอย่าง
In spite of
the rain, we enjoyed our holiday.


สุดท้าย Despite เหมือนกับ In spite of คือ ตามด้วย Noun แต่ต่างกันตรงที่ต้องมี of เข้ามาด้วย เขียนสั้นกว่า

ตัวอย่าง
She wasn't well, but despite this she went to work, (not 'despite of this')

คล้าย ๆ กับ Because / Because of นะแหละ
Because + ประโยค , Because of + คำนาม

Not only ... but also

การใช้ not only... but also นั้น มีความหมายว่า ไม่เพียงแต่.... แต่ยัง.... อีกด้วย

ซึ่งใช้สำหรับสร้าง คำนาม หรือ สรรพนาม ที่เชื่อมกัน (หรือถ้าเป็นประโยค ก็ต้องเป็นประโยค ทั้งคู่)
ซึ่งหลาย ๆ คนยังใช้ผิด กันอยู่ ลองดูตัวอย่างประกอบ

Wrong: He not only painted the "Annunciation" but also [painted] the "Mona Lisa."
Right: He painted not only the "Annunciation" but also the "Mona Lisa."

Wrong: He not only played for Washington but also for Detroit and Pittsburgh.
Right: He played not only for Washington but also for Detroit and Pittsburgh.

Wrong: He not only coached soccer but also tennis.
Right: He coached not only soccer but also tennis.

Right: He taught not only physics and chemistry but also algebra and geometry.

Right: He not only taught five periods a day but also coached three sports.

อย่าใช้ให้ผิดละ