Ubuntu

Re-compile Tora with Oracle module

Tora เป้นเครื่องมือที่ใช้ในการพัฒนาและบริการจัดการฐานข้อมูล มี feature ต่างๆเช่น schema browser, SQL work-sheet, PL/SQL editor and debugger, storage manager, rollback segment monitor, instance manager and SQL output viewer. ใน Tora จะใช้ QT3 ที่สามารถเข้าใช้ไปยัง PostgreSQL, MySQL ได้โดยตรง และฐานข้อมุลอื่นๆ โดยผ่านทาง ODBC

1. ติดตั้ง Oracle Instant Client (OIC)
Oracle Instant Client สามารถ download ได้จาก
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
โดยเลือกpackage เป็นแบบ .rpm แล้วจึงทำการแปลงจาก .rpm เป็น .deb ด้วยคำสั่ง alien
#alien -d oracle-instantclient-basic-10.2.0.3-1.i386.rpm
#alien -d oracle-instantclient-devel-10.2.0.3-1.i386.rpm
#alien -d oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm

และทำการติดตั้งด้วยคำสั่ง dpkg
# dpkg -i oracle-instantclient-basic_10.2.0.3-2_i386.deb
# dpkg -i oracle-instantclient-devel_10.2.0.3-2_i386.deb
# dpkg -i oracle-instantclient-sqlplus_10.2.0.3-2_i386.deb

จากคำสั่งข้างบนนี้ ระบบจะทำการติดตั้งไว้ที่ /usr/lib/oracle

2. สร้างไฟล์ tnsnames.ora ไว้ที่ /usr/lib/oracle และคัดลอกข้อมูลจากข้างล่างนี้ไปไว้ในไฟล์ดังกล่าว

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = ORCL))
)

3. เพ่ิมบรรทัดเข้าไปในไฟล์ /etc/ld.so.conf.d/oracle.conf
/usr/lib/oracle/10.2.0.3/client/lib

จากนั้นให้ทำการ reload ldconfig อีกครั้งด้วยคำสั่ง ldconfig
# ldconfig

4. เพิ่มบรรทัดเข้าไปในไฟล์ /etc/bash.bashrc :

export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib
export TNS_ADMIN=/usr/lib/oracle

5. ดาวน์โหลด tora source code ด้วย apt-get command
# cd ~
# apt-get source tora

6. ให้ทำการติดตั้งชุด software ที่ต้องใช้ในการ compile เพิ่มเดิมด้วย apt-get
# apt-get install g++ gcc autoconf automake flex docbook-xsl
# apt-get install libqscintilla6 libqscintilla-dev
# apt-get install libqt3-mt-dev libqt3-compat-headers

และหากต้องการที่จะ compile Tora ให้สามารถใช้ฐานข้อมูล PostgreSQL และ MySQL ให้ลง package เพิ่มเติมได้

# cd tora-1.3.21/
แก้ไขข้อมูลในไฟล์ debian/rules และค้นหาบรรทัดที่คล้ายกับข้างล่าง

./configure –prefix=/usr –without-oracle –without-rpath –disable-new-check –with-kde –enable-libsuffix=

ให้แก้ไขเป็น
./configure –prefix=/usr –with-instant-client –without-rpath –disable-new-check –without-kde –enable-libsuffix=

7. สั่งคอมไพล์ใหม่
# debian/rules binary

8. หากไม่มีอะไรผิดพลาด (error)
# cd ..
ทำการลบ Tora เก่าออกไป
# apt-get remove tora
และติดตั้ง Tora ใหม่ลงไปแทนที่
# dpkg -i tora_1.3.21-3ubuntu1_i386.deb

9. ท้ายที่สุดให้ทำการทดสอบการใช้งาน Tora ด้วยการเชื่อมต่อไปยังฐานข้อมูล Oracle
# sqlplus user/userpass@ORCL

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 11 11:58:21 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL>



10. หากต้องการเชื่อมต่อไปยัง instance ของฐานข้อมูล oracle สามารถเพิ่มต่อไปในไฟล์ /usr/lib/oracle/tnsnames.ora ตัวอย่างเช่น
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = ORCL))
)

ORCL10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.12)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = ORCL10G))
)



ข้อมูลเพิ่มเติม
www.oracle.com
www.debian.com
www.ubuntu.com
www.google.com
การติดตั้ง vmware 6.0 workstation บน ubuntu 7.04

