R Tips

6 Nov

Convert a Factor Column in Data Frame to numeric

//seq(27,5179,23) columns to be converted to numeric

Dummy[, seq(27,5179,23)] <- sapply(Dummy[, seq(27,5179,23)], as.numeric)

Dummy[, seq(27,5179,23)] <- sapply(Dummy[, seq(27,5179,23)], as.numeric)

Dummy[, seq(27,5179,23)] <- sapply(Dummy[, seq(27,5179,23)], as.numeric)

Open MPI Installation

8 Apr
  • Download Open MPI tar file from HERE
  • unzip it
  • Navigate to the unzipped directory, and type the following
  • ./configure –prefix=/usr/local/openmpi
    make
    make install

  • It will take a while. No need to panic !!!
  • Setting up Environment Variables

  • Add the following environment variable to your ~/.bashrc (if you are using bash) or ~/.tcshrc (if you are using tcsh), where /usr/local is the installation directory:
  • bash:
    export MPI_DIR=/usr/local/openmpi
  • tcsh:
    setenv MPI_DIR /usr/local/openmpi
  • Adding OpenMPI to your Path

    You will also need to add OpenMPI to your path. To view your PATH, type the following:
    echo $PATH
    This will probably look something like PATH=/usr/bin:/bin:/usr/local/bin, which is a list of ‘:’ separated directories of where commands can be executed from without typing the full path. To add OpenMPI to your path add the following to your ~/.bashrc or ~/.tcshrc file (where /usr/local/openmpi is the path where your MPI implementation was installed):
    linux:
    export PATH=/usr/local/openmpi/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/openmpi/lib:$LD_LIBRARY_PATH
    macs:
    export PATH=/usr/local/openmpi/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/openmpi/lib:$LD_LIBRARY_PATH
    export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH

    Hadoop Stand alone Installation

    18 Sep

    Prerequisites

    1)ssh
    2)java
    3) Downloaded hadoop stable release from Apache mirror sites

    Edit
    conf/hadoop-env.sh

    change the line export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
    to point to version 1.6.0 of Java. On Ubuntu, the equivalent line is:
    export JAVA_HOME=/usr/lib/jvm/java-6-sun

    30 Jan

    Locations of visitors to this page

    EUCALYPTUS CLOUD SET UP-IMAGE CREATION

    7 May

    Installing the Eucalyptus Node Service on a running Ubuntu system consists of doing the following on one or more systems:

    1. Install Ubuntu 9.10 Server
    2. Update to the most current state in the Ubuntu archive:
      sudo apt-get update
      sudo apt-get dist-upgrade
    3. Install the eucalyptus-nc package
      sudo apt-get install eucalyptus-nc
    4. Configure the system’s primary ethernet interface as a bridge. The node controller will attach virtual network interfaces to this bridge for VM that is started before it to enable network connectivity.
      • Note: Remember the name of your node’s bridge device (we assume the name of your bridge device is “br0″ for the rest of this document).
      • For details on configuring a bridge, see: http://doc.ubuntu.com/ubuntu/serverguide/C/network-configuration.html
      • The following script should configure your bridge correctly in most setups:
        interface=eth0
        bridge=br0
        sudo sed -i "s/^iface $interface inet \(.*\)$/iface $interface inet manual\n\nauto br0\niface $bridge inet \1/" /etc/network/interfaces
        sudo tee -a /etc/network/interfaces <<EOF
                bridge_ports $interface
                bridge_fd 9
                bridge_hello 2
                bridge_maxage 12
                bridge_stp off
        EOF
        sudo /etc/init.d/networking restart
    5. Configure /etc/eucalyptus/eucalyptus.conf with the name of the bridge, and restart the node controller:
      sudo sed -i "s/^VNET_BRIDGE=.*$/VNET_BRIDGE=$bridge/" /etc/eucalyptus/eucalyptus.conf
      sudo /etc/init.d/eucalyptus-nc restart
      • Note that there are several ways to configure a node to have a bridge as its primary interface, depending on the configuration of your machine. We show an example set of steps here but you will need to take care to ensure that this example configuration does not conflict with your local configuration if you wish to use it.
    6. Finally, you need to install the Cloud Controller’s eucalyptus user’s public ssh key into the Node Controller’s eucalyptus user’s authorized_keys file. The easiest way to do this:
      • On the Node Controller, temporarily set a password for the eucalyptus user:
        sudo passwd eucalyptus
      • Then, on the Cloud Controller:
        sudo -u eucalyptus ssh-copy-id -i ~eucalyptus/.ssh/id_rsa.pub eucalyptus@<IP_OF_NODE>
      • You can now remove the password of the eucalyptus account on the Node:
      sudo passwd -d eucalyptus
    • Run the ubuntu-vm-builder command:
      ubuntu-vm-builder xen karmic \
      --addpkg vim \
      --addpkg openssh-server \
      --rootsize 1024

      This will create a 1GB image based on Karmic Koala, adding the vim and openssh-server packages.
    • Bundle, upload, and register the resulting root.img file to Eucalyptus:
      euca-bundle-image -i ubuntu-xen/root.img
      euca-upload-bundle -b ubuntu -m /tmp/root.img.manifest.xml
      euca-register ubuntu/root.img.manifest.xml

    How to restart init.d scrips manually

    7 May

    To restart apache2

    sudo /etc/int.d/apache2 restart

    sudo /etc/init.d/ssh restart

    sudo  /etc/init.d/mysql restart

    Hanuman chalisa ..my strength

    10 Apr

    Any body who has experienced the power of hanuman chalisa will agree to it that its the most soothing and energising tonic to the mind..The strength u receive by chanting these lines are boundless

    Sri Guru Charan Saroj Raj, Nij Man Mukar Sudhari,
    Barnau Raghuvar Bimal Jasu, Jo dayaku Phal Chari

    With the dust of Guru’s Lotus feet, I clean the mirror of my mind and then
    narrate the sacred glory of Sri Ram Chandra, The Supreme among the Raghu
    dynasty. The giver of the four attainments of life.

    Budhi heen Tanu Janike, Sumirow, Pavan Kumar,
    Bal Buddhi Vidya Dehu Mohi, Harahu Kalesh Bikaar

    Knowing myself to be ignorant, I urge you, O Hanuman, The son of Pavan! O
    Lord! kindly Bestow on me strength, wisdom and knowledge, removing all my
    miseries and blemishes
    .

    Jai Hanuman Gyan Guna Sagar
    Jai Kapis Tihun Lok Ujgaar

    Victory of Thee, O Hanuman, Ocean of wisdom and virtue, victory to the Lord of
    monkeys who is well known in all the three worlds

    Ramdoot Atulit Bal Dhamaa,
    Anjani Putra Pavansut naamaa.

    You, the Divine messager of Ram and repository of immeasurable strength, are also
    known as Anjaniputra and known as the son of the wind – Pavanputra.

    Mahebeer Bikram Bajrangi,
    Kumati Nivaar Sumati Ke Sangi.

    Oh Hanumanji! You are valiant and brave, with a body like lightening. You are the
    dispeller of darkness of evil thoughts and companion of good sense and wisdom.

    Kanchan Baran Biraaj Subesaa,
    Kanan kundal kunchit kesa.

    Shri Hanumanji’s physique is golden coloured. His dress is pretty, wearing
    ‘Kundals’ ear-rings and his hairs are long and curly.

    Hath Bajra Aur Dhvaja Birjai,
    Kandhe Moonj Janeu saage.

    Shri Hanumanji is holding in one hand a lighting bolt and in the other a banner
    with sacred thread across his shoulder.

    Shankar Suvna Kesari Nandan,
    Tej Pratap Maha Jag Vandan.

    Oh Hanumanji! You are the emanation of ‘SHIVA’ and you delight Shri Keshri.
    Being ever effulgent, you and hold vast sway over the universe. The entire
    world proptiates. You are adorable of all.

    Vidyavaan Guni Ati Chatur,
    Ram Kaj Karibe Ko Atur

    Oh! Shri Hanumanji! You are the repository learning, virtuous, very wise and
    highly keen to do the work of Shri Ram,

    Prabhu Charittra Sunibe Ko Rasiya,
    Ram Lakhan Sita man basyia.

    You are intensely greedy for listening to the naration of Lord Ram’s lifestory and
    revel on its enjoyment. You ever dwell in the hearts of Shri Ram-Sita and Shri
    Lakshman.

    Sukshma roop Dhari Siyahi Dikhwana,
    Bikat roop Dhari Lank Jarawa

    You appeared beofre Sita in a diminutive form and spoke to her, while you
    assumed an awesome form and struck terror by setting Lanka on fire.

    Bhim roop Dhari Asur Sanhare,
    Ramchandra Ke kaaj Savare.

    He, with his terrible form, killed demons in Lanka and performed all acts of Shri
    Ram.

    Laye Sajivan Lakhan Jiyaye,
    Shri Raghubir harashi ur laye.

    When Hanumanji made Lakshman alive after bringing ‘Sanjivni herb’ Shri Ram
    took him in his deep embrace, his heart full of joy.

    Raghupati Kinhi Bahut Badaai,
    Tum Mama Priya Bharat Sam Bahi.

    Shri Ram lustily extolled Hanumanji’s excellence and remarked, “you are as dear
    to me as my own brother Bharat”

    Sahastra Badan Tumharo Jas Gaave,
    Asa kahi Shripati Kanth Laagave.

    Shri Ram embraced Hanumanji saying:
    “Let the thousand – tongued sheshnaag sing your glories”

    Sankadik Brahmadi Muneesa,
    Narad Sarad Sahit Aheesa

    Sanak and the sages, saints. Lord Brahma, the great hermits Narad and
    Goddess Saraswati along with Sheshnag the cosmic serpent, fail to sing the
    glories of Hanumanji exactly

    Jam Kuber Digpal Jahan Te,
    Kabi Kabid Kahin Sake Kahan Te

    What to talk of denizens of the earth like poets and scholars ones etc even Gods
    like Yamraj, Kuber, and Digpal fail to narrate Hanman’s greatness in toto.

    Tum Upkar Sugrivahi Keenha,
    Ram Miali Rajpad Deenha

    Hanumanji! You rendered a great service for Sugriva, It were you who united
    him with SHRI RAM and installed him on the Royal Throne.

    Tumharo Mantro Bibhishan Maana,
    Lankeshwar Bhaye Sab Jag Jaana.

    By heeding your advice. Vibhushan became Lord of Lanka, which is known all
    over the universe.

    Juug Sahastra Jojan Par Bhaanu,
    Leelyo Taahi Madhur Phal Jaanu

    Hanumanji gulped, the SUN at distance of sixteen thousand miles considering
    it to be a sweet fruit.

    Prabhu Mudrika Meli Mukha Maaheen,
    Jaladhi Langhi Gaye Acharaj Naheen.

    Carrying the Lord’s ring in his mouth, he went across the ocean. There is no
    wonder in that.

    Durgam Kaaj Jagat Ke Jeete,
    Sugam Anugrah Tumhre Te Te.

    Oh Hanumanji! all the difficult tasks in the world are rendered easiest by your
    grace.

    Ram Duware Tum Rakhavare,
    Hot Na Aagya Bin Paisare.

    Oh Hanumanji! You are the sentinel at the door of Ram’s mercy mansion or His
    divine abode. No one may enter without your permission.

    Sab Sukh Lahen Tumhari Sarna,
    Tum Rakshak Kaahu Ko Darnaa.

    By your grace one can enjoy all happiness and one need not have any fear under
    your protection.

    Aapan Tej Samharo Aapei,
    Tanau Lok Hank Te Kanpei

    When you roar all the three worlds tremble and only you can control your might.

    Bhoot Pisaach Nikat Nahi Avei,
    Mahabir Jab Naam Sunavei.

    Great Brave on. Hanumanji’s name keeps all the Ghosts, Demons & evils spirits
    away from his devotees.

    Nasei Rog Hare Sab Peera,
    Japat Niranter Hanumant Beera

    On reciting Hanumanji’s holy name regularly all the maladies perish the entire
    pain disappears.

    Sankat Te Hanuman Chhudavei,
    Man Kram Bachan Dhyan Jo Lavei.

    Those who rembember Hanumanji in thought, word and deed are well guarded
    against their odds in life.

    Sub Par Ram Tapasvee Raaja,
    Tinke Kaaj Sakal Tum Saaja

    Oh Hanumanji! You are the caretaker of even Lord Rama, who has been hailed as
    the Supreme Lord and the Monarch of all those devoted in penances.

    Aur Manorath Jo Koi Lave,
    Soi Amit Jivan Phal Pave.

    Oh Hanumanji! You fulfill the desires of those who come to you and bestow
    the eternal nectar the highest fruit of life.

    Charo Juung Partap Tumhara,
    Hai Parsiddha Jagat Ujiyara.

    Oh Hanumanji! You magnificent glory is acclaimed far and wide all through the
    four ages and your fame is radianlty noted all over the cosmos.

    Sadho Sant Ke Tum Rakhvare,
    Asur Nikandan Ram Dulare.

    Oh Hanumanji! You are the saviour and the guardian angel of saints and sages
    and destroy all the Demons, you are the seraphic darling of Shri Ram.

    Ashta Siddhi Nau Nidhi Ke Data,
    Asa Bar Din Janki Mata.

    Hanumanji has been blessed with mother Janki to grant to any one any YOGIC
    power of eight Sidhis and Nava Nidhis as per choice.

    Ram Rasayan Tumhare Pasa,
    Sadaa Raho Raghupati Ke Dasa.

    Oh Hanumanji! You hold the essence of devotion to RAM, always remaining His
    Servant.

    Tumhare Bhajan Ramko Pavei.
    Janam Janam Ke Dukh Bisravei.

    Oh Hanumanji! through devotion to you, one comes to RAM and becames free
    from suffering of several lives.

    Anta Kaal Raghubar Pur Jai,
    Jahan Janma Hari Bhakta Kahai.

    After death he enters the eternal abode of Sri Ram and remains a devotee of
    him, whenever, taking new birth on earth.

    Aur Devata Chitt Na Dharai,
    Hanumant Sei Sarva Sukh Karai

    You need not hold any other demigod in mind. Hanumanji alone will give all
    happiness.

    Sankat Kate Mitey Sab Peera,
    Jo Sumirei Hanumant Balbeera

    Oh Powerful Hanumanji! You end the sufferings and remove all the pain from
    those who remember you.

    Jai Jai Jai Hanuman Gosai
    Kripa Karahu Gurudev Ki Naiee

    Hail-Hail-Hail-Lord Hanumanji! I beseech you Honour to bless me in the
    capacity of my supreme ‘GURU’ (teacher).

    Jo Sat Baar Paath Kar Koi,
    Chhutahi Bandi Maha Sukh Hoi.

    One who recites this Hanuman Chalisa one hundred times daily for one hundred
    days becames free from the bondage of life and death and ejoys the highest
    bliss at last.

    Jo Yah Padhe Hanuman Chalisa,
    Hoy Siddhi Sakhi Gaurisa

    As Lord Shankar witnesses, all those who recite Hanuman Chalisa regularly are
    sure to be benedicted

    Tulsidas Sada Hari Chera,
    Keeje Nath Hriday Mah Dera.

    Tulsidas always the servant of Lord prays. “Oh my Lord! You enshrine within my
    heart.!

    Chopai

    Pavan Tanay Sankat Haran, Mangal Murti Roop.
    Ram Lakhan Sita Sahit, Hriday Basahu Sur Bhoop.

    O Shri Hanuman, The Son of Pavan, Saviour The Embodiment of
    blessings, reside in my heart together with Shri Ram, Laxman and Sita

    Follow

    Get every new post delivered to your Inbox.