30 April 2012

Layer 4 Switching


รู้จักกับ Layer 4 Switching

ระดับ Layer-4 Switching ของ OSI Model จัดเป็นระดับชั้น Transport ซึ่งเป็นระดับชั้นที่รับผิดชอบเกี่ยวกับการสื่อสารข้อมูลแบบ End-to-End หรือระหว่างเครื่องผู้รับและผู้ส่ง ทำหน้าที่ประสานงานเกี่ยวกับการสื่อสารระหว่างต้นทางและปลายทางบนเครือข่าย เป็นระดับชั้นที่ใช้โปรโตคอล TCP และ UDP
Layer 4 Switching จะให้เครื่องมือที่สามารถจัด Configuration แก่เครือข่ายในรูปแบบของ Application โดยมีการนิยามวิธีการกลั่นกรอง Security รวมทั้งระดับชั้นของการให้บริการ (Class of Service ) ทำให้สามารถควบคุมระบบเครือข่ายได้ดีขึ้น
Layer 4 Switching ก็ยังมี Hardware เพิ่มเติมที่ทำหน้าที่รวบรวมสถิติของ Traffic ของแต่ละ Port ซึ่งคุณลักษณะพิเศษเหล่านี้ จะทำงานในรูปแบบ Application การรวบรวม Traffic นี้ทำบนพื้นฐานของ ข่าวสารของ Layer 4 Application Information (นอกเหนือจากการใช้ Layer 3 IP Header) ซึ่งจะทำให้ผู้บริหารเครือข่ายสามารถควบคุม และตรวจสอบ ปัญหาของเครือข่ายได้ดียิ่งขึ้น ตัวอย่าง เช่น 3COM CoreBuilder จะให้การสนับสนุน RMON ที่แสดงการทำงานของแต่ละ Port บน Switching Hub
Layer 4 Switching Hub จะต้องมีตารางการเก็บข้อมูลที่ใช้เพื่อการ Forward ที่มีขนาดใหญ่ โดยเฉพาะ ซึ่งเป็นการเก็บ ตารางข้อมูลนี้ไว้ในแกนหลักของ Enterprise Hub ขณะที่ Layer 2 และ Layer 3 Switch มีแนวโน้มที่จะมีขนาดของตาราง Forwarding ที่มีขนาดเป็นสัดส่วนกับจำนวนของอุปกรณ์บนเครือข่าย ขณะที่ Layer 4 Switching จะต้องมีมากกว่านั้นเป็นทวีคูณ เนื่องจากบนเครือข่ายมีการใช้ โปรโตคอลในระดับ Application ที่มีความหลากหลาย ดังนั้นขนาดของ Forwarding Table จะมีขนาดที่เติบโตขึ้นอย่างรวดเร็ว ตามจำนวนของอุปกรณ์เครือข่าย รวมทั้งชนิดของ Application ที่เพิ่มขึ้น เช่นกัน

สรุป จุดประสงค์ของการมี Layer 4 Switching
* เพื่อให้ได้ประสิทธิภาพที่ดีขึ้น บนพื้นฐานของข้อมูลข่าวสารในระดับ Layer-4
* ให้การสนับสนุน โปรโตคอลการจัดหาเส้นทาง อีกทั้งมีระบบกลั่นกรองรักษาความปลอดภัย และสนับสนุน Multicast (การส่งข้อมูลข่าวสารเฉพาะกลุ่ม)
* มี Class of Service สำหรับ Application ต่างๆ
* มี Routing Table ขนาดใหญ่ที่ให้การสนับสนุน Forwarding Traffic ภายใต้ข้อมูลข่าวสารบน Layer 4 รวมทั้งมีการปรับปรุงระบบการจัดการบริหารเครือข่ายในตัว

28 April 2012

Gmail free smtp server


ตัวอย่าง ssl://smtp.gmail.com:465

Incoming Mail (POP3) Server - requires SSL:your.isps.pop3.server.com
Use SSL: No
Port: 110
Outgoing Mail (SMTP) Server - requires TLS:smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587
Account Name:your Gmail username (including '@gmail.com')
Email Address:your original isp address (username@isp.c0m)
Password:your Gmail password

26 April 2012

How to enable xdmcp