การติดตั้ง vmware 6.0 workstation เพื่อการใช้งานในแบบ virtualization
ใน ubuntu ไม่ได้มี package มาด้วย สามารถทำการ download trail version ได้ที่ www.vmware.com ซึ่ง version 6.0 นี้ support linux หลายๆ distribution

และก่อนทำการ install vmware ให้ทำการ install package ที่ต้องใช้ในการ compile ก่อน

$sudo apt-get install libx11-dev libxtst-dev xlibs-dev xinetd wget \
glibc-doc manpages-dev
$sudo apt-get install linux-headers-`uname -r` build-essential
$sudo apt-get install glibc-doc manpages-dev linux-headers-`uname -r` build-essential debian-keyring gcc-4.1-doc lib64stdc++6 libstdc++6-4.1-doc gcc make autoconf2.13 autoconf-archive automake1.9 libtool bison flex libltdl3-dev

เริ่มทำการติดตั้ง vmware ได้เลย

$sudo su
#tar zxvf VMware-workstation-6.0.0-45731.i386.tar.gz -C /data/software
#cd /data/software/vmware-distib/
root@ubuntu:/data/software/vmware-distrib#./vmware-install.pl

Creating a new VMware Workstation installer database using the tar4 format.

Installing VMware Workstation. This may take from several minutes to over an
hour depending upon its size.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc]

What is the directory that contains the init scripts?
[/etc/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware]

The path "/usr/lib/vmware" does not exist currently. This program is going to
create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the manual files?
[/usr/share/man]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware]

The path "/usr/share/doc/vmware" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

The installation of VMware Workstation 6.0.0 build-45731 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall.pl".

Before running VMware Workstation for the first time, you need to configure it
by invoking the following command: "/usr/bin/vmware-config.pl". Do you want
this program to invoke the command for you now? [yes]

Making sure services for VMware Workstation are stopped.

Stopping VMware services:
Virtual machine monitor done

Configuring fallback GTK+ 2.4 libraries.

In which directory do you want to install the theme icons?
[/usr/share/icons]

What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications]

In which directory do you want to install the application's icon?
[/usr/share/pixmaps]

Trying to find a suitable vmmon module for your running kernel.

The module bld-2.6.20-15-i586generic-Ubuntu7.04 loads perfectly in the running
kernel.

Trying to find a suitable vmblock module for your running kernel.

The module bld-2.6.20-15-i586generic-Ubuntu7.04 loads perfectly in the running
kernel.

Do you want networking for your virtual machines? (yes/no/help) [yes]

Configuring a bridged network for vmnet0.

Your computer has multiple ethernet network interfaces available: eth0, eth1.
Which one do you want to bridge to vmnet0? [eth0]

The following bridged networks have been defined:

. vmnet0 is bridged to eth0

Do you wish to configure another bridged network? (yes/no) [no] yes

Configuring a bridged network for vmnet2.

The following bridged networks have been defined:

. vmnet0 is bridged to eth0
. vmnet2 is bridged to eth1

All your ethernet interfaces are already bridged.

Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes]

Configuring a NAT network for vmnet8.

Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes]

Probing for an unused private subnet (this can take some time)...

The subnet 172.16.47.0/255.255.255.0 appears to be unused.

The following NAT networks have been defined:

. vmnet8 is a NAT network on private subnet 172.16.47.0.

Do you wish to configure another NAT network? (yes/no) [no]

Do you want to be able to use host-only networking in your virtual machines?
[yes]

Configuring a host-only network for vmnet1.

Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes]

Probing for an unused private subnet (this can take some time)...

The subnet 172.16.218.0/255.255.255.0 appears to be unused.

The following host-only networks have been defined:

. vmnet1 is a host-only network on private subnet 172.16.218.0.

Do you wish to configure another host-only network? (yes/no) [no]

Trying to find a suitable vmnet module for your running kernel.

The module bld-2.6.20-15-i586generic-Ubuntu7.04 loads perfectly in the running
kernel.

Do you want to install the Eclipse Integrated Virtual Debugger? You must have
the Eclipse IDE installed. [no]

Creating a new VMware VIX API installer database using the tar4 format.

Installing VMware VIX API. This may take from several minutes to over an hour
depending upon its size.

You must read and accept the VMware VIX API End User License Agreement to
continue.
Press enter to display it.

VMware(R) Software Developer Kit (SDK) Agreement

