Wednesday, March 21, 2018

How Does Volume Manager Work?


With Volume Manager, you enable virtual data storage by bringing a disk under Volume Manager control. To bring a disk under Volume Manager control means that Volume Manager creates virtual objects and establishes logical connections between those objects and the underlying physical objects, or disks.
When a disk is brought under Volume Manager control:
  1. Volume Manager removes all of the partition table entries from the VTOC, except for partition table entry 2 (backup slice). Partition table entry 2 contains the entire disk, including the VTOC, and is used to determine the size of the disk.
Note: The boot disk is a special case and is discussed in a later lesson.
  1. Volume Manager then rewrites the VTOC and creates two partitions on the physical disk. One partition contains the private region, and the other contains the public region.
    • Private region: The private region stores information, such as disk headers, configuration copies, and kernel logs, that Volume Manager uses to manage virtual objects. The private region represents a small management overhead.
The minimum size for the private region is 1024 sectors (512K) for disks with active configuration databases, but VxVM uses 2048 sectors (1024K) by default. This default value is rounded up to the next cylinder boundary.
The maximum size for the private region is 524288 blocks (512K sectors).
    • Public region: The public region consists of the remainder of the space on the disk. The public region represents the available space that Volume Manager can use to assign to volumes and is where an application stores data. Volume Manager never overwrites this area unless specifically instructed to do so.
By convention, the public region of a Volume Manager-controlled disk is referred to as a Volume Manager disk, or VxVM disk. The true definition of a VxVM disk is a Volume Manager-controlled disk.
  1. Partition Tags: VxVM sets the partition tags, the numeric values that describe the file system mounted on a partition, for the public and private regions:
    • Tag 14 is always used for the public region of the disk.
    • Tag 15 is always used for the private region of the disk.
If the disk has no partitions that are being placed under Volume Manager control, then Volume Manager creates the private region first, and the public region second, on the disk.
  1. Volume Manager updates the VTOC with information about the removal of the existing partitions and the addition of the new partitions during the initialization process.


Source: VERITAS Volume Manager Fundamentals I
ERITAS Volume Manager Fundamentals I

Tuesday, March 20, 2018

Physical Disk Naming for SAN

We can  locate and access the data on a physical disk by using a device name that specifies the controller, target ID, and disk number. 

A typical device name uses the format: c#t#d#.
  • c# is the controller number. 
  • t# is the target ID. 
  • d# is the logical unit number (LUN) of the drive attached to the target. 

If a disk is divided into partitions, then we also specify the partition number in the device name:
s# is the partition (slice) number. 

For example, device name c0t0d0s1 is connected to controller number 0 in the system, with a target ID of 0, physical disk number 0, and partition number 1 on the disk.

Thursday, March 15, 2018

Python Libraries needed for scientific computations and data analysis

To import a library, we can do that in below ways:

import math as m

from math import *

In the first manner, we have defined an alias m to library math. We can now use various functions from math library (e.g. factorial) by referencing it using the alias m.factorial().

In the second manner, you have imported the entire name space in math i.e. you can directly use factorial() without referring to math.


Tip: Google recommends that you use first style of importing libraries, as you will know where the functions have come from.

NumPy stands for Numerical Python. The most powerful feature of NumPy is n-dimensional array. This library also contains basic linear algebra functions, Fourier transforms,  advanced random number capabilities and tools for integration with other low level languages like Fortran, C and C++

SciPy stands for Scientific Python. SciPy is built on NumPy. It is one of the most useful library for variety of high level science and engineering modules like discrete Fourier transform, Linear Algebra, Optimization and Sparse matrices.

Matplotlib for plotting vast variety of graphs, starting from histograms to line plots to heat plots.. You can use Pylab feature in ipython notebook (ipython notebook –pylab = inline) to use these plotting features inline. If you ignore the inline option, then pylab converts ipython environment to an environment, very similar to Matlab. You can also use Latex commands to add math to your plot.

Pandas for structured data operations and manipulations. It is extensively used for data munging and preparation. Pandas were added relatively recently to Python and have been instrumental in boosting Python’s usage in data scientist community.

Scikit Learn for machine learning. Built on NumPy, SciPy and matplotlib, this library contains a lot of effiecient tools for machine learning and statistical modeling including classification, regression, clustering and dimensionality reduction.

Statsmodels for statistical modeling. Statsmodels is a Python module that allows users to explore data, estimate statistical models, and perform statistical tests. An extensive list of descriptive statistics, statistical tests, plotting functions, and result statistics are available for different types of data and each estimator.

Seaborn for statistical data visualization. Seaborn is a library for making attractive and informative statistical graphics in Python. It is based on matplotlib. Seaborn aims to make visualization a central part of exploring and understanding data.

Bokeh for creating interactive plots, dashboards and data applications on modern web-browsers. It empowers the user to generate elegant and concise graphics in the style of D3.js. Moreover, it has the capability of high-performance interactivity over very large or streaming datasets.

Blaze for extending the capability of Numpy and Pandas to distributed and streaming datasets. It can be used to access data from a multitude of sources including Bcolz, MongoDB, SQLAlchemy, Apache Spark, PyTables, etc. Together with Bokeh, Blaze can act as a very powerful tool for creating effective visualizations and dashboards on huge chunks of data.

SymPy for symbolic computation. It has wide-ranging capabilities from basic symbolic arithmetic to calculus, algebra, discrete mathematics and quantum physics. Another useful feature is the capability of formatting the result of the computations as LaTeX code.


Scrapy for web crawling. It is a very useful framework for getting specific patterns of data. It has the capability to start at a website home url and then dig through web-pages within the website to gather information.

Requests for accessing the web. It works similar to the the standard python library urllib2 but is much easier to code. You will find subtle differences with urllib2 but for beginners, Requests might be more convenient.

Wednesday, March 14, 2018

jupyter notebook commands

To start jupyter:

jupyter-navigator

To get the list of running jupiter instance:

jupyter notebook list

To set password for the jupiter instead of temporary token id:

jupyter notebook password

Monday, March 12, 2018

Difference between compiled and interpreted language

The difference is not in the language; it is in the implementation.


In a compiled implementation, the original program is translated into native machine instructions, which are executed directly by the hardware.


In an interpreted implementation, the original program is translated into something else. Another program, called "the interpreter", then examines "something else" and performs whatever actions are called for. Depending on the language and its implementation, there are a variety of forms of "something else". From more popular to less popular, "something else" might be


Binary instructions for a virtual machine, often called bytecode, as is done in Lua, Python, Ruby, Smalltalk, and many other systems (the approach was popularized in the 1970s by the UCSD P-system and UCSD Pascal)

A tree-like representation of the original program, such as an abstract-syntax tree, as is done for many prototype or educational interpreters

A tokenized representation of the source program, similar to Tcl

The characters of the source program, as was done in MINT and TRAC


One thing that complicates the issue is that it is possible to translate (compile) bytecode into native machine instructions. Thus, a successful intepreted implementation might eventually acquire a compiler. If the compiler runs dynamically, behind the scenes, it is often called a just-in-time compiler or JIT compiler. JITs have been developed for Java, JavaScript, Lua, and I daresay many other languages. At that point you can have a hybrid implementation in which some code is interpreted and some code is compiled.




Advantages of the compiled languages

  • Speed
  • Native applications are secured
  • Large softwares are written in Compiled Languages
  • Reflection is not impossible 
  • Interoperability is possible with .NET, Java and Python