Different ways of calling a perl script from another

August 27, 2013

Perl has a number of possibilites to execute other scripts / commands:

  • backticks / qx{} When you want to read all the output at once after the program has terminated
  • exec When you wan’t to continue your process as another program — never returns if succesfull
  • system When you are only interested in the success or failure of the command
  • open When you want to pipe information to or from the command
  • do and require Execute another Perl script here. Similar to C’s #include
  • There are modules to do a three-way open so that you have access to STDINSTDOUT and STDERRof the program you executed. See the apropriate parts of perlipc for advanced information.

Commonly used tests on files in shell scripting

August 13, 2013

Here are some commonly used tests:

   -d FILE
          FILE exists and is a directory
   -e FILE
          FILE exists
   -f FILE
          FILE exists and is a regular file
   -h FILE
          FILE exists and is a symbolic link (same as -L)
   -r FILE
          FILE exists and is readable
   -s FILE
          FILE exists and has a size greater than zero
   -w FILE
          FILE exists and is writable
   -x FILE
          FILE exists and is executable
   -z STRING
          the length of STRING is zero

Top level Union is not supported currently; use a subquery for the union : Error

August 1, 2013
select c1, c2 from cert.tset1 tset1 union all select c1, c2 from cert.tset2 


select * from ( select c1, c2 from cert.tset1 tset1 union all select c1, c2 
from cert.tset2 tset2 ) T 


Difference between HBase and HDFS ?

April 30, 2013

HDFS is a distributed file system and has the following properties:
1. It is optimized for streaming access of large files. You would typically store files that are in the 100s of MB upwards on HDFS and access them through MapReduce to process them in batch mode.
2. HDFS is optimized for use cases where you write once and read many times like in the case of production logs. You can append to files in some of the recent versions but that is not a feature that is very commonly used. There is no concept of random writes.
3. HDFS doesn’t do random reads very well.

HBase on the other hand is a distributed column oriented database. The filesystem of choice typically is HDFS owing to the tight integration between HBase and HDFS. Having said that, it doesn’t mean that HBase can’t work on any other filesystem. It’s just not proven in production and at scale to work with anything except HDFS.
HBase provides you with the following:
1. It gives you the ability to do random read/writes on your data which HDFS doesnt allow you to.
2. HBase stores data in the form of key value pairs in a columnar fashion. HBase provides a flexible data model.
3. Fast scans across tables.
4. Scale in terms of writes as well as total volume of data.

An analogous comparison would be between MySQL and Ext4.

Difference between server consolidation and server virtualization

May 22, 2012

Server consolidation is reducing the number of servers by combining workloads into a smaller number of systems.
Server virtualization involves decoupling the business logic from hardware functionality, so that multiple servers can be emulated on one hardware platform.

July 1, 2009

Researchers in Yale Univerity have created the first rudimentary solid quantum processor.