VMware, Inc. ("VMware") provides this Software Developer Kit ("SDK") for VIX
Application Programming Interface ("VIX API") to you subject to the
following terms and conditions. If you disagree with any of the following
terms, then do not use this SDK.

1. This SDK contains a variety of materials, including but not limited to,
interface definitions, documentation, Redistributable Code and Sample Code
regarding programming interfaces to one or more VMware products as
referenced in such materials ("VMware Software"). This SDK is intended to
serve as a guide for writing programs to interact with the VMware Software.
For the purpose of this Agreement, "Sample Code" means sample software in
source code format designated as "Sample Code" in the SDK documentation, and
"Redistributable Code" means object code files designated as
"Redistributable Code" in the SDK documentation.

2. Subject to the restrictions below, you may download and make a
reasonable number of copies of the SDK contents for your personal use solely
for the purpose of creating software that communicates with VMware Software
("Developer Software"). You agree to defend, indemnify and hold harmless
VMware, and any of its directors, officers, employees, affiliates or agents,
from and against any and all claims, losses, damages, liabilities and other
expenses (including reasonable attorneys' fees), arising from your
modification and distribution of the Sample Code, distribution of
Redistributable Code or breach of this SDK Terms and Conditions.

3. Restrictions: You may create and distribute Developer Software based on
the Sample Code and Redistributable Code, provided that (1) you do not use
the SDK to design or develop anything other than Developer Software; (2) you
do not modify, create derivative works of, reverse engineer, reverse
compile, or disassemble the Redistribution Code, except that you may modify
and create derivative works of the Sample Code in connection with Developer
Software; (3) you distribute the Redistributable Code in object code form
only and solely in conjunction with, and as part of your Developer Software;
(4) you do not make any more copies of the SDK than are reasonably necessary
for the authorized use and backup and archival purposes; (5) you do not
permit further distribution of the SDK by your end users; (6) you do not
permit sub-licensees or end users to reverse engineer or reverse compile the
Redistributable Code; and (7) you do not use the SDK to design or develop
software to upload or otherwise transmit any material containing software
viruses or other computer code, files or programs designed to interrupt,
destroy, or limit the functionality of any software or hardware.

4. VMware retains ownership of the SDK, including without limitation all
copyrights and other intellectual property rights therein.

5. For open source software components included with the SDK, you are
subject to the terms of those applicable open source license agreements.
The open source software licenses can be found in the
open_source_licenses.txt file, other materials accompanying the SDK, the
documentation or corresponding source files available at
http://www.vmware.com/download/open_source.html.

6. You may not represent that the programs you develop using the SDK are
certified or otherwise endorsed by VMware. You may not use the VMware name
or any other trademarks or service marks of VMware in connection with
programs that you develop using the SDK.

7. You will not receive any VMware support or subscription services for the
SDK or any other services from VMware in connection with the SDK. If you
have purchased support and/or subscription services for a VMware product,
such support and/or subscription services shall not apply to the SDK or your
use of the SDK.

8. Term, Termination and Changes: This Agreement shall continue as long as
you are in compliance with the terms specified herein or until otherwise
terminated. You and or VMware each may terminate this Agreement for any
reason at any time. You agree, upon termination, to destroy all copies of
the SDK within your possession or control. The Confidential Information,
Limitations of Warranties, Liability and Indemnification sections set out in
this Agreement shall survive any termination or expiration of this
Agreement.

9. Limitations of Warranties and Liability: THE SDK IS PROVIDED "AS IS"
WITHOUT ANY WARRANTIES OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY
APPLICABLE LAW, VMWARE DISCLAIMS ANY IMPLIED WARRANTIES, INCLUDING, WITHOUT
LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL VMWARE
BE LIABLE FOR ANY LOST PROFITS OR BUSINESS OPPORTUNITIES, LOSS OF USE,
BUSINESS INTERRUPTION, LOSS OF DATA, OR ANY OTHER INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE SDK OR YOUR USE OF
THE SDK, UNDER ANY THEORY OF LIABILITY, WHETHER BASED IN CONTRACT, TORT,
NEGLIGENCE, PRODUCT LIABILITY, OR OTHERWISE. BECAUSE SOME JURISDICTIONS DO
NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR
INCIDENTAL DAMAGES, THE PRECEDING LIMITATION MAY NOT APPLY TO YOU.

VMWARE'S LIABILITY ARISING OUT OF THE SDK PROVIDED HEREUNDER WILL NOT, IN
ANY EVENT, EXCEED US$5.00.

THE FOREGOING LIMITATIONS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY
APPLICABLE LAW, REGARDLESS OF WHETHER VMWARE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF WHETHER ANY REMEDY FAILS OF
ITS ESSENTIAL PURPOSE.

10. These terms are governed by the laws of the State of California and the
United States of America without regard to conflict of laws principles. You
may not assign any part of this Agreement without the prior written consent
of VMware. Any attempted assignment without consent shall be void. These
terms constitute the entire agreement between you and VMware with respect to
the SDK, and supersede all prior written or oral communications,
understandings and agreements. Any waiver of these terms must be in writing
to be effective. If any provision of these terms is found to be invalid or
unenforceable, the remaining terms will continue to be valid and enforceable
to the fullest extent permitted by law.

SDK 4.05.07



Do you accept? (yes/no) yes

Thank you.

In which directory do you want to install the VMware VIX API binary files?
[/usr/bin]

In which directory do you want to install the VMware VIX API library files?
[/usr/lib/vmware-vix/lib]

The path "/usr/lib/vmware-vix/lib" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the VMware VIX API document pages?
[/usr/share/doc/vmware-vix]

The path "/usr/share/doc/vmware-vix" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

The installation of VMware VIX API 1.1.0 build-45731 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-vix.pl".

Starting VMware services:
Virtual machine monitor done
Blocking file system: done
Virtual ethernet done
Bridged networking on /dev/vmnet0 done
Host network detection done
Host-only networking on /dev/vmnet1 (background) done
DHCP server on /dev/vmnet1 done
Bridged networking on /dev/vmnet2 done
Host-only networking on /dev/vmnet8 (background) done
DHCP server on /dev/vmnet8 done
NAT service on /dev/vmnet8 done

The configuration of VMware Workstation 6.0.0 build-45731 for Linux for this
running kernel completed successfully.

You can now run VMware Workstation by invoking the following command:
"/usr/bin/vmware".

Enjoy,

--the VMware team


หากไม่ต้องการให้ vmware รันตอนที่เปิดเครื่องทุกครั้ง ให้ทำการปิดไว้ ด้วย update-rc.d

root@ubuntu:/data/software/vmware-distrib# update-rc.d -f vmware remove
Removing any system startup links for /etc/init.d/vmware ...
/etc/rc0.d/K08vmware
/etc/rc2.d/K08vmware
/etc/rc2.d/S90vmware
/etc/rc3.d/K08vmware
/etc/rc3.d/S90vmware
/etc/rc5.d/K08vmware
/etc/rc5.d/S90vmware
/etc/rc6.d/K08vmware

ข้มูลเพิ่มเติม
www.vmware.com
www.ubuntu.com
วิธีการติดตั้งฟ้อนท์ไทย บน ubuntu 7.04 แบบง่ายๆ

1. ติดตั้งใน home directory ของแต่ละคน สามารถทำได้ดังนี้

$mkdir ~/.fonts

และทำการ copy font thai ไปใน .fonts

$cp /paht/of/thai/fonts ~/.fonts
$fc-cache -f -v

เมื่อติดตั้งฟ้อนท์เสร็จแล้ว ให้ logout และทำการ login ใหม่อีกครั้ง

2. การติดตั้งใน system

ให้ทำการ copy ฟ้อนท์ไปไว้ใน /usr/share/fonts/truetype

$sudo cp /path/of/thai/fonts /usr/share/fonts/truetype/ttf-custom

หลังจากนั้นสั่งรัน fc-cache
$sudo fc-cache -f -v

3. วิธีสุดท้าย ติดตั้งผ่าน apt-get แต่ต้องต่อ internet ก่อนนะ
$sudo apt-get update
$sudo apt-get install ttf-thai-tlwg xfonts-thai xfonts-thai-etl \
xfonts-thai-manop xfonts-thai-nectec xfonts-thai-poonlap xfonts-thai-ttf xfonts-thai-vor
$sudo apt-get install msttcorefonts

เสร็จสิ้นสำหรับการติดตั้งฟ้อนท์ไทยแล้ว

หมายเหตุ
ขอบคุณ ทุกท่านที่สละเวลานั่งทำ thai fonts ให้คนไทยได้ใช้กันครับ