Sunday 6 December 2009

How to install Oracle on OpenSuSe Linux

I recently upgraded my Linux installation to the latest OpenSuSe 11.2 release.

I decided to install the free version of Oracle (.e Oracle Express Edition or Oracle XE).

The installations seems to be relatively simple, but I ended up with a system which did not allow me to access the Home page of the administrative site.

After the configuration the system automatically starts the Net Listener and the Oracle database 10G Express. It prints a completion message that the Installation completed successfully and then suggests to access the database Home page by entering on your browser the command http://127.0.0.1:8080/apex.

I did as instructed, but the command was refused because it was unable to execute on the server.At the point I started panicking and I thought that I must have made some errors. I decided to uninstall Oracle by running the command rpm -e oracle-xe-univ and to do a new installation from scratch. Unfortunately the results were exactly the same.

Finally I wondered if the problem might be connected to the Web server. I decided to install Apache and to to install again Oracle. This time everything worked perfectly.

I found on various Linux Forums that many people seem to have this problem and I suggest them to try an installation of Apache before installing Oracle.

A more detailed description on how to install Oracle on Linux can be found on my Squidoo lens at oracle-installation-on-opensuse-linux

Wednesday 19 August 2009

How to Change Website Host

Sometimes people need to move a Website to a different hosting company.

I have a few websites and i used different website hosts for some of them.

A few of my hosting companies allow to host unlimited domains and sub-domains and I realized that I could save some hosting costs by moving all my domains and sub-domains to this single host.

I had been happy with the service and support provided by all companies. It is difficult to identify a best website host, but finally I chose Hostgator. I think that their hosting costs are very competitive and they provide excellent services and support.

I decided to transfer to this new host my domain MarioEbooks.com and all its sub-domains.

You will find a description of how this was done in the Squidoo lens How_To_Change_Website_Host

Tuesday 14 July 2009

Computer Books and Ebooks

Computer professionals need good Computer Books and Ebooks to keep up to date with latest technology developments and to learn new computer skills.

I am constantly on the lookup for good Computer Books, Computer tutorials and Computer Ebooks and I have been able to improve my knowledge and skills by reading them.

I have also written a Squidoo lens on this subject and you can read it at:

Computer Books, Ebooks and Software

Finally I decided to develop my own website with the best Computer books and Computer Ebooks that I have discovered and possibly read,

You can visit the website at Computer Books and Software

Thursday 4 June 2009

Install Your Own Dedicated Server.

I found an interesting Website which advertises an Ebook with all you need to know to install a dedicated Web server or VPS.

You can become your own Hosting provider and save money currently spent with external hosting companies.

The site starts with following considerations:

- The majority of Software on Linux dedicated servers is open source and FREE
- There are open source control panels
- Most web professionals think that managing their own Server or Virtual Private Server is beyond their capabilities. This is a wrong idea.

The site offers FREE video tutorials which cover:

* Configuring the Webmin FREE Web-Based Control Panel
* Securing your online control panel
* Installing your own DNS server
* Adding user to your server
* Adding Secure FTP to your server
* Configuring your Webserver
* Creating your first website
* Installing a MySQL database
* Setting up outgoing emails
* Setting up webserver log analysis

AND MORE!

The Ebook contains all these subjects and more and is surely worth its price especially if you are a Linux technician who wants to improve your skills.

I haven't told yet the name of this website. Have a look to TheDedicatedServerHandbook.com

Monday 20 April 2009

How to migrate from Windows to Linux

Introduction

