Sunday, October 16, 2011

Oracle IAS SSL "Page Cannot be Displayed" error on IE

I have been strugling for a while trying to figure out a strange issue with a SSL certificate. The web site in concern runs on Oracle IAS and the SSL certificate is setup on oracle wallet manager. It was previously configured to use a self-signed certificate and it worked on all the browsers (IE, FireFox, Chrome, etc...). However, after setting up a VeriSign EV certificate the web site did not load on some Windows XP IE browsers (IE6, IE7 and IE8). All the other browsers did not have any problem loading the web site. My first guess was that it was an issue with Microsoft patches related to VerSign EV (Extended Validation) since the web site was loaded after installing all the windows patches on the PC's that had the issue. Yet, as the website was accessed by outsiders we had to find a solution that does not require any changes to client computers. Thanks to google, I found the below document which described the exact problem and the solution.

Monday, July 18, 2011

Enabling VNC on Centos/Redhat

Few of my friends asked how to enable VNC access to Linux servers (RHEL/CENTOS). Therefore, I thought it would be helpful to provide the easiest way I figured out to configure VNC server.

1. open a ssh session to the server

2. vi /etc/sysconfig/vncservers
uncomment  the lines that starts with VNCSERVERS= and VNCSERVERARGS[2]
modify the user ID with the user ID you wish to provide access ("root"). exit vi editor.

3. enter vncpasswd and provide a password for VNC access

4. Start and stop VNC Server so that the xstartup file will get created.
enter vncserver :2 to start VNC Server
enter vncserver -kill :2 to kill the vnc server

5. vi xstartup
uncomment the 2 lines that start with unset SESSION... and exec /etc...

6. enter /sbin/chkconfig vncserver on command to start the service on boot.

7. open a VNC client and enter the <IP>:2 then you'll ask for the password set under step 3. 

Monday, July 11, 2011

Extending VLAN cpabilities to VMWare

I have been looking for a solution to have multiple VLANs on the VMWare ESXi server. The server which was allocated to the VMs had only 4 NIC's and we had to setup virtual servers from 5 VLANs. The solution was described in the VMWare ESXi documentation as well. The terminology is called VST (Virtual Switch Tagging).

Since we had 4 NIC ports we connected 3 links from the switch as trunk ports (dot1q, need to make the switch configuration) initially. The other port is kept for the VMWare ESXi management access. This is important to setup the VST in the ESXi server via the vSphere client. Once the ESXi is setup you can include this port also to the NIC load balance team. Following is the list of activities to perform.

Connect to the ESXi server via vSphere Client
Select the server from the left pane and Navigate to the configuration tab
Click on networking under hardware pane
Then click properties > select the VM Network and hit edit
On General tab, change VLAN ID to All(4095)
Navigate to NIC Teaming tab and tick the load balancing and select the first option from the drop down list
Click OK and exit
Now click on Add and create VLAN ID's for Virtual Machine traffic for each VLAN (You need to get the VLAN ID's from the network personnel)

Now you can assign these to relevant virtual machine for connectivity to their respective VLAN's

VMWare P2V conversion Windows XP Activation issue

We were executing a plan to convert all our physical windows XP boxes that are kept inside the server room for various non critical operations on to virtual hosts. At one point we were looking at consolidation options. However, due to the complexity and lack of documentation on implementing the systems made us go into a virtualization option. The physical virtual transition was some what smooth with VMware vCenter Converter Standalone Client (free version). The main challenge we faced was the windows activation issue once the virtual host is started. It didn't allow us to login to the computer at all and we were at a dilemma.

Fortunately, I was able to find a solution for the issue. The reason we faced this issue is due to the OEM licenses installed on the physical machines. When the HW was changed the license need to be reactivated which created a need to purchase licenses. Once the license was purchased we had to follow the following to activate windows,

On the virtual host
Login to the Safe mode
execute the following command on run,
rundll32.exe syssetup,SetupOobeBnk
reboot the host
now you have 30 days to activate windows......

Thursday, May 19, 2011

Automating windows Backups with error reporting

