How to install NFS (Network File System) server in Linux Mint?

The Network File System (NFS) protocol was developed by Sun Microsystems in 19841. NFS builds over Open Network Computing Remote Procedure Call, commonly called SUN ONC.

Step 1: Install NFS server and associated applications on the Linux Mint desktop.

Issue the command: #sudo apt-get install nfs-kernel-server nfs-common portmap

Step 2: Configure the NFS Server.

NFS exports from a server are controlled by the file /etc/exports. Each line begins with the absolute path of a directory to be exported, followed by a space-seperated list of allowed clients.

For example: To export the /var/nfs directory so that it can be accessed by any client, please insert the below line into /etc/export.
/var/nfs * (ro,async,subtree_check)

Note: Allowing any client to access your box can be potentially harmful. Please reconsider your decision before doing so.

To allow access to machines with a particular set of IP addresses, please insert the below line in /etc/export.
/var/nfs 192.168.1.1/24 (ro,async,subtree_check)

Other options that can specified along with the IP address include:

ro:

The directory is shared read only; the client machine will not be able to write it. This is the default.

rw:

The client machine will have read and write access to the directory.

no_root_squash:

If no_root_squash is specified, then root on the client machine will have the same level of access to the files on the system as root on the server. This can have serious security implications. You should not specify this option without a good reason.

no_subtree_check:

If only part of a volume is exported, a routine called subtree checking verifies that a file that is requested from the client is in the appropriate part of the volume. If the entire volume is exported, disabling this check will speed up transfers.

sync

By default, all but the most recent version (version 1.11) of the exportfs command will use async behavior, telling a client machine that a file write is complete – that is, has been written to stable storage – when NFS has finished handing the write over to the filesystem. This behavior may cause data corruption if the server reboots, and the sync option prevents this.

References


1.  “Design and Implementation of the Sun Network Filesystem“. USENIX. 1985.

2. RFC 3530 – NFS Version 4 Protocol Specification.

3. Linux NFS Overview, FAQ and How-To documents.

Disclaimer


All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

a user on a client computer to access files over a network in a manner similar to how local storage is accessed
Reblog this post [with Zemanta]
Advertisements

Synchronise Nokia 5800 with Google (Calendar and Contacts)

Finally, I have successfully synced my Nokia 5800 contacts and calendar with Google calendar and contacts respectively.

Here are the list of steps that I followed.

  • The Mail for Exchange application should be installed in Nokia 5800 in order to sync with Google.
  • On completion of the installation, please navigate to ‘Applications‘ on the Nokia 5800 menu and choose ‘Mail for Exchange‘.
  • On the first run, the application would ask you to set up the ‘Exchange server profile‘.
  • Choose ‘Yes’ and set up the profile settings as follows:
    • Exchange server name: m.google.com
    • Secure connection: Yes
    • Port Number: 443 (should be the default one)
    • Domain: leave blank
    • Username: your-id@gmail.com
    • Password: your password
  • Please disable the Tasks and Mail, otherwise it may not work at all; also please change the settings for Contacts and Calendar so the contacts and events currently on your phone are not wiped out when you first synchronize the device.

Couple of points to remember

  • Google may not be charging you to access Google products from a mobile phone, but depending on your service plan, you may be charged by your mobile provider for text message or data network usage. Check with your provider for more information about fees associated with accessing the Internet from your mobile phone.

Reference

Disclaimer

All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]

English Grammar – What are ‘Parts of Speech’?

English is a extremely beautiful and flexible language. A word meaning is derived from how it is used in a sentence along with it’s spelling and pronounciation.

Several words are put together to form a sentence which has certain meaning. This sentence can be termed as a speech. Hence, the words in the sentence form the parts of the speech.

The parts of speech are classified into eight types, namely:

  1. Adjectives
  2. Adverbs
  3. Conjunctions
  4. Interjections
  5. Nouns
  6. Prepositions
  7. Pronouns
  8. Verbs

Reference

Disclaimer

All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]

My quest for knowledge – English Grammar

I have always liked English as a language. I have been studying English since my school days. Now, after all these years, I want to refine my knowledge of English Grammar.

I have finalized to kick-start my quest for knowledge of English Grammar with ‘Parts of Speech‘. To make sure that I do not loose track during the process of learning, I have planned to write a blog post after learning each parts of speech, starting with ‘Adjectives’.

Please wish me all the best in my quest!

Thank you.

Reblog this post [with Zemanta]

How to find latitude and longitude of a location in Google Maps?

Step 1:

Open the Google Maps website (http://maps.google.com/) and key-in the location details in the search box.

Google Maps - Search Box

Step 2:

Select the location in the search results for which the latitude and longitude are to be identified.

2. Choose desired location within the search results

Step 3:

Zoom-in as much as possible and right click on the exact location for which latitude and longitude are to be identified. Then, please choose the ‘Center map here‘ option displayed in the pop-up menu.

3. Choose the center map here option

Step 4:

On the address bar of your browser, key-in the below javascript code.

javascript:void(prompt('',gApplication.getMap().getCenter()));

This will display the latitude and longitude of the location in question within a dialog box as portrayed in the image below.

4. Javascript code

Step 5:

An alternative method to identify the latitude and longitude is to click on the ‘Linkhyperlink on the right top corner of the Google Map sub-frame and glance at the contents displayed in the text box below the label – ‘Paste link in email or IM‘ (as shown in the image below).

5. Click the 'Link' hyperlink on the right top corner

Disclaimer

All data and information provided on this site is for informational purposes only. Niether sks8.wordpress.com nor skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]

