useful things about linux

How to change system time on CentOS

http://abdussamad.com/archives/343-CentOS-Linux:-Setting-timezone-and-synchronizing-time-with-NTP-.html

    1. Setting the timezone

      • Login as root
      • To see what the current timezone is: “date
      • To change the timezone first look at what timezones are available by running the following command on the command line interface: “ls /usr/share/zoneinfo
      • Then simply delete the current timezone: “rm /etc/localtime
      • And replace it with a symbolic link to the new timezone from /usr/share/zoneinfo. For example if your chosen zone is Pacific time: “ln –s /usr/share/zoneinfo/PST8PDT /etc/localtime”
    2. Synchronizing time with NTP server

      • Network Time Protocol (NTP) is a standard way of synchronizing computer clocks across a network. Using NTP you can keep your server’s clock synchronized with super accurate atomic clocks located around the world. Computer clocks tend to “drift” so regularly synchronizing them with NTP servers helps keep them accurate.
        The first step is to make sure you have the ntp program installed. Do a: “which ntpdate
      • If its not available type: “yum install ntp
      • Once ntp is installed synchronize your computer clock with: “ntpdate 0.us.pool.ntp.org
      • You are not limited to the above server. There are numerous NTP servers around the world. You can find a complete list at ntp.org.
        Also keep in mind that ntp only affects the system time. The hardware clock on your server will not reflect that. So you want to set it as well so that the correct time is maintained after reboot: “hwclock --systohc
    3. ntpd

To keep your server clock automatically synchronized you can run the ntpd daemon which is installed as part of the ntp package.
Edit the /etc/ntp.conf file to comment out the following lines:
#server 127.127.1.0 # local clock
#fudge 127.127.1.0 stratum 10

The above two lines can sometimes prevent ntpd from properly synchronizing your clock. They are already commented out by default on CentOS/RHEL 6. But on 5.x you have to comment them out manually.
Finally type the following two commands to start the daemon and make it run automatically at boot up:
"service ntpd start"
"chkconfig ntpd on"


How to Create Desktop Shortcuts in Ubuntu

Type the following command at the prompt and press Enter

sudo apt-get install --no-install-recommends gnome-panel

The --no-install-recommends option makes sure that only the required packages and no recommended packages get installed. This saves space on your hard drive.

When the installation is done, you can create a new shortcut using the command line. Type the following command at the prompt and press Enter.

gnome-desktop-item-edit --create-new ~/Desktop

You can also create shortcuts by pressing Alt + F2, entering the command listed above in the edit box, and pressing Enter. The Create Launcher dialog box displays as shown above and you can create another shortcut.


How to easily resize images in linux

Open a terminal and run this command:

convert  -resize 50% source.png dest.jpg

It will reduce the size by 50%

You can also specify the size:

convert  -resize 1024X768  source.png dest.jpg

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s