Most organizations are tryng to move out from NTbackup for better managed backup software solutions. However, the legacy software applications and the cost involved in implementing a managed backup solution have forced the organizations to use ntbackups.

One of the biggest challenges faced in automating ntbackup is the error reporting functionality. By default, ntbackup does not support error handling. In otherwords, it cannot execute set of instructions upon error. Therefore, a workaround is necessary to overcome the situation. I was thinking all possible solutions and felt the following as the best suitable solution,

Read the backup log file and count the number of "Backup completed" text. "Backup completed" is written to the logfile for each folder/drive backup item it backups. Therefore, if the count is not equal to the number of folder/drive backup items you could come to a conclusion that there is some issue with the backup.

Following is a sample backup script used for the automation,
@echo off
echo %date% %time%

echo Initiate backup job
C:\WINDOWS\system32\ntbackup.exe backup "@C:\SCRIPTS\DAILY.bks" /t "Friday_File_SVR_BKP" /n "Friday_File_SVR_BKP" /d "Friday_File_SVR_BKP" /v:no /r:no /rs:no /hc:on /SNAP:off /m normal /j "Friday_File_SVR_BKP" /l:s

echo Copy last backup job log to a seperate folder for the emailing purpose.
set srcDir=C:\Documents and Settings\itops\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\
set destdir=C:\Scripts
set lastmod=
pushd "%srcDir%"
for /f "tokens=*" %%a in ('dir /b /od 2^>NUL') do set lastmod=%%a
if "%lastmod%"=="" echo Could not locate files.&goto :eof
echo "%lastmod%"
copy "%lastmod%" "%destDir%"\backup.log

echo if the backup job is unsuccessful send the log via email (7 is the count of backup items)
for /f "tokens=3" %%f in ('find /c /i "Backup completed" "C:\Scripts\backup.log"') do set isComplete=%%f
if %isComplete% LSS 7 C:\Scripts\sendEmail.exe -f <from email> -t <to email> -s -u <email subject withing quotes> -m <email body withing quotes> -a "C:\Scripts\backup.log"

echo %date% %time%
echo ----------END------------

Hope the article will help you to save your valuable time spent going through the logs to ensure the backup is successful !!! Cheers!!!

Sunday, May 8, 2011

Sri Lanka's two of the giant mobile service providers introduce 4G

4G is the fourth generation of cellular wireless standards. It is a successor to the 3G.

Technological advancement is a key determinant of countries economic growth.

Monday, May 2, 2011

Command Line tool for image conversion

I have been looking for a command line freeware to convert images in a folder. After an extensive google search I found an amazing tool. It can convert, compress and have great features. You could download the tool from the following web site.

Monday, April 18, 2011

Sri Lanka launches

This web site will display the Sri Lanka's Standard time. The main objective behind this valuable initiative is to minimize difficulties faced due to contradicting times displayed by organizations in the country.

Lets configure our organizations websites, PC, servers, etc... to sync with ntp server.

Follow the following steps in an windows active directory environment.

  1. First, Locate your Primary Domain Controller (PDC). Open the command prompt and type, netdom /query fsmo (Netdom is a ntreskit tool which can be downloaded FOC)
  2. Log in to your PDC Server.
  3. Check time difference between your server and the NTP server w32tm /stripchart / /samples:5 /dataonly
  4. Stop the W32Time service: net stop w32time
  5. Configure the external time source/s, type w32tm /config    /syncfromflags:manual / /Update
  6. Make the PDC a reliable time source, type w32tm /config /reliable:yes
  7. Start the w32time service, type net start w32time
    The windows time service will begin synchronizing the time. You could query the details trough w32tm /query /peers, w32tm /query /status commands.
  8. Optionaly execute w32tm /resync to do an immediate sync
  9. Check the Event Viewer for any errors.

Note: You might have to add/modify firewall rule/s to allow ntp access to from your network.

Congratulations !!! You are now in sync with the ntp server.

Monday, April 11, 2011

How to format a report in MS word 2007/2010