When a few years ago I decided to move from Windows to Linux (I created on my machine separate partitions for Linux and booted from Lilo or Grub either into Windows or into Linux, according to job requirements.


I normally used my laptop PC during the day in a company that had a Windows based LAN and therefore I normally had to boot in Windows during the day whereas I would boot into either Windows or Linux at home. This approach has a few disadvantages as follows:


  • My work e-mails were in Microsoft Outlook and I had to boot under Windows to access them.
    I used KMail (and later Mozilla Thundirbird) for my personal e-mails and I had to boot under Linux to access them.

  • I could access Window folders from Linux and copy data, but I could not access any of the Linux folders from Windows.


I concluded that there should have been a better way to use my PC and I looked for a solution to access both Linux and Windows applications without rebooting.

I investigated some of the available products. I found that the wine or CodeWeavers Crossover supported most common Microsoft Windows applications, but some other ones would not work. VMWare looked interesting, but finally I decided to buy Win4Lin (originally developed by Netraverse to support only Windows 95, 98 or ME, even if it allowed to install and use many more recent applications such as Office 2000 or other ones developed for XP without a glitch.

Some good advantages that I found in Win4Lin are the following:


  • Win4Lin has a very small overhead and pretty good performance. I discovered, after the installation, that sometimes applications run faster under Win4Lin than in the original Windows environment. The performance is due to the fact that Win4Lin is not really an emulator; it creates an environment where Windows applications run in native mode. This is done by providing modules that allow Windows to run as a Linux process.

  • The installation of Win4Lin is pretty straightforward.


Recently I had to install Linux on a new machine and I decided to install both a new OpenSUSE 11.0 distribution and the new version of Win4LinPro that now supports Windows 2000 and XP (according to the company Vista should also be supported in future).

The objective of this report is to give you an overview of the new Win4LinPro application and of the approach that I followed to migrate my dual boot machine to a single boot system.

Installing Win4LinPro

Win4LinPro is now distributed and supported by Virtual Bridges. You can easily order it online at the Win4Lin.com site and download either an ISO version or one of the Debian or RPM packages. Virtual Bridges confirms the order with an e-mail which includes also the licence code that must be entered during the installation.

Since I had an RPM based Linux distribution (OpenSuSE 11.0), I downloaded the RPM package. I checked the instructions of the UserManual which require to pre-install also the gcc and the kernel-source packages and then I could install the RPM without any problems.

The installation procedure of the original Win4Lin was more complex because it required to download a special Netraverse-enabled kernel according to each distribution. The new installer does not require this step because it automatically compiles and installs the kernel modules needed to support Win4LinPro.

The Windows installation has also become simpler. The original product required to copy files from your Windows 95, 98 or ME CD to disk and eventually install Windows. In the new version you can use the win4console command to request a Windows session installation and to define how it should be performed (installation directory, installation media etc.) You can specify that you want to install from the XP CD and the installation is performed as if it were a normal XP installation. The win4console allows also to install multiple copies of Windows and the system allows to run two of them concurrently (this could be useful if you want to have a Windows XP and a Windows 2000 session).

After the installation is complete, if you have used the defaults, you will find a Windows icon on your desktop and you can use it to start or shut-down your Windows session terminal. Alternatively you can use the win4 shell command.

You can install new applications in Windows in the same way as you would do with a normal Windows system. I installed various applications such as Microsoft Office, Acrobat Reader, Eudora, HotMetal PRO and a new version of Internet Explorer without any problem.

I had some problems with the original installation to use a COM device for a dial up connection. The new version allows Windows to connect to almost any type of Ethernet network from regular Internet access to Active Directory authentication, and anything in between.

Using Win4LinPro

Win4LinPro creates an interesting Windows environment which is pretty well integrated with Linux.

The personal Windows environment is normally created by win4LinPro in the home directory of the user who performs the installation. When the installation is complete, you will find two image files with the .IMG suffix which are used by Windows as the C: drive (used to store Windows programs and data) and the D: drive (used to store user settings).

By default Win4LinPro automatically configures shared folders so that Windows can access Linux files and Linux can access Windows files. Your Linux home directory is accessible from the Windows HOSTHOME path. You can also use the shared documents directory from Windows by double clicking on the Windows My Documents icon and accessing the path HOSTDocuments.


The Win4LinPro environment is surely much better integrated with Linux than a native Windows installation and you will have at your disposal the power of Linux and Windows applications without any need to reboot.

Moreover Win4LinPro offers greater virus protection than a stand-alone Windows installation. You can easily save your Windows directory as a tar archive and many viruses will not have any effect as explained below:


  • Boot sector or other boot time viruses. There is no Windows boot sector and therefore they are ineffective.

  • FAT32, VFAT or NTFS related viruses. Win4Lin installs Windows files in subdirectories of the Linux filesystem and therefore these viruses are ineffective.

  • Executable files viruses. These can still attack, but will not affect the Linux system.

  • Macro viruses. These can still attack Windows macros, but you can use Linux permissions to make them write protected.


Another protection is given by the snapshot running mode which insures that data in the C: virtual drive cannot be changed

Win4Lin Limitations and Peculiarities. Following main points should be considered:


  • Win4Lin offers different networking options that you can choose during installation and modify later (if needed). The basic TCP/IP and UDP/IP networking is the most secure and provides the best use of resources. If you need more advanced networking options you can use the NAT neworking or the Bridged networking options well explained in the UserManual.

  • Win4LIN does not support direct Windows access to USB devices. However, if they are configured in Linux, they can be accessed indirectly (You can use the My Host Computer function from the start menu to access devices mounted automatically by Linux)
  • .


Removing the original Window partition

One negative point of having both an original Windows partition and the Win4Lin installation is the waste of space (for instance I had MS Office applications installed on both partitions). This setup could offer better security, in case of problems to either the Windows or Linux installation, but, at some point, I decided that I could use better the disk space and work without double booting with Linux and Windows under Win4LinPro.

To avoid loosing useful data, I performed following activities:


  • I identified the Outlook mail boxes by using the Windows Find option with "*.pst" and copied them to the Win4LinPro environment.

  • I identified the Outlook Express maild boxes by using the Windows Find option with "*.dbx" and copied them to the Win4LinPro environment.

  • I identified my Eudora mail boxes (used for my personal mail) by using the Windows Find option with "*.mbx" and copied them to the Win4LinPro environment.

  • I found the 'Favorites' folders used by Internet Explorer and I copied it and its sub-folders to the Win4LinPro environment.

  • I copied the 'My Documents' folder and all other folders that I used in my Windows environment


Making the above copies in the Win4LinPro environment is relatively easy, because Win4LinPro can access mnt directly. You can mount the original Windows partition in the Linux /mnt directory by using a command such as:


$sudo mount /dev/sdb3 /media/windows -t vfat -o umask=000


Once the partition is mounted, you can access it in the Win4LinPro Windows session in the mnt Windows folder.

Once I was satisfied that all important data existed in the Win4LinPro environment, I decided to reformat the Windows partition and copy my Linux /home directory, that was included in the main root hierarchy, to a separate partition. This activity is described in detail below.

Using the freed partition for Linux

A good description of how to move /home to a different partition can be found in a good tutorial by Daniel Robbins at IBM DeveloperWorks. The main steps are as following:


  • Create a filesystem in the new partition by using a command such as mkfs /dev/???

  • Mount the new filesystem in /mnt with a command such as mount /dev/??? /mnt/newhome

  • Drop to single user mode (init 1)

  • Change to the current home directory and enter a copy command such as cp -ax * /mnt/newhome. The ax option causes cp to copy in recursive mode by preserving all file attributes.

  • Rename the old /home to /home.old by using the command mv /home /home.old and mount the new one with mount /dev/??? /home.


When you are sure that everything works correctly, you can remove the /home.old directory.

Conclusions

I believe that the approach described above allows an optimal use of both Linux and Windows resources.


It is often difficult to use only Linux, because one normally has to work in Windows based LANs, interact with other Windows or Linux users or just because one is too lazy to learn new applications instead of those normally used in a Windows environment.


A double boot system is a inconvenient to use. The solution proposed above allows a much better usage of the computer resources and time.

P.S. The article was originally published on http://www.ezinearticles.com

Friday 27 March 2009

Useful Linux Tools for Webmasters

1. Introduction

Recently I found two useful tools that should prove especially useful to developers and maintainers of Internet Websites. They are:

- gftp
- kompozer

You will find a short introduction below.

2. The Gnome FTP Client

It is a GNU and OPen Source visual FTP client (similar to Filezilla or to the well known CuteFTP under Windows) with a GTK+ GUI which is released under GNU license. It is mainly for Linux and Unix systems, but it can be used also on Mac OS and Windows.

It supports the FTP, FTPS HTTP, HTTPS, SFTP e FSP protocols; it supports server proxy for the FTP and HTTP protocols and FXP which allows to transfer files between two remote servers via FTP.

The GUI interface has two main panels with the left one for the local machine and the right one for the remote machine. You can choose the directories of the local and remote machine and request the transfer of the chosen files either from the local to the remote machine or the other way round. Under these two panel the program shows a message queue where the user can check the progress status of the transfers.

There is also a bookmarks menu that allows to quickly connect to remote sites.

In the past I used to work with the line oriented lftp, but I found that I could do a lot more and faster by using this GUI based tool.

I installed the tool, without any problem, on my OpensuSE 10.2 and OpenSUSE 11.0 systems by using an RPM based package.

3. The Kompozer Web authoring tool

Kompozer is an easy WYSIWYG HTML and CSS editor. It is a complete web authoring system that combines web file management and easy-to-use WYSIWYG web page editing capabilities found in Microsoft FrontPage, Adobe DreamWeaver and other high end programs.

The tool has a GUI interface which displays different views of the same document such as the HTML source, the tag or the external view in different panels. You can easily switch between these views and make changes to an HTML or CSS document in the more convenient way. It ihas also an integrated FTP function.

Kompozer is a stand-alone tool with small size and fast speed based on on Gecko, the layout engine inside Mozilla.

I installed the application without any problems on my OpenSUSE 10.2 and OpenSuSE 11.0 systems by using the RPM package which can be downloaded from the kompozer official site.

4. Conclusion

The two products describes above are good examples of functionally advanced applications that can be easily installed on Linux machine

P.S. The article was originally published on http://www.ezinearticles.com
and on http://www.squidoo.com/linuxTools

Monday 9 March 2009

IBM ISeries Utilities For Data Interchange

1. Introduction
The IBM iSeries computers, still commonly known as AS/400 systems use the successful IBM DB2 database to store and access data which are organised into files with the following characteristics:

  • They are structured in data fields which usually have a fixed length and type
  • They have external data definitions which can be used by application programs
  • Numeric data can be stored in packed format where each digit is stored in a semibyte.
  • Data are coded in EBCDIC
Other systems such as Linux/Unix and Windows use files which are just a sequence of bytes (normally coded in ASCII) and therefore are known as stream files. Often their fields have not a fixed length and are delimited by a special field delimiter character such as a semicolon, a colon or a pipe (field delimited files are often produced by exporting data originally stored in spreadsheets such as Microsoft Excel or databases such as Microsoft Access).
It is often necessary or useful to transfer files between the IBM iSeries (AS/400) and PCs and Linux/Unix systems, but the different file organisations described above often make such transfers complicated and painful.
This article described some approaches to simplify the work.


2. IBM useful commands
The IBM AS/400 uses an integrated file system (IFS) that allows to use on the same server different file organisations such as those used by Linux/Unix or Windows and the native AS/400 ones. The native AS/400 files are stored in libraries or DB2 collections within the QSYS.LIB. Other file systems exist in the QOpenSys (similar to Unix) or the QDLS (used to store documents and files in PC formats) environments.
The IFS allows to use on the same server Linux/Unix based applications together with the native AS/400 applications.
The AS/400 Operating system provides some useful commands to simplify the data interchanges between different file systems as described below:

  • CPYFRMIMPF to copy data from IFS to the AS/400 database system
  • CPYTOIMPF to copy data from the AS/400 database system to IFS
  • CPYFRMSTMF to copy stream files into AS/400 database files
  • CPYTPSTMF to copy AS/400 database files to stream files
  • CPYTOPCD to copy AS/400 database files to PC documents, stored in the QDLS folders
  • CPYFRMPCD to copy PC documents in the QDLS folders into AS/400 database files

The CPYTOPCD and CPYFRMPCD commands are specific for the QDLS system and have not many options whereas the other ones allow to use many options and are more flexible. They look similar, but there are important differences as follows:
CPYFRMSTMF converts text files (stream files that are in text format) to physical files. It has no concept of fields, so it can only write records to program described files (i.e. files that have no fields defined) or source pfs.
CPYFRMIMPF converts text files as well, but it tries to interpret fields in the input file and copy them to the appropriate fields in the output file. You can either import delimited fields (for example, comma separated value (CSV) files, tab-delimited files, pipe delimited files, etc) or you can read input from fixed-position fields (you have to define the record layout in a "field definition file")
An example of the second command is the following:

CPYFRMIMPF FROMSTMF('/Fldr1/File1.CSV') TOFILE(Lib1/FILE3) MBROPT (*REPLACE) RCDDLM(*CRLF) DTAFMT(*FIXED) FLDDFNFILE(Lib1/FILE4)

The example above uses a fixed data format (i.e. not delimited) and uses a field definition file (FILE4) to describe the text file fields as follows:
- This is comment
- DBFieldname startpos endpos nullIndpos
field1 1 12 13
field2 14 24 0
field3 25 55 56
field4 78 89 90
field5 100 109 0
field6 110 119 120
field7 121 221 0
*END

The above would be needed to import the text file data into a DB file with field names of: FIELD1, FIELD2, FIELD3,..., and FIELD7. The *END is required. I think you can leave off the third column if no fields are null capable.



3. Some User Utilities
The commands above are useful and normally perfectly adequate, but they can be complex especially when the data fields to be copied are not in the same sequence or when one wants to extract only some data from the text file.
I was involved in a few system migration exercises where such copies between Unix, PCs and AS/400 systems had to be done frequently and I developed therefore some utilities to simplify these activities.
The utilities have the objective to satisfy following requirements:

  • Support of any separator character used to delimiter the fields
  • Possibility to copy valid data into fields defined as alphanumeric, numeric or packed numeric
  • Possibility to copy data stored in different sequences in the two files. For instance it should be possible to copy fields 1, 3,4 and 6 of the text file into the fields 5, 2, 1 and 4 of the target database file.
  • The utility should be able to store the file fields mappings (such as those described above) to allow the user to simply use the previously entered mapping.

I organised the utilities in a few commands and programs as follows:

a) Command UCPYFTP to control the copy between two files. The command requires to enter following parameters:

Copy FTP file to AS400 DB file (UCPYFTP)


AS400 DB File . . . . . . . . . TOFILE
AS400 Library . . . . . . . . . TOLIB *LIBL
AS400 Member . . . . . . . . . . TOMBR *FIRST
FTP File . . . . . . . . . . . . FROMFILE
FTP Library . . . . . . . . . . FROMLIB
Field Separator £T=TAB] . . . . SEPARATOR ']'
Decimal Point . . . . . . . . . DECPOINT '.'
View Field Mappings (Y/N) . . . VIEWMAP 'N'
Up to Record No. . . . . . . . . UPTOREC 0



