หนูนุ้ย ชิมิ
หลกคาดไม่อยากแหลงมากแลกันเองนะ
Leave a Comment February 4, 2011
สืบเนื่องจากที่ผมเขียนเรื่อง NAT ในวันก่อนวันนี้ก็เลยเอาเรื่องการ Flush rules ของ iptables มาฝากครับ
ตามนี้เลย
iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
จะรันทีละบรรทัด หรือจะเอาไปทำเป็น Script ก็ได้ครับ
แหล่งข้อมูล : http://www.cyberciti.biz/tips/linux-iptables-how-to-flush-all-rules.html
Leave a Comment January 28, 2011
ขั้นตอนมีดังนี้ครับ
1. ต่อสาย Console ที่ Fortigate และต่อเข้า PC หรือ Notebook ของเราให้เรียบร้อย แล้วเปิด Hyperterminal รอไว้เลย
2. เสียบปลั๊ก
3. เมื่อ Boot เสร็จมันจะ Prompt ให้เรากรอก Login ก็ให้กรอกไปดังนี้
ให้เปลี่ยน 1111111111 เป็น Serial ของเครื่องซึ่งสังเกตุได้จาก Prompt ตอน Login นั้นแหละครับ ไม่ก็หงายดูด้านล้างเครื่องมันก็ได้ (มีเวลาให้คุณ login 30 วิเท่านั้น)
4. เมื่อ login ได้แล้วก็ใช้คำสั่ง
5. Fortigate 100A ของเราก็พร้อมใช้งานตามมาตรฐานโรงงานแล้วครับ
คำเตือน : วิธีการข้างต้นเป็นการทำ factory reset ดังนั้น Configuration ของคุณจะหายไปหมด
สำหรับใครที่ต้องการจะเปลี่ยนแค่รหัสผ่าน เมื่อเข้า maintainer mode ได้แล้วก็อาจเปลี่ยนแค่รหัสผ่านของ admin ก็พอ
ดังนั้น ใช้อย่างระมัดระวังนะครับ
Leave a Comment January 26, 2011
ตามนี้เลยครับ สำหรับใครที่ต้องการแชร์เน็ตแบบทันใจ
โดยให้ eth0 เป็นขาที่ต่อเน็ต และขา eth1 เป็นขา local ที่ต้องการจะแชร์เน็ต มาดูวิธีกัน
กำหนด IP ของ eth1 ของเครื่องแม่ที่ต้องแชร์เน็ตให้เป็น 192.168.1.1/24
กำหนด IP เครื่อง Client ที่ต้องการจะแชร์เน็ตให้เป็น 192.168.1.xxx/24 ในที่นี้ผมกำหนดเป็น 192.168.1.10/24 และชี้ Gateway มาที่เครื่อง 192.168.1.1 ส่วน DNS ก็ชี้ไปที่ไหนก็ได้ครับ ผมขอชี้ไปที่ 8.8.8.8 ของ Google ละกัน
มาถึงส่วน Script กันบ้าง
สร้างไฟล์ nat.sh จากนั้น Copy Script ด้านล้างไปวางแล้ว Save
#!/bin/bash #Express NAT Shell Script echo "1" > /proc/sys/net/ipv4/ip_forward iptables -P FORWARD DROP iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -o eth0 -j MASQUERADE iptables -A FORWARD -d 192.168.1.0/24 -j ACCEPT iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT iptables -A FORWARD -j DROP
จากนั้นกำหนดสิทธิ์ให้สามารถรันได้โดย
แล้วก็รันกันได้เลย
ทดลองเล่นเน็ตจากเครื่อง Client กันได้เลยจ้า
1 Comment January 24, 2011
ตามนี้เลยครับ http://www.ubuntugamer.com/
เว็บเขามีจัดอันดับ Top Game ที่ได้รับความนิยมให้อ่านกันด้วย
Leave a Comment January 19, 2011
วันนี้เอาวิธีแก้ปัญหาสำหรับคนชอบเอานกไปยิงหมู แต่ใจรัก Ubuntu มาฝากครับ ที่ผมเกริ่นมานั้นคือเกมส์ Angry Birds นั้นเอง สำหรับใครที่ใช้ Ubuntu แล้วอยากเล่น Angry Birds แต่รันเกมส์ด้วย Wine ไม่ได้นั้นเป็นเพราะมันขาด .dll บางตัวครับ
mrgill@mrgill-laptop:~/Desktop/Angry Birds$ wine AngryBirds.exe fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC80.CRT" (8.0.50727.4053) fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC90.CRT" (9.0.21022.8) err:module:import_dll Library MSVCP90.dll (which is needed by L"Z:\\home\\mrgill\\Desktop\\Angry Birds\\AppUpWrapper.dll") not found err:module:import_dll Library AppUpWrapper.dll (which is needed by L"Z:\\home\\mrgill\\Desktop\\Angry Birds\\AngryBirds.exe") not found err:module:LdrInitializeThunk Main exe initialization for L"Z:\\home\\mrgill\\Desktop\\Angry Birds\\AngryBirds.exe" failed, status c0000135
จากข้างต้นนั้นมันบอกว่าขาดไฟล์ MSVCP90.dll อยู่ครับวิธีแก้ก็ให้ไป download ไฟล์นี้มาจาก internet มาได้เลยครับ โหลดมาแล้วก็ extract แล้วก็ copy ไฟล์ MSVCP90.dll ไปไว้ใน ~/.wine/drive_c/windows แล้วเราก็มาเล่นเกมส์ยิงหมูกันได้เลย
Leave a Comment January 13, 2011
การติดตั้ง tor บน ubuntu เป็นปัญหาคาใจผมมานานครับ ใช่ครับเมื่อก่อนมันติดตั้งง่ายแต่พอตอนนี้ถึงเวอร์ชันปัจจุบันไปหาอ่าน how to จาก guru ทั้งหลายมันก็ทำงานไม่ได้เสียแล้วก็เลยต้องหาวิธีเอง ลองเข้าไปในเว็บ http://www.torproject.org เองเลย ก็ไปเจอ repository สำหรับ ubuntu และ debian ตามนี้ครับ
http://www.torproject.org/docs/debian.html.en#ubuntu
เขาบอกว่าให้เพิ่มบรรทัด
เข้าไปในไฟล์ /etc/apt/sources.list
จากนั้นให้ add gpg key โดยใช้คำสั่ง
add key เสร็จแล้วก็ติดตั้ง tor กันได้เลยครับโดย (หากใคร add key แล้วเกิด error ก็ไม่เป็นไรครับสามารถติดตั้งได้เหมือนกัน)
หลังจากที่ติดตั้งแล้วเราจะได้ package tor กับ polipo ซึ่งเป็น mini proxy มาให้ด้วย
ติดตั้งเสร็จแล้วก็ต้อง config กันสักเล็กน้อยโดยให้แก้ไฟล์ /etc/polipo/config ของ polipo โดยเอา # หน้าบรรทัดต่อไปนี้ออกไป
allowedClients = 127.0.0.1
socksParentProxy = “localhost:9050″
socksProxyType = socks5
จากนั้นบันทึกแล้วก็สั่ง restart polipo โดย
ทีนี้มาถึงฝั่ง web browser กันบ้าง ในที่นี้ขอพูดถึง firefox นะครับ firefox เองมี addon ชื่อ Torbutton สามารถเข้าไปติดตั้งกันเลยที่
https://addons.mozilla.org/en-US/firefox/addon/2275/
ติดตั้งเสร็จแล้วก็ restart firefox 1 รอบก็จะมี icon ของ Torbutton ปรากฎที่มุมล่างขวาของหน้าจอ firefox ให้คลิกขวาที่ปุ่ม Tor Disable จากนั้นเลือก Preferences… จากนั้นให้เปลี่ยน Port ของ HTTP Proxy กับ SSL Proxy จาก 8118 เป็น 8123 แล้วก็กด OK ออกมา
เริ่มใช้ Tor ผ่าน Firefox กันเลยโดยคลิกที่ปุ่ม Tor Disable ซึ่งมีตัวอักษรสีแดง เมื่อคลิกแล้วจะเปลี่ยนเป็น Tor Enable สีเขียว
ทีนี้เราก็พร้อมจะท่องเน็ตแบบ Anonymous ทะลุทะลวงเว็บไซต์ที่โดน block ได้แล้วครับ
Leave a Comment January 12, 2011
วันนี้เก็บเอาคำสั่งเกี่ยวกับ iscsi-initiator-utils มาเก็บไว้กันลืมครับ
ก็เป็นพวกคำสั่ง discovery target การ login เข้าใช้ target แล้วก็คำสั่งลบ target ที่ไม่ต้องการ
ตามนี้ครับ
[root@rac1 ~]# iscsiadm -m discovery -t sendtargets -p 10.30.1.140 #คำสั่ง discovery
10.30.1.140:3260,1 iqn.1994-05.com.redhat:rac1
10.30.1.140:3260,1 iqn.1994-05.com.redhat:rac2
[root@rac1 ~]#
[root@rac1 ~]# /etc/init.d/iscsi restart
Logging out of session [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logout of [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
Stopping iSCSI daemon:
iscsid dead but pid file exists [ OK ]
Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]
Login to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
Login to [iface: default, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]: successful
[ OK ]
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10240 10485744 83 Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 10240 10485744 83 Linux
Disk /dev/sdd: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 10240 10485744 83 Linux
Disk /dev/sde: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 10240 10485744 83 Linux
[root@rac1 ~]#
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac2 -o delete
iscsiadm: This command will remove the record [iface: default, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260], but a session is using it. Logout session then rerun command to remove record.
iscsiadm: Could not execute operation on all records. Err 22.
[root@rac1 ~]#
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac2 -u #คำสั่ง logout จาก target
Logging out of session [sid: 2, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]
Logout of [sid: 2, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]: successful
[root@rac1 ~]#
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac2 -o delete #คำสั่งลบ target
[root@rac1 ~]#
[root@rac1 ~]# /etc/init.d/iscsi restart #คำสั่ง restart iscsi-initiator-utils
Logging out of session [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logout of [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
Stopping iSCSI daemon:
iscsid dead but pid file exists [ OK ]
Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Login to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
[ OK ]
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10240 10485744 83 Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 10240 10485744 83 Linux
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac1 -u
Logging out of session [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logout of [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac1 -l #คำสั่ง login เข้าใช้งาน target
Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Login to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l #คำสั่งแสดง partition
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10240 10485744 83 Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 10240 10485744 83 Linux
[root@rac1 ~]#
1 Comment January 7, 2011
ใครเจอปัญหาเครื่อง Guest ใน VirtualBox 4.0 Pause เองบ้างครับ ผมคนนึงละเจอ งงเลยว่าเกิดอะไรขึ้น ตอนแรกคิดว่าปัญหาเกิดจากตัว VBox เองแต่พอไปอ่านในบอร์ดของ VBox จึงได้รู้ว่าปัญหามาจาก Power Management Profile ในตัว Guest ดังนั้นที่ที่เจอปัญหานี้ก็แค่ไปปิด Power Management ใน Guest อาการนี้ก็จะหายไปครับ
Leave a Comment January 6, 2011
Gyachi เป็น Yahoo Messenger สำหรับ Linux
สำหรับวิธีติดตั้งบน Ubuntu 10.10 ทำตามนี้ได้เลยครับผม
sudo add-apt-repository ppa:adilson/experimental sudo apt-get update sudo apt-get install gyachi
Leave a Comment January 2, 2011
adobe amsn antivirus apt-get bash chat clip command emesene entertainment Facebook firefox google grave accent How to howto im install Internet karmic keyboard Linux memory operating system os Programming rhel 5.5 script Server shell script Social network solaris solaris 10 solaris containers storage tools troubleshooting Ubuntu utility virtualbox virtualization Windows wine zone ภาษาไทย
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.