Tag Archives: admin

DNS Flag Day

Background
0. อินเทอร์เน็ตอาศัยเลข IP address ในการระบุที่อยู่ของ devices ที่เชื่อมต่อกัน แต่มนุษย์จำเลข IP address พวกนี้ไม่ได้หรอก จึงเกิด Domain Name System (DNS) เพื่อให้เราใช้ชื่อเครื่อง (hostname) ที่จำได้ง่ายกว่า แทน IP address ได้ โดย DNS จะไปหา (resolve) มาให้ว่า hostname นี้ใช้ IP address อะไร

1. บริการของ DNS ทำผ่าน name servers ซึ่งมีกระจายทั่วโลก คอมพิวเตอร์ที่ต่ออินเทอร์เน็ตเกือบทั้งหมดจะได้รับการกำหนดค่า name server(s) เสมอเพื่อจะได้ถามหา IP address ของ hostname ที่ผู้ใช้จะเชื่อมต่อได้ถูก

Problems
2. มันควรเป็นปกติสุข จนระบบ DNS มีความซับซ้อนมากขึ้นเรื่อย ๆ (ตอนนี้ RFC เกี่ยวกับ DNS เป็นร้อยฉบับแล้ว) มีฟีเจอร์ใหม่เพิ่มขึ้นเรื่อย ๆ name server บางตัวก็ใช้ software ที่ทำงานได้ไม่ครบ บางตัวก็เหมือนจะครบแต่ไม่ compliance ทั้งหมด

3. เพื่อให้ทำงานได้ปกติสุข มี dev ของ software / providers ยอมทำ workaround เพื่อให้ทำงานกับ software ที่ไม่ comply ตามมาตรฐาน .. มันก็ทำงานได้ user ก็ happy แต่มันทำให้ resolve ช้ากว่าที่ควรจะเป็น และพัฒนา software ไปข้างหน้ายากขึ้นเรื่อย ๆ

4. workaround ไม่ได้เกิดครั้งสองครั้งแต่มันทับถมมาเรื่อย ๆ เป็น case by case จนถึงจุดที่แบกต่อไม่ไหว เลยตกลงว่า วันที่ 1 กุมภาพันธ์ 2562 software / providers ที่ทำ workaround ไว้ จะเอา workaround ออกหมด ใครยังไม่ comply ก็จะโดนเท เรียกว่า DNS Flag Day

DNS Flag Day
5. วันที่ 1 กุมภาพันธ์ 2562 เป็นต้นไป ถ้า hostname ของ domain ไหนไปอยู่กับ name servers ที่ไม่ comply ตาม EDNS จะมีผลกระทบถึงขั้น resolve จาก hostname เป็น IP address ไม่ได้ เสมือนกับว่า hostname นั้นหรือ domain นั้นไม่มีอยู่บนโลกนี้ เรียกง่าย ๆ ว่าเหมือนถูกตัดขาดจากอินเทอร์เน็ต

6. ผู้ดูแลระบบ DNS/name servers จำนวนหนึ่งทราบเรื่องนี้มากันตั้งแต่ปีที่แล้ว และพยายามแจ้งข่าวกันเรื่อย ๆ เพื่อช่วยกันตรวจสอบและแก้ไข name servers ในการดูแลของตัวเองให้ระบบ comply กับ EDNS ก่อนวันที่ 1 กุมภาพันธ์ 2562

7. ตรวจสอบ EDNS compliance ได้ที่ https://ednscomp.isc.org/ednscomp ถ้า All OK ก็รอด

Google Drive: Transfer Ownership using Team Drive

Google Drive does have a feature to transfer ownership from one user to another within the same domain. This is mainly for the case that a user leave a company, and his/her account is terminated.

However, Google does not allow to transfer ownership across the domain. People keep asking for this feature for many years, and there are workarounds – use drive sync, or use 3rd -party apps.

But, there is a by-product workaround (or solution) for this — Team Drives.

Just create a Team Drive (e.g., “transfer”), add a source account and a destination account as members, then you can move files and folders between the two accounts using the team drive.

Technically, when you move files/folders from My Drive to a Team Drive, Ownership of those files/folders will be changed from the source to the Team Drive. And, when you move files/folders from a Team Drive to My Drive, Google will change ownership from the Team Drive to the destination account.

For files, you can move from/to a Team Drive freely. But, for folders, you need your GSuite admin to set “Move any files and folder to Team Drive” privilege for you.

Note: the moving process from/to a Team Drive is NOT instantaneous – it takes time. So, if you move a large number of files and folders to/from a Team Drive at once, you should WAIT.

Upgrading Graylog from 2.2 to 2.3

Well, my installation is based on the official deb package.  However, you cannot automatically upgrade from 2.2 to 2.3. I think this is because graylog might change things overtime and they don’t want to break things without administrator’s supervision.

So you need to download and dpkg -i to install it manually.

You should also check upgrading to 2.3.x docs where they describe changes that may impact your configuration.

For my case, I decide to upgrade and replace my existing graylog.conf with the maintainer’s configuration. Then, copy password hashes from the existing one to the new one.

