linux

How to use VMware shared folder from Linux host by Windows XP guest

ต่อเนื่องจาก http://www.semicolon.in.th/article-virtualbox-share-folder ซึ่งเป็นวิธีการใช้ shared folder ด้วย VirtualBox
คราวนี้ถึงทีของ vmware บ้าง

วิธีการใช้งานก็คล้าย ๆ กัน
1. เข้าไปที่หน้าต่างสำหรับแก้ไข Virtual Machine Settings เลือก Tab Options > Shared Folders

Rsync: ตัวช่วย upload source code

เรื่องมีอยู่ว่าผมอยากหาวิธีที่จะ upload source code จากเครื่องผมไปยัง server โดยไม่จำเป็นต้อง copy ทั้งหมดไปทับ
เนื่องจากมันเปลืองเวลา ยิ่งถ้าไม่ได้อยู่ที่มี Internet แรง ๆ แล้วหล่ะก็ เหนื่อย แน่ ๆ

คำตอบก็ลงตัวที่ rsync ครับ ซึ่งผมสามารถทำได้ดังนี้

rsync -av /myproject/projecta/ myusername@semicolon.in.th:/wwwroot/projecta/

เกือบตายเพราะ Windows XP จอมจุ้น

เรื่องมีอยู่ว่าเมื่อวานผมบูทเข้า Windows XP เพื่อเข้าไปลงและเล่นเกม Warcraft III : Reign of Chaos และ Frozen Throne

แต่เนื่องจาก partition ของ Windows มันเหลืออยู่แค่ 5GB จากทั้งหมด 30GB (ที่มันเหลือแค่นี้เพราะโดน World of Warcraft กินไป 17GB *O*)
จึงตัดสินใจเลือกใช้ partition ที่เตรียมไว้ลง MacOSX86 มาใช้เป็นที่เก็บ Warcraft III แทน เพราะคงไม่ได้ลงเจ้า Mac ที่ว่าแล้วเนื่องจากขี้เกียจทะเลาะกับ driver

Partition Layout ของ harddisk ผมเป็นดังนี้ครับ

How to use VirtualBox share folder from Linux host by Windows XP guest

วิธีการใช้งาน Shared Folder ใน VirtualBox ที่ใช้ Linux เป็น Host แชร์ข้อมูลไปที่ Guest Windows XP
1. ตั้ง Shared Folders ใน VirtualBox console สมมติเราต้องการ share /data
ให้กดปุ่ม Add Share ใส่ข้อมูล Folder Path เป็น /data และ Folder Name เป็นชื่อ share เช่น datadir
2. เปิด Windows XP guest
3. ใน Windows XP guest จะสามารถเข้าถึง share folder ของเราได้ผ่าน path \\vboxsvr\datadir
4. ถ้าต้องการ map drive ก็สามารถทำได้โดยคำสั่ง

net use z: \\vboxsvr\datadir

How to set ThinkPad's TrackPoint sensitivity in Linux (raw command)

echo 10 to 250 value into device configuration file

Super Heavy
echo 10 > /sys/devices/platform/i8042/serio1/serio2/sensitivity

Heavy
echo 100 > /sys/devices/platform/i8042/serio1/serio2/sensitivity

Super Light
echo 250 > /sys/devices/platform/i8042/serio1/serio2/sensitivity

My new life on Ubuntu 9.04 - Jaunty Jackalope

หลังจากลาก Fedora 9 มานาน ก็ได้ฤกษ์ลง OS ใหม่เสียที เนื่องจากความซนของผมเองแหล่ะ
ที่ทำให้ X มันรวน ๆ จนใช้ต่อไม่ไหว T T

ตอนแรกก็กะว่าจะใช้ Fedora 10 หรือ 11 แต่เห็นมีกลุ่มผู้ใช้งาน Ubuntu ในไทย
ค่อนข้างเยอะ กอปรกับ Ubuntu เพิ่งจะออก version ใหม่ (เฮ้ย... เค้าออกนานแล้วมั้ง
แต่ไม่รู้เรื่องกะเค้าเอง แป่ว!) จึงคิดว่า "เออ... ก็น่าลองดูนะ"

และแล้วเจ้า Jaunty Jackalope ก็มาอยู่ในเครื่องคอมพิวเตอร์ที่ทำงานของผมจนได้

แว้บแรกที่ได้ใช้งานผมรู้สึกว่า "Ubuntu ช่างตั้งใจทำเพื่อให้เป็น Linux desktop จริง ๆ"
ทั้งความสวยงามและความสะดวกในการใช้งาน

ตอนที่ผมใช้ Fedora 9 อยู่นั้น

Linux: How to play with optical drives (CD/DVD) and their images (iso files)

How to create ISO image file from CD/DVD

dd if=/dev/cdrom of=/name_of_iso_file.iso

How to mount ISO image

mount -o loop /name_of_iso_file.iso /target_directory

Resources
http://www.wikihow.com/Create-an-ISO-File-in-Linux

Heartbeat: Heart of High-Availability Linux

Environment
Redhat-based linux (Fedora, CentOS)

Installation
yum install heartbeat

Minimum Configuration
/etc/ha.d/ha.cf
node heartbeat1
node heartbeat2
bcast eth0
auto_failback off

/etc/ha.d/haresources
heartbeat1 192.168.85.3/27/192.168.85.16

/etc/ha.d/authkeys
auth 1
1 sha1 passwordString

Few description
/etc/ha.d/ha.cf
node xxx
node nodename = Indicate node in this heartbeat cluster
we can obtain nodename via uname -n command

bcast eth0

How to set ThinkPad's brightness in linux (raw command)

Reference: http://www.thinkwiki.org/wiki/LCD_Brightness

Full brightness
echo 100 > /proc/acpi/video/VID1/LCD0/brightness

Totally Dim
echo 20 > /proc/acpi/video/VID1/LCD0/brightness

Note: brightness value must be in this set [20, 30, 40, ... 100]

DNAT: Destination NAT with iptables

Sample: SSH through DNAT
Scenario
My client has IP address 172.16.1.202 with 172.16.1.1 as default gateway.
And I need to access secure shell of server in another network (192.168.1.101).
Our gateway has 172.16.1.1 and 192.168.1.1 as IP address in both networks.

Diagram
Client 172.16.1.202 ---> 172.16.1.1:50001 [Gateway] 192.168.1.1 ---> 192.168.1.101:22 [Destination]

Gateway
# Enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Let firewall accept forwarding for port 50001

Syndicate content