End



b) Program UFMA01L to display and maintain existing file mappings.

The display looks as follows:



UFMAP30 MAPPING FILE MAINTENANCE 9/03/09 12:42:54

AS400 Database File: WERCSWKF FTP File: WERCS

Seq AS400 Fld Description Typ Len D From
No. Name FldNo
1 WK0003 WK_CLIENTE A 9 3
2 WK0004 WK_CLI_SAP A 10 4
3 WK0005 WK_RAGSOC A 40 5
4 WK0006 WK_ZIP A 5 9
5 WK0016 WK_ADDRESS1 A 100 17
6 WK0017 WK_ADDRESS2 A 100 19
7 WK0101 WK_INDI A 30 0
8 WK0102 WK_CAP A 5 0
9 WK0103 WK_LOC A 25 0
10 WK0104 WK_PROV A 2 0
F3=Exit F6=Update Mappings F9=Use sequential mapping F11=Process



The screen shows that field number 3 of the FTP file is copied to the first field of the database file called WK0003, field 4 is copied to WK0004 and so on.

The fields for which the number is zero are not copied, but are initialised correctly in the target file (with zeros or blanks).
Notice following points:
  • The file to be copied is called FTP file because normally is sent to the AS/400 by using an FTP transfer.
  • The user must specify the name and library of both the FTP file and the target AS/400 database file.
  • The commands use some defaults for the field separator and decimal point, but these can be changed by the user.
  • When the View Field Mappings parameter is set to 'Y', the user will see previously defined field mappings or enter new mappings.
  • When the user invokes the command for the first time on a new couple of ftp and target files, the program extracts the field definitions of the database file and displays the mapping screen to allow the user to enter the field mappings which are then stored to allow a future re-use.


