Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

Monday, September 7, 2015

Installing and Using Ruby Interactive Shell on Windows

      Ruby is dynamic,interpreted, object oriented programming languages which is one of the easiest programming language to learn and with Rails its just might be the best web development option at the moment. Ruby intsallation is pretty much simple in windows, Linux and you don't have to install Ruby on Mac. It already has Ruby installed in it.

   Step by step guide to install Ruby on your PC:
  1. Go to Ruby programming language homepage: https://www.ruby-lang.org/en/
  2. Click downloads
  3. Click on Installation-->click on RubyInstaller(Windows)-->Ruby installer-->Download
  4. Select the top selection there that will be the current version of Ruby 
  5. Click save file. let it download
  6. Now double click the file-->accept license agreement-->Install-->finish.

Using Ruby Interactive Shell 

        The interactive shell  or just a shell allows us to type Ruby statements or expressions at the command line and gives immediate result. So open the command prompt and navigate to the folder where Ruby is installed and type "irb".


On ruby shell single number evaluates itself. We can perform simple arithmetic operations the ways show above screenshot. Strings also evaluate to them self, We can perform concatenation operation between two strings using '+' operator as shown below :


     
         We can also store data in variables and use it later as shown in below "greet' is variable which stores value "good morning". After typing good morning it returns "good morning".


   We can also concatenation "greet" with other value 


    We can write more complicated expressions in ruby shell. We can create functions for example square function in bellow example. Here I wrote my own user define "sqr" function to find square of a number.
 
   
     If you have good understanding of function you not even have to write return statement. lets consider following function for addition of two numbers. In which I wrote add method for addition of two numbers when next time I write add(2,2)  it performs addition of these two numbers which is 2+2=4.



Friday, September 5, 2014

Downloading and installing MongoDB on windows

        Downloading and installing MongoDB is very simple and easy. Before you download MongoDB for your Windows you should know which version of Windows you’re using and to run MongoDB on your system also make sure that you’re using windows newer version than Windows XP.
    To check which version of Windows your using enter following command in terminal:-
wmic os get osarchitecture
It will show your windows architecture as shown in below image:-







Downloading and installing MongoDB involves following three steps:-
1.     Download zip file
2.     Extract the file
3.     Setup the environment 



Sunday, February 3, 2013

Logical Volume Management In Ubuntu



Logical Volume Management (LVM) is a disk management option that every major Linux distribution includes. Whether you need to set up storage pools or just need to dynamically create partitions, LVM is probably what you are looking for.

                      
                                         Fig1: Logical Volume Management
 What is LVM?

Logical Volume Manager allows for a layer of abstraction between your operating system and the disks/partitions it uses. In traditional disk management your operating system looks for what disks are available (/dev/sda, /dev/sdb, etc.) and then looks at what partitions are available on those disks (/dev/sda1, /dev/sda2, etc.).



Fig2: LV  Manager

With LVM, disks and partitions can be abstracted to contain multiple disks and partitions into one device. Your operating systems will never know the difference because LVM will only show the OS the volume groups (disks) and logical volumes (partitions) that you have set up.
Because volume groups and logical volumes aren’t physically tied to a hard drive, it makes it easy to dynamically resize and create new disks and partitions. In addition, LVM can give you features that your file system is not capable of doing. For example, Ext3 does not have support for live snapshots, but if you’re using LVM you have the ability to take a snapshot of your logical volumes without unmounting the disk.

When To Use LVM?

The first thing your should consider before setting up LVM is what you want to accomplish with your disks and partitions. Some distributions, like Fedora, install with LVM by default.
If you are using Ubuntu on a laptop with only one internal hard drive and you don’t need extended features like live snapshots, then you may not need LVM. If you need easy expansion or want to combine multiple hard drives into a single pool of storage then LVM may be what you have been looking for.

Setting up LVM in Ubuntu

First thing to know about using LVM is there is no easy way to convert your existing traditional partitions to logical volumes. It is possible to move to a new partition that uses LVM, but that won’t be something that we will cover in this article; instead we are going to take the approach of setting up LVM on a fresh installation of Ubuntu 11.10.To install Ubuntu using LVM you need to use the alternate install CD. Download it from the link below and burn a CD or use unetbootin to create a USB drive.

 Fig3: Ubuntu Edition Screen

Boot your computer from the alternate install disk and select your options up until the partition disks screen and select guided – use entire disk and set up LVM.

 Fig4: Partition Disks 

Select the main disk you want to use, typically your largest drive, and then go to the next step.

 Fig5: Disk to Partition

You will immediately need to write the changes to disk so make sure you selected the right disk and then write the changes.

 Fig6: Changes Screen

Select the size you want the first logical volume to be and then continue.

 Fig7: Partitioning Disks

Confirm your disk partitions and continue with the installation.
 Fig8: Changes Screen

The final step will write the GRUB boot loader to the hard drive. It is important to note that GRUB cannot be on an LVM partition because computer BIOS’s cannot directly read from a logical volume. Ubuntu will automatically create a 255 MB ext2 partition for your boot loader.

  Fig9: GBL Installation Permission Screen

After the installation is complete, reboot the machine and boot into Ubuntu as normal. There should be no perceivable difference between using LVM or traditional disk management with this type of installation.


Fig10: Final Completion Screen

This is how the LVM is installed on UBUNTU Linux.