It runs smoothly though.

Google Cloud Platform Free Tier

Google recently provide the free tier on their Google Cloud Platform (GCP). The free tier will be free forever (but what Google offered are subjected to changes).

Also included in the free tier is $300 credit for 12 months (I think this was 2 months – good !)

I applied, created Google Compute Engine (GCE) f1-micro instance, ran the same benchmarks as I did on Vultr, DO, and Scaleway.

The best results I got from the instance:

dd write bs=4k count=10k  100k  1M
                    1500  39.6  37.5 MB/s
dd read bs=4k 
63.1 MB/s
sysbench --test=cpu --cpu-max-prime=10000 run
11.7567 sec.
stress-ng --cpu 1 --cpu-method all -t 30 
156.75 ops/sec
BUT …

The results were not consistent.  I ran the dd write 5 more times, the results varied from 211 MB/s to 1.5 GB/s. sysbench results varied from 11 to 13 sec. stress-ng varied between 50 – 150 ops/sec.

I think this is because almost all the resources for free tier (CPU, disk, network) are shared among others.

It’s free, though.

Vultr’s $2.5 / month server instance

Vultr has recently upgrade all instances . While $5/month has been upgraded from 1 CPU / 768 MB / 15 GB  to 1 CPU / 1 GB / 25 GB, Vultr also introduced the new smallest server instance – 1 CPU / 512 MB / 20 GB at $2.5/month.

So, I have choices:  keep paying $5/month and get an upgraded instance for free, or migrate to the $2.5/month to cut cost in half.

I chose the latter.

Unfortunately, Vultr does not allow to downgrade the instance (because disks can only be enlarged). So, I needed to migrate the server. I created a snapshot from the existing 15 GB disk, and deployed an $2.5/month instance from the snapshot. It took me about 10 minutes to create the snapshot (free), and few more minutes to deploy new instance. Then, I updated DNS record.

Things went well. So, finally, I destroyed the $5/month instance.

The result ?  You are seeing it right now. This web is running on single $2.5/month instance :D

เรามาเป็นแอดมินได้ไง

tl;dr ไม่รู้เหมือนกัน 55+