เมื่อต้องการที่จะเปิดการทำงานของ xdmcp ในปัจจุบันไฟล์ config ของ xdmcp ได้ถูกเปลี่ยนแปลงไป จากเดิมอยู่ที่ /etc/X11/gdm/gdm.conf มาเป็น /etc/gdm/custom.conf การเปิด xdmcp นั้นให้แก้ไขไฟล์นี้ โดยแก้ไขในส่วนด้านล่างของข้อความ xdmcp ให้มีคำว่า

Enable=trueหรืออีกวิธีคือใช้ tool แบบ gui โดยรัน#gdmsetupเมื่อทำการแก้ไขเสร็จเรียบร้อยแล้ว อย่าลืมรันคำสั่ง#gdm-restart ด้วย

xdmcp for ubuntu


General Information

XDMCP is a remote desktop protocol. With XDMCP, one computer A running X11 can connecting computer B running X11, and interact with computer B as if one were physically at computer B. XDMCP is integrated into X.org, the default X11 server in Ubuntu. XDMCP also needs to be implemented by the display manager.

Warnings

  • XDMCP is inherently insecure as it does not encrypt your traffic. XDMCP is analogous to telnet, and therefore they share the same security issues. Over wireless, anyone can listen to your traffic and easily record your keystrokes. They can likely read what is being display on your screen. Over a wired LAN, this is more difficult but still possible. Over both, it is still somewhat easy for someone hijack your session and assume control of the sever. Therefore, only use XDMCP on a wired network that you you trust. Also, consider using alternatives that feature security (and often compression) such as NX.
  • XDMCP uses a large amount of bandwidth because it uses no compression. A 100mbit (wired) network may be necessary. However, the lack of compression can make XDMCP provide very fast graphics when the bandwidth is available.

Servers

GNOME Ubuntu 10.04 LTS Server

Please note that these instructions apply to the rewrite of GDM since Ubuntu 9.10 (although they have not been tested under 9.10.) These instructions are not officially documented and therefore this functionality may be considered a work in progress. This author believes that this functionality is indeed a work in progress because he has observed the following bugs:
  • An inability to login by default (with Xming clients at least.) Switching between regular GNOME and failesafe GNOME sessions repeatedly seems to fix this.
  • An inability of Xnest clients to reconnect. The server reports that the maximum number of sessions from a host have been reached, even though the session has been entirely ended. The only workaround is to restart GDM (by following the instructions to do that below.)
To enable XMDCP in Ubuntu 10.04 with the default (GNOME) GDM display manager, create the file "custom.conf" under /etc/gdm/ with the following contents:
[daemon]
RemoteGreeter=/usr/lib/gdm/gdmlogin

[xdmcp]
Enable=true
Then restart GDM, either by restarting the entire computer or running the following command (log out locally before you run this!):

sudo service gdm restart

Clients

tsclient

To enable XDMCP in tsclient, run the following command:
  • sudo apt-get install xnest

Xming for Windows

Xming is an X server for Microsoft Windows. Officially it supports Windows XP, Server 2003, and Vista. It appears to work on (64-bit) Windows 7 as well.
It supports being an XDMCP client, but this is not officially documented in the manual.
First download it from sourceforgeand install it.
You can then connect to server with IP address of 192.168.1.101 by running the following command on 32-bit Windows:
"C:\Program Files\Xming\Xming.exe" -query 192.168.1.101 -clipboard
or on 64-bit Windows
"C:\Program Files (x86)\Xming\Xming.exe" -query 192.168.1.101 -clipboard
You can replace the IP address with a hostname as well.
Please note that many of the other command line switches in Xming do not work with -query for XDMCP. This includes -wgl for 3d acceleration.
Please note, do not run any 3d programs as that program will crash, leave a black box for the area of the session, and you will have to kill the 3d program manually. The default kill level does not work, although kill -5 does.
To make connecting to a specified server more convenient, you can browse to the (regular) Xming shortcut in the start menu. Copy and paste it to the Xming folder. Then edit the copy of the shortcut by right-clicking and going to properties. Edit the name under the general tab to be whatever you want. Edit the target under the shortcut tab to be what is listed in the above examples (remove the default switches like -multiwindow .)

Cygwin with X for Windows

The Ubuntu help pages have extensive documentation on this more complex client here.

19 April 2012

ติดตั้ง Oracle Client บน Ubuntu Server

ขออนุญาติ Copy ครับ จาก http://www.notewee.com/?p=336


ติดตั้ง Oracle Client บน Ubuntu 9.10 (Karmic Koala)
By Note, 17 February, 2010, No Comment

