How to check an MD5 hash on a file

by Tweak on May 5, 2010
in Linux

MD5 is a one-way hash algorithm as defined by RFC1321 and can be used to help determine the integrity of a file by providing a 128 bit digital signature. This digital signature is like a fingerprint for a file, changing just one single byte in a file will result in a different MD5 hash.

MD5 hashes can be used to catalog files on a filesystem and then determine at a later date that the files have not been altered in any way, for example if someone broke into a system and modified system files.

They can also be used to ensure a file downloaded from a website is the same as expected. This can be especially important when downloading a file from a mirror site to ensure you are not installing a modified program which contains a trojan horse or some other nasty. By simply comparing the MD5 hash of the file you have downloaded from the mirror with that from the original website you can determine whether or not the file is exactly the same.
Read more…

Share and Enjoy:
  • email
  • Print
  • PDF
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • MySpace
  • Live
  • Twitter
  • Yahoo! Buzz

Check / List Running Services

by Tweak on May 4, 2010
in Linux, Servers

Q. How do I list all currently running services in CentOS / RHEL / Fedora Linux server ?

A. There are various ways and tools to find and list all running services under CentOS / RHEL / Fedora Linux systems.

service command – list running services

service --status-all
service --status-all | grep ntpd
service --status-all | less

Read more…

Share and Enjoy:
  • email
  • Print
  • PDF
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • MySpace
  • Live
  • Twitter
  • Yahoo! Buzz

How to Change the Timezone in Linux

by Tweak on November 10, 2009
in Linux, Servers

  1. Logged in as root, check which timezone your machine is currently using by executing `date`. You’ll see something like Mon Nov 9 13:49:01 EST 2009, PST in this case is the current timezone.
  2. Change to the directory /usr/share/zoneinfo here you will find a list of time zone regions. Choose the most appropriate region, if you live in Hong_Kong or the Singapore this directory is the “Asia” directory.
  3. Read more…

Share and Enjoy:
  • email
  • Print
  • PDF
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • MySpace
  • Live
  • Twitter
  • Yahoo! Buzz

System Tuning Info for Linux Servers

by Tweak on June 12, 2009
in Linux, Servers

NOTE: Most of the info on this page is about 3 years, and one or two kernel versions out of date.

This page is about optimizing and tuning Linux based systems for server oriented tasks. Most of the info presented here I’ve used myself, and have found it to be beneficial. I’ve tried to avoid the well tread ground (hdparm, turning off hostname lookups in apache, etc) as that info is easy to find elsewhere.
Some cases where you might want to apply some of benchmarking, high traffic web sites, or in case of any load spike (say, a web transfered virus is pegging your servers with bogus requests)
Read more…

Share and Enjoy:
  • email
  • Print
  • PDF
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • MySpace
  • Live
  • Twitter
  • Yahoo! Buzz

Speed up your system by avoiding the swap file

by Tweak on June 12, 2009
in Servers

Most modern operating systems are capable of using a file or partition known as a swap or paging file. Most Linux distributions will also install one for you by default. This file is used to extend the amount of available RAM by writing some of it to your hard drive.

There’s just one problem: hard drives are slow. We can’t fix that problem yet, but we can avoid it. The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness. A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.
Read more…

Share and Enjoy:
  • email
  • Print
  • PDF
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • MySpace
  • Live
  • Twitter
  • Yahoo! Buzz

All about Linux swap space

by Tweak on June 12, 2009
in Linux, Servers

As well as the swap partition, Linux also supports a swap file that you can create, prepare, and mount in a fashion similar to that of a swap partition. The advantage of swap files is that you don’t need to find an empty partition or repartition a disk to add additional swap space.

To create a swap file, use the dd command to create an empty file. To create a 1GB file, type:

dd if=/dev/zero of=/swapfile bs=1024 count=1048576

/swapfile is the name of the swap file, and the count of 1048576 is the size in kilobytes (i.e. 1GB).

Prepare the swap file using mkswap just as you would a partition, but this time use the name of the swap file:

mkswap /swapfile
Read more…

Share and Enjoy:
  • email
  • Print
  • PDF
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • MySpace
  • Live
  • Twitter
  • Yahoo! Buzz

Useful commands for the Linux command line

by Tweak on June 8, 2009
in Linux

This short guide shows some important commands for your daily work on the Linux command line.

  • arch
    Outputs the processor architecture.

    $ arch

    i686

  • Read more…

Share and Enjoy:
  • email
  • Print
  • PDF
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • MySpace
  • Live
  • Twitter
  • Yahoo! Buzz