How to reset forgotten root password in Linux?

The root password for the Linux system can be reset by booting it into the Single User mode which is also termed as Emergency mode or more popularly known as Rescue mode.

If the boot loader installed on your Linux system is GRUB, then please follow the below listed steps to reset the root password.

  • Select the line which specifies the kernel to be loaded.
  • Press the ‘e’ key to edit the entry.
  • Choose second line (the line starting with the word kernel).
  • Press the ‘e’ key again to edit kernel entry
  • Append the letter ‘S’ or word ‘single’ to the end of the line.
  • Press the [ENTER] key
  • Press the ‘b’ key to boot the Linux kernel into single user mode

After the booting process completes, mount the ‘/’ and ‘proc’ partitions using the below listed commands.

# mount -t proc proc /proc
# mount -o remount,rw /

Issue the 'passwd' command to change the root password.

Finally, reboot the system employing the below commands.
# sync
# reboot

If the boot loader installed on your Linux system is not GRUB but LILO, then please follow the below mentioned steps to reset the root password.

  • At the Boot: prompt displayed by the LILO boot loader, type linux single and press the [ENTER] key:
  • Allow the system boot and when it displays the # prompt, type passwd to reset the root password.
  • Finally, reboot the system by issuing sync followed by the reboot command.

Disclaimer

All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]

What is the difference between exit() and _exit() system call?

Should I employ exit(int status) or _exit(int status) to exit() from a child process? Does this question haunt you quite often? If so, this post is for you.

The exit() method which is part of the C library routines calls the kernel system call _exit() internally.

The responsibility of the kernel system call _exit() includes asking the kernel to close any open descriptors, free the memory used by the process and perform terminating process clean-up. Whereas the exit() call takes care of flushing the I/O buffers and perform additional clean-up before invoking _exit() internally.

In simpler words, exit() performs clean-up related to user-mode constructs in the library, and calls user-supplied cleanup functions whereas _exit() performs only the kernel level cleanup for the process.

It’s always advisable to use _exit(int status) in a child because employing exit(int status) can lead to stdio buffers being flushed twice, and temporary files being unexpectedly removed.

Finally, exit(int status) is defined in stdio.h and _exit(int status) is defined in unistd.h file.

Disclaimer

All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]

How to obtain hostname from IP address in Linux?

Today, I fell in need of identifying the host name (also termed as ‘DNS name‘) based on the IP address for one of my Linux Box. My first try was using 'ping -a' command. But that failed to satisfy my requirement.

Domain names, arranged in a tree, cut into zon...
Image via Wikipedia

If you ever come across the situation where 'ping -a' does not provide you with the host name of the box, then you can try any of the below mentioned methods to satisfy the requirement.

Method 1: Using the 'host' command

One of the simplest way to retrieve host name from IP address is employing the 'host' command provided by GNU/Linux.
Syntax for the host command: $>host <ip-address> <nameserver>
Example:

testhost:~ # host 209.85.231.104
104.231.85.209.in-addr.arpa domain name pointer maa03s01-in-f104.google.com.
testhost:~ #

Method 2: Using the 'nslookup' command

nslookup is a command used to query the Internet Domain Name servers.

Example:
nslookup 209.85.231.104
Server:  72.163.128.140
Address: 72.163.128.140#53


Non-authoritative answer:
104.231.85.209.in-addr.arpa    name = maa03s01-in-f104.google.com.


Authoritative answers can be found from:
231.85.209.in-addr.arpa    nameserver = ns1.google.com.
231.85.209.in-addr.arpa    nameserver = ns3.google.com.
231.85.209.in-addr.arpa    nameserver = ns4.google.com.
231.85.209.in-addr.arpa    nameserver = ns2.google.com.
ns3.google.com    internet address = 216.239.36.10
ns4.google.com    internet address = 216.239.38.10
ns2.google.com    internet address = 216.239.34.10
ns1.google.com    internet address = 216.239.32.10

Method 3: Using the 'dig' command
As per the Linux man pagedig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried.

Disclaimer

All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]

How to Learn Freestyle Swimming?

It has 18 days since been I joined a swimming course on August 6, 2009. It has been a great experience till date. Based on my learning experience so far, I have come up with an algorithm that can be followed to learn swimming. The view and the method presented below is purely based on my personal opinion and experience. It does not comply to any standards. Please read the disclaimer section at the end of this post for further clarification.

Step 1: Practice holding your breath and learn to float in Water.

  • Anything that has air trapped inside can float. A cork floats in water since it has air trapped in it. Similarly, humans can float if they hold their breath.
  • The trainer should illustrate a simple demonstration of the face-down float and float by wrapping the arms around the knees and holding the breath for five seconds.
  • Demonstration of the “dead man’s float” with the arms out like an airplane and the face down in the water can be an added advantage.
  • The learner is expected to imitate the trainer after the demonstrations.

