/images/avatar.webp

How to Adjust Monitor Brightness on Ubuntu

Controlling your monitor’s brightness on Ubuntu can help reduce eye strain and save battery life. This guide will show you how to check and change your monitor’s brightness using both built-in system files and the brightnessctl tool.

Checking Current Brightness

To see your current monitor brightness value, run:

cat /sys/class/backlight/*/brightness

This command outputs a number representing the current brightness level. To find out the maximum possible brightness, use:

cat /sys/class/backlight/*/max_brightness

You can calculate the current brightness as a percentage with:

How to Use Case-Insensitive Tab Completion in Bash

For many Linux developers, the Bash terminal is an essential tool. One way to boost productivity is to make tab completion case-insensitive, so you don’t have to match uppercase and lowercase letters exactly when completing file or command names.

Step-by-Step Guide

  1. Create or edit the .inputrc file in your home directory:

    nano ~/.inputrc
    
  2. Add the following lines to enable case-insensitive completion:

    $include /etc/inputrc   # Include the system's default inputrc settings
    set completion-ignore-case On  # Enable case-insensitive tab completion
    
  3. Save the file and restart your terminal.

บทที่ 2: การค้นหาข้อความแบบ Full-Text Search บน Milvus Sparse Vector สำหรับข้อมูลร้านอาหาร

ในบทความนี้ (ตอนที่ 2 ของซีรีส์ Milvus Vector Database) จะอธิบายวิธีการใช้งาน Full-Text Search เพื่อค้นหาร้านอาหารจากข้อความที่ผู้ใช้ป้อน โดยเน้นการเลือก tokenizer ที่เหมาะสมกับภาษาไทย

ความสำคัญของ Text Analyzer และ Tokenizer ใน Milvus1

ก่อนใช้งาน Full-Text Search ใน Milvus ต้องเข้าใจว่า Milvus ใช้ text analyzer เพื่อแปลงข้อความให้อยู่ในรูปแบบที่เหมาะสมกับการค้นหา (extract, enrich, analyze, index) โดยมีตัวเลือก tokenizer หลัก ๆ คือ standard และ whitespace ซึ่งแต่ละแบบเหมาะกับภาษาแตกต่างกัน

เริ่มต้นด้วยการตัดคำที่นิยมสำหรับภาษาไทยนั้นก็คือ pyThaiNLP2 ซึ่งเป็นหนึ่งในตัวเลือกที่ดีที่สุดสำหรับภาษาไทยในปัจจุบัน

ตัวอย่างการตัดคำภาษาไทยด้วย pyThaiNLP
from pythainlp.tokenize import word_tokenize
word_tokenize('ไข่หวานบ้านซูชิ สาขาประชาอุทิศ', engine="newmm")

ผลลัพธ์:

['ไข่หวาน', 'บ้าน', 'ซูชิ', ' ', 'สาขา', 'ประชา', 'อุทิศ']

เปรียบเทียบ Standard Tokenizer กับ Whitespace Tokenizer13

  • Standard Tokenizer: เหมาะกับภาษาอังกฤษและภาษายุโรป แต่กับภาษาไทยอาจตัดคำผิด เช่น ไข่หวานบ้านซูชิ สาขาประชาอุทิศ ได้ หวานบ และ านซูชิ แทน บ้าน และ ซูชิ
  • Whitespace Tokenizer: เหมาะกับภาษาไทยเมื่อใช้ร่วมกับ pyThaiNLP เพื่อแยกคำด้วย whitespace
ตัวอย่างการใช้ Standard Tokenizer ใน Milvus
analyzer_params = {"tokenizer": "standard"}
result = client.run_analyzer("ไข่หวานบ้านซูชิ สาขาประชาอุทิศ", analyzer_params)
print("analyzer output:", result)

ผลลัพธ์:

สร้างฐานข้อมูลเวกเตอร์ (Vector Database) ด้วย Milvus สำหรับข้อมูลร้านอาหาร - บทที่ 1

บทความนี้เป็นแนวทางสำหรับทดลองใช้งาน Milvus1 ซึ่งเป็นระบบ Vector Database แบบ Open Source (Apache License 2.0)2 ในบริบทของการแนะนำและค้นหาร้านอาหาร โดยใช้เทคนิคอย่างเช่น dense vector จาก Sentence Transformer

Using Ansible to Reset MikroTik and Apply Custom Bootstrap Script

🎯 Objective

This blog post shows you how to use Ansible to reset a MikroTik router to its factory settings and automatically apply a custom bootstrap configuration.

You’ll learn how to automate the process using Ansible and a .rsc script file for configuration, allowing you to easily customize and extend your MikroTik setup.

📝 Introduction

When working on a new MikroTik project, it’s often helpful to start from a clean configuration. Rather than manually resetting and reconfiguring the device, this guide walks you through an automated Ansible playbook that:

แปลงข้อมูล OpenStreetMap เป็น GeoJSON พร้อมเลือกเฉพาะพื้นที่ที่ต้องการ

บทความนี้จะสอนวิธีแปลงไฟล์ข้อมูลจาก OpenStreetMap (OSM) ให้อยู่ในรูปแบบ GeoJSON พร้อมทั้งเลือกเฉพาะบริเวณที่สนใจ เช่น จังหวัด หรือพื้นที่เฉพาะ ด้วยเครื่องมือ ogr2ogr 1 จาก GDAL 2