For the benefit of my MBA friends, I thought of writing an article on how to create table of contents (TOC) and use of page numbering for different sections in a report. (Steps are for MS Office 2007, I believe it’s the same for Office 2010)

1. Prepare the styles for the headings

On the home tab, in the styles group right click on heading 1 and click modify to open the Modify Style dialog box, change the formatting of the heading from here (Font, font size, etc...). If you want to have numbering for the headings (ex: 1. Introduction, 2. Literature Survey, 3. Critical Evaluation, etc...), click on format, click numbering and select a appropriate numbering format. Click OK to apply the settings.

Follow the same procedure for rest of the sub headings (Heading 2, heading 3, heading 4, and the list goes on)

If a heading style is not shown in the style group on the home tab, suppose if heading 3 is not shown, click on the down most arrow (refer below screen-shot, button inside red colour square shape) and click apply style. Type the style name you want, in this case Heading 3, click modify for formatting and modify the formatting as you wish.

2. Change text styles of the headings

Select the text you wish to make as a heading and select the appropriate heading type from the styles group on the home tab. Repeat this procedure for all the headings in your report.

3. Insert Table of Contents

Once you have marked all the headings with appropriate styles, click on the beginning of the report, on the page layout tab, in the page setup group, click on breaks and select next page option. 

Then on the reference tab, click on table of contents click on insert table of contents, if you wish you could do formatting for the table of content from here. Click OK to create the table of contents.

Once the table of contents is created, you could right click on it, click Update field, select entire table and click OK to update the TOC with what ever the changes you make after the first creation.

4. Format page numbers differently in different sections of a document

Suppose if you were to use roman numerals for the page numbering before introduction page (Title page, Table of contents, etc…) and use Arabic numerals for rest of the pages.

Since a section break was inserted before creating the table of contents, now there are two sections in the report.

On the insert tab, in the header and footer group click on page number and select format page numbers. Then select Roman numeral format.  Again click on page number and select bottom of page and choose a format, on the design tab, navigation group click on next section and then click on link to previous

Then click on the page number again in the header and footer group, click on format page numbers, select Arabic number format, select start at option and type 1 and click OK, click close Header and footer to exit from designer.

5. Insert a title page

On the insert tab, in the pages group, click on Cover Page and select a suitable design. Enter details as you wish.

Congratulations you have done it !!!!

Thursday, April 7, 2011

IE 8 issue running oracle forms application with jinitiator

I have been having trouble with IE 8 with our company's main application which runs on oracle forms with jinitiator. After an extensive google search, i was able to find a much needed workaround and a solution.

Workaround - Replace the C:\Program Files\Oracle\JInitiator <version>\bin\hotspot\jvm.dll with Sun's JRE version C:\Program Files\Java\jre <version>\bin\client\jvm.dll (these folder location are the default ones, change it to suite your environment. Make a backup before you replace).

How ATMs Work?

This is a very interesting process, initially I didn’t have a clue about how an ATM works. The technology behind the machine is pretty simple except the security concepts behind it. I will not go into the details of security techniques in this article perhaps on another.
Here’s how the process flows,

There are two main categories of transactions initiated from an ATM,
ONUS – Card and ATM from same financial institute (Ex: HSBC ATM card on HSBC Bank’s ATM)
OFFUS – Card and ATM from different financial institutes (Ex: HSBC VISA enabled ATM card on Standard charted VISA enabled ATM)

