Thursday, March 25, 2010

Set timezone using /etc/localtime configuration file [any Linux distro]

Often /etc/localtime is a symlink to the file localtime or to the correct time zone file in the system time zone directory.

Generic procedure to change timezone

Change directory to /etc
# cd /etc

Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtime
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/EST localtime
OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
Please mote that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in the Asia directory you will then have to setup using as above.

Use date command to verify that your timezone is changed:
$ date
Output:

Tue Aug 27 14:46:08 EST 2006

Use of environment variable

You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date

Sample Output:

Thu Aug 27 11:10:08 PST 2006

Wednesday, March 24, 2010

Linux Set Date and Time From a Command Prompt

Linux Set Date

Use the following syntax to set new data and time:
date set="STRING"

For example, set new data to 2 Oct 2006 18:00:00, type the following command as root user:
# date -s "2 OCT 2006 18:00:00"
OR
# date set="2 OCT 2006 18:00:00"

You can also simplify format using following syntax:
# date +%Y%m%d -s "20081128"

Linux Set Time

To set time use the following syntax:
# date +%T -s "10:13:13"
date -s "042616132010"

Friday, March 12, 2010

How to setup http server in beagle board

please Follow below step
  1. Download the software
  2. Extract the software
  3. Compile the code(gcc -o httpd httpd.c -lpthread)
  4. Run output(./httpd)
check port and IP
If you give correct IP and port you will get the page.

Thursday, March 11, 2010

How to run script in Start UP Linux

setting script in Linux start UP
Please do the Following step:
  1. Write a script file(Eg: new_script).
  2. make it executable (Eg:chmod +x new_script ).
  3. Copy the script in to /etc/init.d/
  4. ln -s /etc/init.d/new_script /etc/rc5.d/S50new_script
  5. ln -s /etc/init.d/new_script /etc/rc5.d/K50new_script
  6. Restart the machine.
After the restart your script will work in start up.