23 มกราคม 2564

SCB Easy App กู้เงิน กดเงินจากบัตรเครดิต และรับเงินผ่านทางตู้ ATM

SCB Easy App ของธนาคารไทยพาณิชย์นั้นอนุญาตให้เรากู้เงิน กดเงินจากบัตรและรับเงินมาใช้ได้ทันทีผ่านทางตู้ ATM ซึ่งค่อนข้างสะดวกและมีประโยชน์มาก ในกรณีที่เราต้องการเงินมาใช้ด่วน (แต่มีค่าดอกเบบี้ยที่ค่อนข้างแพงที่ 16% ต่อปี) ซึ่งวิธีการกดเงินจากบัตรเครดิตนั้นก็ทำได้ค่อนข้างง่าย


วิธีการกดเงินจากบัตรเครดิตผ่าน SCB Easy App

1. เข้า SCB Easy App แล้วเลือก Cardless ATM

2. เลือกบัตรเครดิตที่เราต้องการถอนเงิน และเลือกจำนวนเงินที่ต้องการ ดังรูป



3. รับเงินผ่านทางตู้ ATM

4. เมื่อถึงวันแจ้งยอดบัตรเครดิต ระบบจะแสดงค่ามูลจำนวนเงินที่เรากดและดอกเบี้ยที่เราต้องชำระให้ทราบ ดังรูป



01 มกราคม 2564

Getting start with Apache Spark, Python (PySpark) and MongoDB connector

 I am quite new with Apache Spark and researching how to get started with Apache Spark + Python (PySpark) + MongoDB connector. This is what I found.

1. Read the basic knowledge of Apache Spark and try to get started locally and code sample spark app with CSV file by following https://www.tutorialspoint.com/apache_spark/index.htm

2. If you use macOS, you can install spark by following https://notadatascientist.com/install-spark-on-macos/

3. More related tutorial and document


31 ธันวาคม 2563

สรุปการบริจาคเงินปี 2020

   


ดูสรุปการบริจาคเงินปีอื่นๆได้ที่ Link

ข้อมูลด้านล่างเป็นการสรุปการบริจาคเงินปี 2020

















13 ธันวาคม 2563

เทใจดอทคอม เว็บบริจาคเงินแนวใหม่ เสนอโครงการบริจาคและลดหย่อนภาษีได้

 เทใจดอทคอม (https://taejai.com/th/) คือเว็บไซต์บริจาคเงินที่มีความโปร่งใส่ สามารถตรวจสอบได้ น่าเชื่อถือ นอกจากนั้นทางเว็บยังเปิดโอกาสให้เราเสนอโครงการเพื่อสังคมต่างๆ เพื่อระดมเงินบริจาคได้อีกด้วย เช่น ถ้าใครอยากจะทำโครงการสร้างหรือปรับปรุงสวนสาธาณะเพื่อชาวบ้าน ก็สามารถเขียนโครงการเข้ามาระดมทุนได้ 

โดยทางเว็บจะหักเงิน 10% ของเงินบริจาคเพื่อเป็นการบำรุงรักษาระบบ ค่าทำธุรกรรมทางการเงิน และค่าติดตามตรวจสอบโครงการต่างๆ ให้ผู้ให้ทุกท่านมั่นใจว่าเงินบริจาคสนุนจะเกิดประโยชน์อย่างแท้จริง

นอกจากนั้น เงินที่เราบริจาคยังสามารถนำไปลดหย่อนภาษีได้อีกด้วย


หมวดหมู่ของการรับบริจาค



เป้าหมายและยอดบริจาคแต่ละโครงการ



เราสามารถส่งโครงการเพื่อสังคมมาระดมเงินบริจาคได้


ประวัติการบริจาค




ภาพรวมรายละเอียดการบริจาค




รายงานความคืบหน้าการใช้เงินบริจาค



หลังจากบริจาค เราจะได้รับใบเสร็จรับเงินทางอีเมล์











03 ธันวาคม 2563

Security test, penetration test (pen test) your API using OWASP Zed Attack Proxy (ZAP)

OWASP Zed Attack Proxy (ZAP) is an open-source tool for security testing, penetration testing (pen tests)  with many features like API scan, full web scan, baseline scan.

The example below will show steps to run API scan using the headless version (docker)

1. prepare your header configuration, e.g., authorization, access token by creating file "options.prop" with this content

replacer.full_list(0).description=access token

replacer.full_list(0).enabled=true

replacer.full_list(0).matchtype=REQ_HEADER

replacer.full_list(0).matchstr=access-token

replacer.full_list(0).regex=false

replacer.full_list(0).replacement=xxx

replacer.full_list(1).description=another header

replacer.full_list(1).enabled=true

replacer.full_list(1).matchtype=REQ_HEADER

replacer.full_list(1).matchstr=another-header

replacer.full_list(1).regex=false

replacer.full_list(1).replacement=yyy

The sample above assume that your APIs have these 2 headers

- key: access-token  value: xxx

- key: another-header value: yyy


2. run this command to start API scan

docker run -t --rm \
-v $(pwd):/zap/wrk/:rw owasp/zap2docker-weekly zap-api-scan.py \
-t api.yaml -f openapi -r report.html \
-z "-configfile /zap/wrk/options.prop" 

Note that

- api.yaml is your swagger file

- owasp/zap2docker-weekly is the docker image weekly build, you can change to stable or daily build version

- report.html is the reporting file after scanning success

You can file more details here.












23 พฤศจิกายน 2563

Investigate ObjectId (_id) of MongoDB

ObjectId (_id) of MongoDB is an auto-generated primary key by MongoDB. 


This field consists of 3 parts

1. a 4-byte timestamp value, representing the ObjectId’s creation, measured in seconds since the Unix epoch

2. a 5-byte random value

3. a 3-byte incrementing counter, initialized to a random value


e.g., 5fbb912a5eeb8beee934a5c4

1. timestamp value is 5fbb912a, we can get the creation time by using any computer language to perform basic calculation


2. random value is 5eeb8beee9


3. increasing counter value is 34a5c4

I tried to add more document and get these ObjectIds (_id) consecutively

5fbb91275eeb8beee934a5c0

5fbb91285eeb8beee934a5c1

5fbb91285eeb8beee934a5c2

5fbb91295eeb8beee934a5c3

You can see that the last part of each ObjectId (_id) is increment one by one.

Encrypt and decrypt data with Google Cloud KMS (Asymmetric)

Follow this tutorial if you want to use Google Managed Key on Google Cloud KMS.

But if you want to create your own key and upload it to Google Cloud KMS, please follow these steps

Generate key in der format

openssl genrsa -out key-pri.pem 3072

openssl pkcs8 -topk8 -nocrypt -inform PEM -outform DER \
-in key-pri.pem \
-out key-pri.der

openssl rsa -in key-pri.pem -pubout -out key-pub.pem


Upload key (.der file) to Google Cloud KMS

gcloud kms import-jobs create job \
--project ${PROJECT_ID} \
--location global \
--keyring ${KEY_RING} \
--import-method rsa-oaep-3072-sha1-aes-256 \
--protection-level software

gcloud kms keys versions import \
--project ${PROJECT_ID} \
--import-job job \
--location global \
--keyring ${KEY_RING} \
--key key \
--algorithm rsa-decrypt-oaep-3072-sha256 \
--target-key-file key.der

*you need to install crypto first


13 พฤศจิกายน 2563

SSL certificate server test online, SSL certificate server analysis online, View Server SSL certificate online

You can test your SSL certificate server online using a link to verify whether your server is secure enough or not and also view your SSL server information.