Example of the dead mans float method

Example of the dead man's float method (Image source: P.Gordon's photostream on Flickr)

Another image illustrating the dead mans float (Image source: garlinggauge.com)

Another image illustrating the dead man's float (Image source: garlinggauge.com)

Please note, the learner should never be left unattended at the swimming pool.

The video listed below by Peter Elizondo provides an elaborated view of step 1.

(more…)

Description of HTML Response Status Codes returned from a Server

1xx status codes

100 (Continue) The requestor should continue with the request. The server returns this code to indicate that it has received the first part of a request and is waiting for the rest.
101 (Switching protocols) The requestor has asked the server to switch protocols and the server is acknowledging that it will do so.

2xx status codes indicate that the server successfully processed the request.

200 (Successful) The server successfully processed the request. Generally, this means that the server provided the requested page. If you see this status for your robots.txt file, it means that Googlebot retrieved it successfully.
201 (Created) The request was successful and the server created a new resource.
202 (Accepted) The server has accepted the request, but hasn’t yet processed it.
203 (Non-authoritative information) The server successfully processed the request, but is returning information that may be from another source.
204 (No content) The server successfully processed the request, but isn’t returning any content.
205 (Reset content) The server successfully proccessed the request, but isn’t returning any content. Unlike a 204 response, this response requires that the requestor reset the document view (for instance, clear a form for new input).
206 (Partial content) The server successfully processed a partial GET request.

3xx status codes indicates that further action is needed to fulfill the request. Most often, these status codes are used for redirection.

300 (Multiple choices) The server has several actions available based on the request. The server may choose an action based on the requestor (user agent) or the server may present a list so the requestor can choose an action.
301 (Moved permanently) The requested page has been permanently moved to a new location. When the server returns this response (as a response to a GET or HEAD request), it automatically forwards the requestor to the new location.
302 (Moved temporarily) The server is currently responding to the request with a page from a different location, but the requestor should continue to use the original location for future requests. This code is similar to a 301 in that for a GET or HEAD request, it automatically forwards the requestor to a different location.
303 (See other location) The server returns this code when the requestor should make a separate GET request to a different location to retrieve the response. For all requests other than a HEAD request, the server automatically forwards to the other location.
304 (Not modified) The requested page hasn’t been modified since the last request. When the server returns this response, it doesn’t return the contents of the page.
305 (Use proxy) The requestor can only access the requested page using a proxy. When the server returns this response, it also indicates the proxy that the requestor should use.
307 (Temporary redirect) The server is currently responding to the request with a page from a different location, but the requestor should continue to use the original location for future requests. This code is similar to a 301 in that for a GET or HEAD request, it automatically forwards the requestor to a different location.

4xx status codes indicate that there was likely an error in the request which prevented the server from being able to process it.

400 (Bad request) The server didn’t understand the syntax of the request.
401 (authentication error) The page requires authentication.
403 (Forbidden) The server is refusing the request.
404 (Not found) The server can’t find the requested page. For instance, the server often returns this code if the request is for a page that doesn’t exist on the server.
405 (Method not allowed) The method specified in the request is not allowed.
406 (Not acceptable) The requested page can’t respond with the content characteristics requested.
407 (Proxy authentication required) This status code is similar to 401 but specifies that the requestor has to authenticate using a proxy. When the server returns this response, it also indicates the proxy that the requestor should use.
408 (Request timeout) The server timed out waiting for the request.
409 (Conflict) The server encountered a conflict fulfilling the request. The server must include information about the conflict in the response. The server might return this code in response to a PUT request that conflicts with an earlier request, along with a list of differences between the requests.
410 (Gone) The server returns this response when the requested resource has been permanently removed. It is similar to a 404 (Not found) code, but is sometimes used in the place of a 404 for resources that used to exist but no longer do.
411 (Length required) The server won’t accept the request without a valid Content-Length header field.
412 (Precondition failed) The server doesn’t meet one of the preconditions that the requestor put on the request.
413 (Request entity too large) The server can’t process the request because it is too large for the server to handle.
414 (Requested URI is too long) The requested URI (typically, a URL) is too long for the server to process.
415 (Unsupported media type) The request is in a format not support by the requested page.
416 (Requested range not satisfiable) The server returns this status code if the request is for a range not available for the page.
417 (Expectation failed) The server can’t meet the requirements of the Expect request-header field.

5xx status codes indicate that the server had an internal error when trying to process the request. These errors tend to be with the server itself, not with the request.

500 (Internal server error) The server encountered an error and can’t fulfill the request.
501 (Not implemented) The server doesn’t have the functionality to fulfill the request. For instance, the server might return this code when it doesn’t recognize the request method.
502 (Bad gateway) The server was acting as a gateway or proxy and received an invalid response from the upstream server.
503 (Service unavailable) The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.
504 (Gateway timeout) The server was acting as a gateway or proxy and didn’t receive a timely request from the upstream server.
505 (HTTP version not supported) The server doesn’t support the HTTP protocol version used in the request.

Disclaimer

All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]