Detailed transaction flow of an ATM (ATM screen flow could change from ATM to ATM. Therefore this is a generic flow almost all ATMs are based on) 
  1. ONUS -Customer inserts a card to the ATM > Enters the PIN > transaction > select the account > enter other required details for the transaction (Ex: for a withdrawal, withdrawal amount)Then a message will be generated and sent to the ATM switch (PIN is encrypted) > ATM switch will send the encrypted PIN to the HSM > HSM will respond whether its correct or not > If the PIN is incorrect transaction will get voided and the customer will be asked to enter the PIN again > If the PIN is correct the transaction will be forwarded to the Core Banking System >  The Core Banking System will check the customer account and approve or disapprove the transaction > if the transaction is disapproved a message will be shown on the ATM screen, mostly a descriptive message > if the transaction is approved the switch will instruct the ATM how to proceed (Ex: for a withdrawal the switch will tell the ATM to dispense number of bill from Bins). Apart from the above process there will be additional messages between the ATM machine and the ATM switch. This is to get a list of accounts attached for the card. This is not available in OFFUS transactions. Therefore, customers will be able to transact from their primary accounts only (One account for Savings and one account for current)
  2. OFFUS-Another banks customer inserts a ATM card > The ATM switch will forward the transaction to VISA network > the VISA network will do the necessary currency conversions and forward it to the issuing bank

mget new files from a FTP

The following batch script will get new files from a ftp server. 

The actual scenario is, 
A file is generated from application server A and needs to be uploaded to application server B. 

Flow of the operation,
  1. Create a ftp connection to application server A
  2. Generate a list of files to upload to application server B
  3. Dynamically generate a ftp script to mget and rename each file. (This is required as ftp doesn't allow rename or move with wild cards)
  4. Backup logs and files transferred for debug purposes

echo "=================Begin======================"

echo %date% %time%
Rem Connect to the ftp server and get a list of files to be transfered.

Rem The following command with execute the commands in "list_of_commands.txt" text file on the x.x.x.x ftp server. Refer List of commands heading below for a sample.
echo Generate a list of files to transfer.
ftp -s:list_of_commands.txt x.x.x.x > ftp.log

Rem Following will check the size of the file. If there is no data (no file listed) the size is zero.
echo check whether there are any files to transfer. If no files to transfer delete temporary files.
FOR /F "usebackq" %%A IN ('filelist.txt') DO set size=%%~zA
if %size% EQU 0 (
    echo No file to transfer. Deleting temporary files
    del ftplist.txt
    del ftp.log
    goto :eos
    echo Files found to be transferred to Swift.

Rem The following will generate a ftp script dynamically based on the file list.
echo Generate ftp command file to transfer swift msgs.
>copy_FTP_Files.txt echo username
>>copy_FTP_Files.txt echo password
>>copy_FTP_Files.txt echo cd directory path
>>copy_FTP_Files.txt echo prompt n
>>copy_FTP_Files.txt echo ascii or binary
Rem The following for script will go through the list of files names in the filelist text file and generate mget and rename commands.
for /f %%U in (filelist.txt) do (
>>copy_FTP_Files.txt echo mget %%U
>>copy_FTP_Files.txt echo rename %%U %%U.sent
>>copy_FTP_Files.txt echo bye

execute command to upload file to application B

Rem Execute ftp commands generated from the above step.
Echo Execute the dynamically generated ftp commands on the ftp connection.
ftp -s:copy_FTP_Files.txt x.x.x.x >> ftp.log

Rem Backup files for debug purposes.
echo Create a folder based on date time
SET DD=%DATE:~7,2%
SET MM=%DATE:~4,2%
SET HH=%TIME:~0,2%
SET MN=%TIME:~3,2%
SET SS=%TIME:~6,2%

mkdir folder path\%FOLDER%

echo Move swift files copied to fromsymbols drirectory to the folder created with current date and time.
move list of files mget to
folder path\%FOLDER%
move ftplist.txt folder path\%FOLDER%
move ftp.log folder path\%FOLDER%
move copy_FTP_Files.txt folder path\%FOLDER%

echo %date% %time%
Echo "=================end======================"

Wednesday, April 6, 2011

I believe experience is education !!!

Experience is the best teacher what do you think?

Shell Script to get a data file based on date via FTP

FTP from a AIX server and get a file based on date. Cool scripted tested extensively. It works like a charm.

TIME=$(date +%k%M)
DAY=`/bin/date +%Y%m%d`
echo $DAY
echo "File name to pick " $file_name

src_user="user name"
dir_path="Directory path of the file to pick"


ftp -n $src_ip << EndFTP
user $src_user $src_password
cd $dir_path
mget $file_name