Monday 9 September 2013

วิธีแก้ใข rsyslog เพื่อคัดแยก DHCPACK log ให้จัดเก็บใน file เฉพาะ


  1. เปิด Configuration File ด้วย #vim  /etc/rsyslog.conf
  2. เพิ่ม Code ด้านล้างใน Configuration File
if $syslogfacility-text == 'local7' and $msg contains 'DHCPACK' and $msg contains 'on'  then  /var/log/dhcpack

Thursday 11 July 2013

Netdot Installation

  1. Install dependencies packet
    • sudo apt-get install rrdtool mysql-client mysq-server
  2. Install Netdot
    • make install

Friday 28 June 2013

ทำยังไงไม่ให้ MacBook หลับตอนพับจอ

มีโปรแกรมตัวนึงบน Google Code ที่ทำให้เราสามารถกำหนดได้่ว่าจะให้ MacBook ไม่หลับตอนพับจอ โดยแยกได้สองกรณีคือ เวลาเสียบอแดปเตอร์แล้วพับจอ กับเวลาไม่เสียบอแดปเตอร์แล้วพับจอ (หมายเหตุ blogนี้บันไว้เพื่ออ่านเองนะครับ)

Sunday 23 June 2013

การติดตั้ง Bird Internet Routing Daemon

Bird เป็น Routing Daemon ที่ทำงานบน Linux (CentOS)

การติดตั้ง Bird ทำได้โดยการ Compile และ Install จาก Source Code

  1. Install readline Library
  2. Install Bird
    1. ./configure
    2. make
    3. make install

การใช้งาน Bird Daemon
  1. การใช้งาน Bird Daemon 
    • เริ่มทำงานโดยพิมพ์ "sudo bird" โดยปกติ Bird Daemon จะใช้ Configuration ที่ path: /usr/local/etc/bird.conf
    • ในกรณีต้องการ Debug สามารถทำได้โดยผ่าน birdc (ต้องเริ่มการทำงานของ bird ก่อน)

Friday 21 June 2013

การสร้าง Sub Interface บน Linux (CentOS)

How to create Sub Interface

1. Install vlan packet
ubuntu# apt-get install vlan

2. Create Sub-Interface
# /sbin/vconfig add [interface] [vlan_id]
ex. /sbin/vconfig add eth0 100

3.  on Interface
# ifconfig eth0.100 up
_________________________
การสร้าง sub-interface (vlan tag บน physical interface) บน Linux สามารถทำได้โดยใช้คำสั่ง /sbin/vconfig สำหรับทำให้เครื่องรู้จักกับ vlan ที่ต้องการ

ตัวอย่างการเพิ่ม sub-interface
/sbin/vconfig add eth0 vlan 100
/sbin/ifconfig eth0.100 up

ตัวอย่างการลง sub-interface
/sbin/vconfig rem eth0.100

ต่อ WiFi ให้ Raspberry Pi

สามารถเพิ่มการเชื่อมต่อให้กับ Raspberry Pi โดยใช้ Edup Mini Wireless USB จาก Ebay ด้วยราคาไม่เกิน 150 บาท

หลังจากเชื่อมต่อ Wireless USB เข้ากับ Raspberry Pi แล้ว เข้าไปแก้ไข Network Interface File โดยใช้คำสั่ง

sudo vim /etc/network/interfaces

แก้ใข้โดยเพื่มคำสั่งดังนี้

#auto connect
allow-hotplug wlan0
auto wlan0

# Auto Assign IP Address
iface wlan0 inet dhcp

# Manuel Assign IP Address
iface wlan0 inet manual
gateway 192.168.0.1
address 192.168.0.100
netmask 255.255.255.0

#WPA Connect 
wpa-ssid "ssid" 
wpa-psk "password"

OpenVPN on Mobile

VPN (Virtual Private Network) บริการเครือข่ายส่วนตัวเสมือนสำหรับเชื่อมต่อเพื่อใช้เครื่อข่ายภายใน เพื่อให้ผู้ใช้สามารถใช้บริการภายเครือข่ายภายในเสมือนกำลังเชื่อมต่ออยู่กับเครื่อข่ายภายใน โดย OpenVPN เป็น Open Source VPN ตัวหนึ่งที่ได้รับความนิยมในปัจจุบัน

OpenVPN สามารถใช้งานบนอุปกรณ์พกพาระบบปฏิบัติการ iOS และ Android โดยไม่จำเป็นต้อง Root หรือ Jail break อุปกรณ์ ผู้ต้องการใช้งานสามารถติดตั้งแอพพลิเคชัน OpenVPN Connect ได้ทั้งบน Play Store และ AppStore อย่างไรก็ตามการใช้งาน OpenVPN Connect ยังมีข้อจำกัดที่ว่า OpenVPN Server ต้องทำงานแบบในระดับ Network Layer (TUN Mode) เท่าน้น

การใช้งานบน Android 
  1. ติดตั้ง OpenVPN Connect
  2. เริ่มติดตั้ง Configuration File โดยคัดลอกไฟล์ลงบนอุปกรณ์ 
  3. จากนั้น Import Configuration File ผ่าน Menu ใน OpenVPN Connect 
  4. เชื่อมต่กับ VPN Server
การใช้งานบน iPhone
  1. ติดตั้ง OpenVPN Connect
  2. การคัดลอก Configuration File (sample.ovpn) ลงโปรแกรม OpenVPN Conect ผ่าน iTunes 
  3. จากนั้นเปิดแอพพลิเคชัน OpenVPN Connect บนอุปกรณ์เพื่อยืนยันการเพิ่ม Configuration File 
  4. เชื่อมต่อกับ VPN Server ได้

Import SSH Private Key to Yubikey (PIV) for SSH Authentication

Introduction: This guide will walk you through the process of importing your SSH private key to a Yubikey (PIV) for SSH authentication on y...