จุดประสงค์เพื่อที่จะเขียน PHP connect กับ Oracle Database ทั้งนี้ทั้งนั้นต้องติดตั้ง OCI8 ให้ได้ เพื่อเรียกใช้ function ต่าง ๆ ในการเชื่อมต่อ

ใน entry นี้จะกล่าวเฉพาะการติดตั้ง PHP5 จนถึงการติดตั้ง Oracle Client เท่านั้น
โดยมีชุดคำสั่งดังนี้

- จำลองตัวเป็น root ก่อน

    sudo –i

- ทำการ update ระบบ

    apt-get update
    apt-get upgrade

- ติดตั้ง PHP5 และ module ที่เกี่ยวข้อง

    apt-get install php5-common php5 php5-dev libapache2-mod-php5 php5-cli

- ติดตั้ง PHP-PEAR

    apt-get install build-essential php-pear

- ติดตั้ง module libaio1

    apt-get install libaio1

- สร้าง directory สำหรับ oracle

    mkdir -p /opt/oracle
    cd /opt/oracle

- Download Oracle client โดยเลือกตัวที่เป็น basic และ sdk จาก website http://www.oracle.com/technology/tech/oci/instantclient/index.html อย่าลืมสมัครเป็นสมาชิกก่อน

- ติดตั้ง unzip

    apt-get install unzip

- จัดการ unzip ไฟส์ที่ได้มา (ปัจจุบันจะได้ตัว client ตามนี้ เวลาใช้จริงอย่าลืมเปลี่ยนชื่อไฟส์ให้ตรงกับที่ Download มาด้วย

    unzip instantclient-basic-linux32-11.2.0.1.zip
    unzip instantclient-sdk-linux32-11.2.0.1.zip

- Unzip เรียบร้อย จะได้ directory ที่ชื่อ instantclient_11_2 (อาจเปลี่ยนได้ตาม Version ที่ Download) ให้เปลี่ยน directory เป็น instantclient

    mv instantclient_11_2 instantclient
    cd instantclient

- จัดการสร้าง link file

    echo /opt/oracle/instantclient >> /etc/ld.so.conf
    ldconfig
    ln -s libclntsh.so.11.1 libclntsh.so
    ln -s libocci.so.11.1 libocci.so

- สร้าง directory เตรียมสำหรับ oci8

    mkdir -p /opt/oracle/src
    cd /opt/oracle/src

- download oci8 จาก http://pecl.php.net/package/oci8

wget http://pecl.php.net/get/oci8-1.4.7.tgz

    tar xzf oci8-1.3.5.tgz

- ทำการติดตั้ง oci8

    cd oci8-1.3.5
    phpize
    ./configure –with-oci8=shared,instantclient,/opt/oracle/instantclient
    make
    make install

- แก้ไข php.ini โดยเพิ่ม extension=oci8.so  เข้าไป

    sudo nano /etc/php5/apache2/php.ini

- restart apache

    /etc/init.d/apache2 restart

อ้างอิง :

http://ubuntuforums.org/showthread.php?t=637158
http://ubuntuforums.org/showthread.php?t=92528

installing cx_oracle under ubuntu 10.10


If you plan on writing any python applications/scripts for performing any basic SQL query’s against an oracle database you will need to have the cx_oracle library files installed to your machine (or server) here are some quick instructions on how to install them.
Please be aware i have only tested these instructions under Ubuntu 10.10 (32bit) using the 11.2 oracle instant client, when I have time I will try and install this on one of the x86_64 machines i have access to.
1. become root user
1sudo su -
2. install python-setuptools python-dev needed for the easy_install later on.
1apt-get install python-setuptools python-dev
3. install the following from the oracle website http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
* instantclient-basic-linux (32bit or 64bit depending on your system)
* instantclient-sdk-linux (32bit or 64bit depending on your system)
I have installed the files to /opt/instantclient_11_2 for ease
3. Setup ORACLE_HOME and LD_LIBRARY_PATH e.g.
       mkdir /opt/instantclient_11_2

1export ORACLE_HOME=/opt/instantclient_11_2
2export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME
4. The cx_oracle file needs to find a certain library file libclntsh.so you will find this under /opt/instantclient_11_2/libclntsh.so.X.X (X = version number) please make a symlink as follows
1cd $ORACLE_HOME
2ln -s libclntsh.so.11.1 libclntsh.so
5. run the following from the command line as root
1easy_install cx_oracle
6. job done.
Here is a good tutoral on how to use the library files once you have things installed