Thursday, June 14, 2012

NFS Mount Steps and Troubleshooting Most Common Errors

How to NFS mount between two computers ?

Source Machine:  Physical location of folder

Target Machine:    Mounted location pointing to the source physical location

SOURCE and TARGET MACHINE

1 )   Installed nfsd from respective package manager like yast,apt ..etc on both the systems

2 )   Check mtab to mount the nfsd in /proc/fs/nfsd

SOURCE MACHINE

3 )   Edit the /etc/export at the source server from which needs to be shared

Syntax
                 Folder Path     IP-Address (rw,sync,no_subtree_check)

# Folder Path which you want to share
# IP-Address of Target machinge

4 )   check if /etc/export changes refreshed "exportfs or exportfs -a" at source computerd

TARGET MACHINE

5 )  Backup the current /etc/fstab like cp /etc/fstab /etc/fstab.bak

6)   Edit the fstab file as shown below  

        IP-Address:Source-Path Destination-Path nfs rw,sync 0 0da

IP-Address : Source Machine  IP

Source Path: Physical location of file

Destination : Mount location

6 )   mount /Destination-Path

TROUBLESHOOTING

a) If the message while mounting is "nfs version not supported"

  /etc/init.d/nfsserver status  -- if this says unused or not started, Please start it using the below command

    /etc/init.d/nfsserver start 

The above command should say nfs services started

b) If the message is "permission denied"

Make sure that /etc/exports entries are correct , and dont forget to type exportfs to reflect the changes on Source machine which will export source folder to target machine

c) If Already mounted and facing issues in re-mouting then try to unmount the existing folder though its not mounted as shown below

umount Destination-folder

mount Destination-Folder

Some time it works like charm 

d) nfsstat should display some nfs server information, else there some prob in installation/starting nfsserver goto step a

Monday, June 11, 2012

How to Multiply two numbers without using +,- or * Operator



Multiplication is nothing but repeated addition, so as long as you could figure out a way to add two numbers, then repeating them will also provide you product of two numbers.

Since, Python is the best language, I am giving the solution in Python only.

import sys
def recurse(a,b):
  x = a^b
  y = a&b
  if y:
     return recurse(x,y<<1)
  else:
     return x

if __name__ == '__main__':
   a = int(raw_input("Enter value of 'a' --> "))
   b = int(raw_input("Enter value of 'b' --> "))

   product=0
   for i in range(0,b):
       product=recurse(product,a)
   print repr(a) + " x " + repr(b) + " = " + repr(product)

Internally this uses bitwise operations.

----
For more info please contact me at rakeshkumar.techie@gmail.com



Happy Programming -- Happy Hacking

Monday, June 4, 2012

Code for Cause - New Delhi ( www.gdg-hack.com )

Coding For Cause , Isn't it sounds exiting? yes, you heard it right. If you are looking to code for cause then here is a right platform. Google Developer Group (GDG) - New Delhi is launching hack fest on 16 and 17 of June 2012.

Choose a theme from http://www.gdg-hack.com/home.php and register yourself(team) at Rs 350* only. (*Registration fee may be increased to 500 Rs later)

Can I code on my own theme ?
yes, enter your own theme under "others" and proceed.

What languages can be used ?
you are free to use any open source languages or technologies.

For more info and updates visit www.gdg-hack.com









               

Friday, June 1, 2012

Hacktivists want Internet curbs to go


Hackers named anonymous are launching a DOS and DDOS attack on various websites which are supporting the internet censorship.

*DOS   : Denial of Service
*DDOS: Distributed Denial of Service

Read more from the below URL

http://www.thehindu.com/todays-paper/tp-national/article3474885.ece