ปี 3 วิชา Computer Networks สอน TCP/IP (อ.ยืน อ.เขมทัต อ.ปรีดา ม.เกษตร) ประกอบกับที่ภาคคอมคณะไรสักอย่างได้รับเครื่อง SUN SPARCStation 5 มาจากมูลนิธิ Hitachi เครื่องนี้ต่ออินเทอร์เน็ตผ่าน MODEM + leased line ไปที่ศูนย์คอมพิวเตอร์ ผมกับเพื่อนไม่กี่คนมี account บนเครื่องนี้ telnet จาก PC ไปหัดใช้คำสั่ง UNIX ใช้อินเทอร์เน็ตได้ (pine, talk, gopher, inn, irc (#thai #siam …)) .. ตอนนั้นเป็นของใหม่ ของแพง(มาก) มีโอกาสได้ใช้ก็ตื่นตาตื่นใจ

ปี 4 เพื่อนคนนึงทำโปรเจคเกี่ยวกับอินเทอร์เน็ต ขอเครื่อง 486 มาลง BSD ได้แผ่นติดตั้ง 3.5 นิ้วมาจากอาจารย์ฝรั่งที่มาบวชที่ขอนแก่น อ.ฝรั่งท่านนี้เก่ง ใจดี ให้คำแนะนำเรื่อง UNIX เยอะแยะ (อาชีพเพิ่นจริงๆ คือออกแบบวงจรเครื่องเสียง – มีชื่อเสียงด้วยนะ) หลังจากได้แผ่น BSD มาหลายกล่องได้ไม่นาน มันกลายเป็นแผ่นติดตั้ง Slackware Linux แทน 555+ .. Slackware ตอนนั้นใช้ แผ่น 3.5 นิ้ว 1.44 MB จำนวน ~ 30 แผ่น ดาวน์โหลดผ่านอินเทอร์เน็ตได้วันละ 1 แผ่น เดือนต่อมาถึงได้ติดตั้งลงเครื่องเป็น linux kernel 1.0.x ต่ออินเทอร์เน็ตผ่าน MODEM อยู่ห้องโปรเจคภาคฯ ไปศูนย์คอมพิวเตอร์ เครื่องนี้เป็น linux 1 ใน 2 เครื่องแรกของ มข. (อีกเครื่องเป็นของอาจารย์ อยู่ภาคชีวเคมี เกิดในเวลาใกล้ๆ กัน) และตั้งชื่อว่า gear.kku.ac.th

ช่วงนี้ผมกับเพื่อนเริ่มเดินเข้า/ออกศูนย์คอมพิวเตอร์หาพี่พงษ์บ่อยๆ จนมี account บน kku1.kku.ac.th (SUN) และอีกหลายเครื่อง (SUN) ช่วยเพื่อนติดตั้ง/admin ftp.kku.ac.th / malakor.kku.ac.th พ่วง MODEM ทำ slirp/tia ให้คอมพิวเตอร์ที่บ้านรัน Windows 3.1 + Trumpet Winsock ต่อใช้อินเทอร์เน็ตได้โดยหมุน MODEM มาที่ศูนย์คอมฯ

ต้องระลึกชาติกันว่า ปี 2537 นี่เพิ่งจะมีอินเทอร์เน็ตในประเทศได้ไม่กี่ปี / ThaiSARN เพิ่งเกิดไม่นาน / ISP ในประเทศไทยยังไม่มีบริการตามบ้าน / มข. ต่ออินเทอร์เน็ตแถวๆ 9.6 – 19.2 – 64 kbps / Trumpet Winsock ตอนนั้นเกือบทั้งหมดใช้กับ Ethernet / MODEM มีไว้ต่อ terminal หรือ BBS .. หมุน MODEM ต่ออินเทอร์เน็ตเปิด Mosaic/Netscape เข้าเว็บจากเครื่องที่บ้านได้นี่โคตร breakthrough .. คิดเข้าข้างตัวเองว่า เวลานั้นเป็นคนแรกใน มข. ที่ทำได้ 555+

พอมีทักษะโปรแกรม + UNIX + network + security ทำเอามันบ่อยๆ สันดาน hacking/troubleshooting ใน domain นี้ก็สะสมมาเรื่อย
จบ ป.ตรี บรรจุเป็นอาจารย์ (ใช้หนี้ทุน) ดูแลเครื่อง gear.kku.ac.th ต่อจากเพื่อน กลายเป็นเครื่องแม่ข่ายอินเทอร์เน็ตหลักของภาคคอมแทน SUN + ติดตั้งเครื่องเพิ่มอีกหลายเครื่องที่เป็น linux ให้ นศ. ใช้ เป็นช่วงนี้ web กำลังนิยม ก็หัดทำเว็บเขียนเว็บ Netscape กำลังได้รับความนิยม ก็ดูดมาพักไว้ที่ มข. เป็น Netscape Official Mirror Site แห่งแรกในประเทศไทย ประกอบกับที่ภาคคอมฯ เป็นชุมสาย campus network ของคณะไรสักอย่าง สอนวิชา networks ด้วย มีโอกาสได้ดูแลระบบเครือข่ายไปด้วย

ช่วงเรียนต่อ มีโอกาสดูแลระบบของ lab ได้อานิสงส์จากบารมีของอาจารย์ที่ปรึกษา (ที่เพิ่งจะได้รางวัล Jonathan B. Postel Service Award ของปีนี้) ได้พบบุคคลในตำนานอินเทอร์เน็ตโลกอีกหลายคน มีโอกาสไป workshop เป็นลูกมือจัด workshop พบ sysadmin เก่งๆ geekๆ nerdๆ หลายคน

.. และบางคนก็กวนตีน เช่น sysadmin ชาวญี่ปุ่น เป็นคนดูระบบเมลของ ISP ใหญ่ที่สุดแห่งนึงในญี่ปุ่น อยากได้อะไรมันเขียน sendmail.cf from scratch ได้หมด (ย้ำว่า .cf – human-unreadable config – from scratch) อยู่มาวันหนึ่งมันบอกว่า “กูย้ายไปใช้ postfix หมดแล้วนะ ชีวิตดี๊ดี มึงจะตามมาไหม ?” เอ้า! บักนี่ ! 55+

งานตอนนี้ ใช้ทุกอย่างที่สะสมมาตั้งแต่บรรทัดแรก (^^’)

€2.99/mo. Scaleway VC1S

Same tools, same OS as $5/month: DigitalOcean vs Vultr

dd write bs=4k count=10k  100k  1M
                     403   398  184 MB/s
dd read bs=4k 
2.0 GB/s
sysbench --test=cpu --cpu-max-prime=10000 run
17.9875 sec.
stress-ng --cpu 1 --cpu-method all -t 30
94.22 ops/sec

The disk performance is comparable to those of DO/Vultr. But, even equipped with 2 x 64-bit x86 processor, CPU performance is lower than single core on $5/mo. VPS of DO/Vultr.

Since I use them as a web server, so I run ab -n500 -c500 requesting phpinfo() ..

phpinfo() 
Vultr:    2102.08 req./sec
Scaleway: 1543.10 req./sec

YMMV.

$5/month: DigitalOcean vs Vultr

Tools: dd, sysbench, stress-ng. I know,  you’d say they are NOT benchmark tools. I don’t care, I just need quick tests.

Here we go:

dd write bs=4k count=10k   100k  1M
do:                  350   465   424 MB/s
vultr:               699   538   466 MB/s
dd read bs=4k
do:    475 MB/s
vultr: 2.7 GB/s
sysbench --test=cpu --cpu-max-prime=10000 run
do:    14.2562 sec.
vultr: 13.7561 sec.
stress-ng --cpu 1 --cpu-method all -t 30
do:    154.15 ops/sec
vultr: 186.38 ops/sec

/me .. goes vultr.