My personal blog about health, hobby, stock & investment, information technology, self improvement, tax and travel.
19 พฤศจิกายน 2562
17 พฤศจิกายน 2562
upgrade mongodb in docker from 3.x to 4.x
If you have MongoDB 3.x running on docker and you want to upgrade to version 4.x, you cannot re-use the old data volume.
Please follow these steps to achieve upgrading MongoDB=
1. I will assume that you want to upgrade MongoDB from version 3.2 to 4.2
2. You need to incremental upgrade from 3.2 to 3.4, 3.6, 4.0 and then finally 4.2
3. run the following command to upgrade from version 3.2 o 3.4
docker run --name mongo -p 27017:27017 -v /volume:/data/db -d mongo:3.4
4. run the following command to set feature compatibility
docker exec -it mongo bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.4\" } )"'
5. repeat steps 3 and 4 three times
- upgrade from 3.4 to 3.6
- upgrade from 3.6 to 4.0
- upgrade from 4.0 to 4.2
6. verify the MongoDB version by running
docker exec -it mongo bash -c 'mongo --version'
credit: https://forums.rocket.chat/t/solved-trying-to-update-mongodb-from-3-2-to-4-0-in-docker-but-errors/3200
Please follow these steps to achieve upgrading MongoDB=
1. I will assume that you want to upgrade MongoDB from version 3.2 to 4.2
2. You need to incremental upgrade from 3.2 to 3.4, 3.6, 4.0 and then finally 4.2
3. run the following command to upgrade from version 3.2 o 3.4
docker run --name mongo -p 27017:27017 -v /volume:/data/db -d mongo:3.4
4. run the following command to set feature compatibility
docker exec -it mongo bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.4\" } )"'
5. repeat steps 3 and 4 three times
- upgrade from 3.4 to 3.6
- upgrade from 3.6 to 4.0
- upgrade from 4.0 to 4.2
6. verify the MongoDB version by running
docker exec -it mongo bash -c 'mongo --version'
credit: https://forums.rocket.chat/t/solved-trying-to-update-mongodb-from-3-2-to-4-0-in-docker-but-errors/3200
15 พฤศจิกายน 2562
ดูดอกซากุระ ที่ Forest Park (โซล เกาหลีใต้)
ช่วงเวลาที่ชมดอกซากุระ
ช่วงเวลาที่ดูดอกซากุระ ประมาณวันที่ 5-12 เมษายน
การเดินทาง
นั่งรถไฟฟ้า Line Cheongnyangni (สีเหลือง) มาลงที่สถานี Seoul Forest ประ ตู Forest Park
ช่วงเวลาที่ดูดอกซากุระ ประมาณวันที่ 5-12 เมษายน
การเดินทาง
นั่งรถไฟฟ้า Line Cheongnyangni (สีเหลือง) มาลงที่สถานี Seoul Forest ประ ตู Forest Park
ดูดอกซากุระ ที่ มหาวิทยาลัยคยองฮี Kyung Hee University (โซล เกาหลีใต้)
ช่วงเวลาที่ชมดอกซากุระ
ช่วงเวลาที่ดูดอกซากุระ ประมาณวันที่ 5-12 เมษายน
การเดินทาง
ช่วงเวลาที่ดูดอกซากุระ ประมาณวันที่ 5-12 เมษายน
การเดินทาง
- นั่งรถไฟฟ้า Line 1 (สีน้ำเงินเข้ม) มาลงที่สถานี Hoegi (123) ประ ตู 1
- ขึ้นรถบัสสีเขียว บริเวณประตู 1 นั่งตรงไปป้ายสุดท้าย รถบัสจะจอดข้างในมหาวิทยาลัยเลย
- ขากลับขึ้นรถบัสจากตรงที่ลง มาลงที่สถานี Hoegi (123)
Android / iOS Mobile Application ที่ต้องมีตอนไปเที่ยวเกาหลีใต้ (โซล, ปูซาน)
1. Google Translate
เอาไว้ใช้พูดคุยสนทนากับคนต่างชาติ หรือแปลข้อความตามป้ายต่างๆ หรือเมนูร้านอาหาร
2. Subway
เอาไว้ดูข้อมูลการเดินทางด้วยรถไฟฟ้า คำนวณระยะเวลาและค่าเดินทาง
ระบบจะแสดงข้อมูลให้เราเลือกว่าจะเอาแบบเร็วสุด หรือถูกสุด และแสดงข้อมูลเส้นทาง ระยะเวลา จำนวนสถานี และค่าเดินทาง ดังรูป
นอกจากนี้ เรายังสามารถเลือกภาษา และพื้นที่ต่างๆ เช่น โซล หรือปูซานได้ ดังรูป
3. Naver Map
เอาไว้ดูแผนที่การเดินทาง ซึ่งระบบจะแสดงแผนการเดินทางให้ทุกรูปแบบ ไม่ว่าจะเป็น เดินทางด้วยรถไฟฟ้า รถเมล์ หรือเดินเท้า (คล้ายๆ Google Map)
ตัวอย่างการค้นหาวิธีการเดินทาง
ตัวอย่างการเดินทางด้วยเท้า
ดูดอกซากุระ ที่ สวนสาธารณะยออีโด Yeouido Park (โซล เกาหลีใต้)
ช่วงเวลาที่ชมดอกซากุระ
ช่วงเวลาที่ดูดอกซากุระ ประมาณวันที่ 5-12 เมษายน
การเดินทาง
นั่งรถไฟฟ้า Line 5 หรือ Line 9 มาลงที่สถานี Yeouido (526 / 915) Exit 3
ช่วงเวลาที่ดูดอกซากุระ ประมาณวันที่ 5-12 เมษายน
การเดินทาง
นั่งรถไฟฟ้า Line 5 หรือ Line 9 มาลงที่สถานี Yeouido (526 / 915) Exit 3
17 ตุลาคม 2562
Install docker-ce and docker-compose on Linux Redhat 7 and Redhat 8
Install docker-ce on Linux Redhat 7 and Redhat 8
Install docker-compose on Linux Redhat 7 and Redhat 8
- Select rpm file that you want to install from https://download.docker.com/linux/centos/7/x86_64/stable/Packages/, e.g., I will install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.12.1.ce-1.el7.centos.x86_64.rpm
- Run the following command from your Linux Redhat to download rpm file => wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.12.1.ce-1.el7.centos.x86_64.rpm
- Run the following command to install docker from rpm file => yum install docker-ce-17.12.1.ce-1.el7.centos.x86_64.rpm
- Restart docker service by running => sudo systemctl restart docker
- Verify the status of docker service by running => sudo systemctl status docker
- Add the current user (e.g., user ec2-user to docker group by running => sudo usermod -aG docker ec2-user
- Verify docker command by running => docker --version
Install docker-compose on Linux Redhat 7 and Redhat 8
- Download and install docker-compose by running => sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
- Verify docker-compose command by running => docker-compose --version
17 สิงหาคม 2562
07 สิงหาคม 2562
npm vs yarn 2019 which javascript package manager is faster?
Test environment
Internet speed https://speedtest.trueinternet.co.th)
Sample package.json
Test yarn performance scenario
Test npm performance scenario
Result
- device: MacBook Air 2017
- node version: 12
- yarn version: 1.17.3
- npm version: 6.3.0
- test datetime: 7 Aug 2019 00:30 A.M. Bangkok time
Internet speed https://speedtest.trueinternet.co.th)
Sample package.json
{
"name": "demo-app-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"node-sass": "^4.12.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.1",
"react-scripts": "3.0.1"
}
}
Test yarn performance scenario
- remove node_modules
- remove yarn.lock
- measure yarn speed by running => start=$(date +'%s') && yarn && echo "It took $(($(date +'%s') - $start)) seconds"
Test npm performance scenario
- remove node_modules
- remove package-lock.json
- measure yarn speed by running => start=$(date +'%s') && npm i && echo "It took $(($(date +'%s') - $start)) seconds"
Result
| Package manager / Speed (seconds) | Round 1 | Round 2 | Round 3 |
|---|---|---|---|
| npm | 104 | 72 | 72 |
| yarn | 200 | 171 | 157 |
29 กรกฎาคม 2562
ตารางรถไฟชั้น 1 2 3 ไปกลับ หัวหิน กรุงเทพ
ตารางรถไฟจากกรุงเทพไปหัวหิน
ตารางรถไฟจากหัวหินไปกรุงเทพ
บรรยากาศสวยๆ บริเวณสถานีรถไฟหัวหิน
บรรยากาศชายหาดหัวหิน ซึ่งไม่ไกลจากสถานีรถไฟหัวหิน
คำถามที่พบบ่อย (FAQ)
Q: จองตั๋วรถไฟกรุงเทพ–หัวหินอย่างไร?
A: จองและซื้อตั๋วรถไฟออนไลน์ได้ที่ https://www.dticket.railway.co.th/DTicketPublicWeb/home/Home
Q: ชั้นไหนนั่งสบายสุด?
A: ชั้น 1 มีโบกี้ปรับอากาศ, ชั้น 2 พัดลม, ชั้น 3 รถนั่งเบาะไม้
Q: ใช้เวลานานเท่าไร?
A: ระยะเวลาเฉลี่ยประมาณ 4–5 ชั่วโมง ขึ้นกับประเภทรถ
Q: แผนที่สถานีรถไฟ
A: แผนที่สถานีรถไฟกรุงเทพอภิวัฒน์ https://maps.app.goo.gl/jRLYweNkBbDmR4gG8
แผนที่สถานีรถไฟหัวหิน https://maps.app.goo.gl/MrCrznRrDd6km1Bi9
สมัครสมาชิก:
บทความ (Atom)








