A similar utility called UCPYTOFTP allows to copy the data from an AS/400 database file to a text file to be downloaded to a Linux/Unix or Windows machine.
The Utilities and their documentation can be downloaded for free from the downloads page of my website http://www.datamission.co.uk/.

The programs are free software that can be redistributed and/or modified it under the terms of the GNU General Public Licence as published by the Free Software Foundation.



P.S. The article was originally published on http://www.ezinearticles.com

Web Services With Cobol Or RPG on IBM ISeries

1. Introduction
Web Services and SOAP (or REST) are rapidly becoming state-of-art architectural approaches to allow the access of multiplatform and multilanguage systems,
Many companies have legacy applications which represent a high investment and Web Services promise to allow their access from the web without extensive modifications.
2. An Introduction to Web Services
Web services consist of a group of standards intended to make it possible for diverse systems to communicate, without requiring a particular type of middleware, programming language or even operating system. They can be based on SOAP, REST or XML-RPC,.
SOAP is an open source message standard, based on an XML dictionary, that uses standard transport protocols widely used over the Internet such as HTML or SMTP. It represents a paradigm shift in the way applications communicate with each other, because it does not require any special middleware to allow diverse applications to communicate. The messages are text based and accessible by any application over the network. They are described by using a special XML based language called WSDL.
REST is a simpler type of Web Service where the user simply accesses a URL to obtain back an XML document without any standard specification.
XML-RPC is a way to send commands to another system by using and XML document.
Web service allow to develop loosely coupled applications, by allowing systems based on different technologies and languages to communicate by using open standard largely based on XML.

