May 15
A byte-order mark (BOM) is the Unicode character at code point U+FEFF (“zero-width no-break space”) when that character is used to denote the endianness of a string of UCS/Unicode characters encoded in UTF-16 or UTF-32. It is conventionally used as a marker to indicate that text is encoded in UTF-8, UTF-16 or UTF-32.
ref: Wikipedia
ถ้าเปิดไฟล์ utf-8 ด้วย less จะพบว่ามี เป็นคำแรกในไฟล์ ซึ่งก็คือ Byte-order mark ซึ่งบางระบบอาจจะใช้งานไม่ได้ วิธีการเอาออกใน VI จะง่ายมาก หลังจากเปิดไฟล์ด้วย VI แล้วให้ใช้คำสั่ง
:set nobomb
แล้ว save ไฟล์ Byte-order mark ก็จะหายไปแล้วครับ
Tagged with: byte-order mark • vi
Apr 06
Make ISO image from CD/DVD is so easy in MacOS or Linux, Let’s go…
- Insert CD/DVD Disk
drutil status
-
Vendor Product Rev
HL-DT-ST DVDRW GWA4080MA BE39
Type: DVD-ROM Name: /dev/disk1
Sessions: 1 Tracks: 1
Overwritable: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Free: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Used: 776:36:36 blocks: 3494736 / 7.16GB / 6.67GiB
Writability:
Book Type: DVD-ROM (v1)
- unmount disk with
diskutil unmountDisk /dev/disk1
- Create ISO file with
dd if=/dev/disk1 of=file.iso bs=2048
- Wait until success then test your image file
Tagged with: dd • iso • leopard
Sep 18
If use basic setting in Header from https you will get HTTP/1.0 so it cannot redirect to right host.
It’s very easy to set with Nginx you can use
[code lang="bash"]
proxy_set_header X-FORWARDED_PROTO https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
[/code]
already use and sent you to correct host.
Tagged with: nginx
Jun 21
ใช้ mysqltuner แล้วพบว่า จำเป็นต้อง optimize tables แต่จะทำไงให้ optimize ได้ทุกตารางล่ะ
ใช้คำสั่งนี้ได้เลยครับ
[code lang='bash']mysqlcheck -Aao --auto-repair -u root -p[password][/code]
-a, –analyze [Analyze given tables]
-o, –optimize [Optimize table]
-A, –all-databases [Check all the database]
–auto-repair [If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found]
หรือ จะใช้
[code lang='bash']mysqlcheck -uroot -p -ro –all-databases [/code]
-r = Can fix almost anything except unique keys that are not unique.
ก็จะสำเร็จเสร็จเรียบร้อย ที่เหลือก็แล้วแต่ปรับแต่งนะครับ
Tagged with: mysql • optimize
Jun 18
เมื่อวันพฤหัสบดี 12 มิถุนายน 2551 มีงานเปิดตัวโครงการระดับประเทศงานหนึ่งครับ ผมเป็นคนหนึ่งในทีมผู้จัดทำ นั่นก็คือ โครงการระบบจดหมายอิเล็กทรอนิกส์กลางภาครัฐ โครงการใหญ่มากสำหรับผมในปีนี้ แถมยังได้รับเกียรติจาก ดร.ศักดิ์ เสกขุนทด ให้ร่วมเป็น speaker ในงานด้วย ตื่นเต้นมาก (ไม่เคยขึ้นพูดงานที่มีคนฟังเยอะขนาดนี้ ประมาณ 400 คน)
โครงการนี้ถือกำเนิดจาก มติ ครม.ที่ไม่อยากให้ข้าราชการใช้ free email ซึ่งอาจจะมีส่วนทำให้ความลับทางราชการรั่วไหลได้ จึงอยากให้ข้าราชการหลืกเลี่ยงการใช้งาน แล้วมาใช้ส่วนกลางแทน และผลประโยชน์ที่ได้อีกอย่างที่ผมเห็นว่าสำคัญมากคือ ราชการไม่จำเป็นต้องมีการลงทุนซ้ำซ้อนในส่วนของโครงสร้างระบบเมล์ แล้วหันมาใช้ส่วนกลาง ง่ายต่อการจัดการ
รายละเอียดผมคงไม่ต้องสาธยายมากครับ ไงลองไปอ่านตาม link ต่างๆ กันละกันครับ
ref :
ส่วนรูปทีมงานและรูปอื่นๆ ผมคัดเอามาบางส่วน ดูได้ที่
Tagged with: mail.go.th