Wednesday 12 June 2013

How to find a string in a directory inside a file in LINUX

How to find a string in a directory inside a file in LINUX?

I liked this command and hence sharing and its very effective for searching for a text in a directory.
grep <search string> *

Sunday 14 April 2013

Remove ^M characters at end of lines in vi

UNIX treats the end of line differently than other operating systems. When editing files in either Windows or UNIX environments, a CTRL-M character is visibly displayed at the end of each line as ^M in vi.

To remove the ^M characters at the end of all lines in vi, use:
:%s/^V^M//g

The ^v is a CONTROL-V character and ^m is a CONTROL-M. 

In UNIX, you can escape a control character by preceding it with a CONTROL-V. 

The :%s is a search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). 
The g at the end directs vi to search and replace globally (all occurrences).

Alternately you can use dos2unix command to convert as well

Sunday 29 August 2010

Legacy Modernization


What do you mean by Legacy Modernization?

This is the basic question asked by many today. For some legacy Modernization means moving of the Legacy Applications like Mainframe, VB, etc to newer technology like SOA, Web services, JAVA, .NET, Oracle HRMS, etc. This was basically what people used to think. Even Clients used to consider the same and used to slowly tread their path into such a venture. Though they knew that the transformation process will be a very costly and time consuming activity but, even then every IT division of a company used to consider this because of the high TCO for mainframe, niche skill set and loosing of old and trusted programmers from their company.

Every IT division of a company whether it’s a retailer or Banking is always least budgeted, since that’s not their core business. But everyone knows at their backdrop that the systems are old and they would have to change those to meet newer challenges of modern Industry. New Technologies that will require less maintenance cost but will give same throughput like the Mainframes. Many Architects would have analyzed various software, packages, etc to come to a conclusion which would be easy to implement, robust and cost effective. But in all cases such transformation we have seen takes roughly 2 to 3 years to implement. And by the time they get implement the vendor support for that package or software is not there and its time to upgrade as well. And not forgetting the cost incurred for such a transformation, and it would have gone past all expectations. And then when we start comparing the Cost VS Benefit ratio, we would have found only after 5 or 6 years they would start getting profit. (I mean the cost of implementation, migration and support for next 6 years VS the cost that the client would have incurred if they would have allowed the application to run for another 6 years in mainframe).

So basically for any Service Industry personnel it was a very tough job to make the client believe in such a transformation. And also for the Client it was a very tough job to accept such a proposal and go for it.

What is Re-hosting?

In legacy Modernization framework, apart from the above mentioned solutions just discussed there is another very new thought process that has come up. I should not say new but yes this is the talk of the Industry currently. That’s re-hosting.

Re-hosting is nothing but a ‘Lift and Shift Approach’. Here a legacy application is moved out of mainframe and run on Windows or UNIX or Linux platform with minimal or no changes. “Sounds very new right, and unbelievable as well”

But yes that’s true your COBOL programs, JCL batch jobs, Online CICS transactions are running in Windows/Unix/Linux platform. Almost all normal Mainframe utilities, sort jobs, etc. are running. So this is what is called the essence of Re-Hosting. With Minimal changes to an application it gets moved to distributed platform. Typically this takes not more than 6 or 8 months depending upon the portfolio of applications migrating and their complexity. Many people have a notion that at the backend it must to interacting with the mainframe. But its not true, really mainframe is no more there.

Now the Million Dollar Question is how is this possible?

Currently in the market there are couple of solutions that various companies have come up with like – Fujitsu, Clerity solutions, Micro Focus, Oracle Tuxedo 11gR2, etc.

They have their own emulation middleware that supports CICS programs and JCL streams in open system environment. This in turn eliminates the need of converting them into another technology.

The only thing that worries people now is whether the application will run as is without any performance bottleneck in open System. Currently these are addressed by proper load balancing mechanism and trust me it works, and at times it works faster than mainframe.

The other thing that needs to be kept in mind is that not all Mainframe languages are supported in these solutions. Other mainframe languages needs to be converted to COBOL and databases to DB2 UDB, Oracle, SQL Server, etc. For this there are numerous tools that are available in the market which can do such conversion.

Following are a typical migration phases that a Re-hosting project undergoes –

  1. Evaluation Phase – Here the application Portfolio is analyzed, proper estimates are done, Project Plan are created and timelines are shared
  2. Re-Hosting - During this time the application is re-hosted to open system environment, in-compatible components are re-engineered either by tool based or manually, and tested.
  3. Integration Testing, System Testing and UAT
  4. Deployment
  5. Post Production Support

Depending upon the size and complexity of the application portfolio a typical migration project gets implemented within 6 to 8 months.

And the most important thing cost vs benefit ratio, when checked, we have found that in most cases in 2 to 3 years time the client starts realizing the profit from their IT expenditure.

Tuesday 1 June 2010

Microsoft Virtual PC / VMware Player

“Run multiple operating systems at the same time on the same computer, that's the need of time”
Virtual PC /
VMware Player lets you run multiple operating systems at once on a single physical computer and switch between them as easily as switching applications—instantly, with a mouse click. Virtual PC is perfect for any scenario in which you need to support multiple operating systems, whether you use it for tech support, legacy application support, training, or just for consolidating physical computers. Often you will come across scenarios wherein you would require to run something on Linux, but you have a windows machine. At that time you have to install Linux log into that OS. Now when you require windows log off Linux and log into Windows. Gone are those days, its a matter of ALT-TAB now

After installing Virtual PC, you can configure it to suit your requirements. Its simple to install.


Users now can switch between operating systems as easily as they switch between applications.

Users can copy, paste, drag, and drop between guest and host. Virtual PC provides additions that you install in a guest operating system to enable this functionality.

For step by step installation and use, one can refer to the following website - http://www.pcreview.co.uk/articles/Windows/Run_Linux_in_Windows/

Monday 28 December 2009