3. Consuming Web Services from Cobol or RPG
If you need to access a Web Service from a Cobol or RPG program, you can use the IBM Web Services Client for C++ toolkit.
It uses extenal data structures to define the mappings between elements of an XML document and fields usable in Cobol or RPG applications and allows to generate C or C++ functions which can be called by the Cobol or RPG program to invoke the web service. The generation is based on the WSDL file which describes the Web service.
4, Exposing Legacy programs in Cobol or RPG as Web Services

If you want to access legacy Cobol or RPG programs as Web Services, you can use the IBM Toolbox for Java or JTOpen to develop a Java Web Service which calls the Cobol or RPG program and return the results as a SOAP message.
It allows to develop clients in Java or other languages to call legacy Cobol or RPG program and return the results as XML messages according to the Web services specifications.
5. Using PHP with Web Services
PHP has recently been ported to the IBM iSeries systems.
PHP has a good support for Web Services and SOAP especially in the PHP 5 version.
Notice the PHP services can call also call programs written in other languages such as Cobol or RPG and therefore PHP can be an alternative to the approach of the previous point.
6. DB2 Web Services
Data in relational database can be accessed though end-user queries in SQL or other interfaces or by applications that use programming interfaces such as JDBC and SQLJ.
DB2 allows also to use Web services to query the database and to obtain the results as standard SOAP messages.
7. References.

You will find plenty of useful information and tutorials on the above techniques and tools at the URL http://www.ibm.com/developerworks

P.S The article has been originally on http://www.ezinearticles.com

Tuesday 27 January 2009

IBM iSeries (AS/400) SQL Performance

Recently I had the opportunity to test the execution time of programs which access very large files. I wrote traditional file oriented programs and equivalent ones which use instead embedded SQL.

The results are quite interesting and I have written a report which describes the tests and the results.

It shows also that a good use of SQL indexes and views can have significant benefits on the execution times.

The article was originally published on http://www.ezinearticles.com

You can read the full report at http://www.datamission.co.uk/SQLPerformance.html