Thursday, October 15, 2009

swap file creating

when some programs consume huge amount of virtual memory, make use of temporary SWAP space.
This can be achieved by mkswap and swapon

* For EG: To have 64 MB extra swap space

dd if=/dev/zero of=/swapfile bs=1024 count=65535
mkswap /swapfile
swapon /swapfile

where “/swapfile” is the swap filename. The location of this file depends on the availabilty of File System’s Space and the write permission.

when you dont need this anymore, remove it using the following commands

swapoff /swapfile
rm /swapfile

Tuesday, October 13, 2009

Error from domain wrapper: domainname.com is owned by another user

I got this error when I was trying to add subdomains to one of my cPanel accounts. This happens when cPanel doesn’t remove the subdomain correctly and then it thinks it’s still there so when you try to add it back on you get an error. Here’s how to fix it:

1. Remove domain.com from /var/cpanel/users/cpanel-username

3. Run /scripts/updateuserdomains as root user on the server because you changed the above file manually, this will create adjusted cache files

2. Remove /var/named/domain.com.db if the file exists (it doesn’t always)

3. Remove the virtualhost for domain.com on /usr/local/apache/conf/httpd.conf

4. Remove domain.com from /etc/named.conf

Now you can add the domain back on in cPanel with no problems.


20 Linux System Monitoring Tools Every SysAdmin Should Know

Need to monitor Linux server performance? Try these built-in command and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a performance problem. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as:

  1. Finding out bottlenecks.
  2. Disk (storage) bottlenecks.
  3. CPU and memory bottlenecks.
  4. Network bottlenecks.

1: top - Process Activity Command

The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds.


2: vmstat - System Activity, Hardware and System Information

The command vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.

# vmstat 3

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 2540988 522188 5130400 0 0 2 32 4 2 4 1 96 0 0
1 0 0 2540988 522188 5130400 0 0 0 720 1199 665 1 0 99 0 0
0 0 0 2540956 522188 5130400 0 0 0 0 1151 1569 4 1 95 0 0
0 0 0 2540956 522188 5130500 0 0 0 6 1117 439 1 0 99 0 0
0 0 0 2540940 522188 5130512 0 0 0 536 1189 932 1 0 98 0 0
0 0 0 2538444 522188 5130588 0 0 0 0 1187 1417 4 1 96 0 0

Display Memory Utilization Slabinfo

# vmstat -m

Get Information About Active / Inactive Memory Pages

# vmstat -a


3: w - Find Out Who Is Logged on And What They Are Doing

w command displays information about the users currently on the machine, and their processes.

Sample Output:
17:58:47 up 5 days, 20:28,  2 users,  load average: 0.36, 0.26, 0.24
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 10.1.3.145 14:55 5.00s 0.04s 0.02s vim /etc/resolv.conf
root pts/1 10.1.3.145 17:43 0.00s 0.03s 0.00s w

4: uptime - Tell How Long The System Has Been Running

The uptime command can be used to see how long the server has been running. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

Output:
18:02:41 up 41 days, 23:42,  1 user,  load average: 0.00, 0.00, 0.00

1 can be considered as optimal load value. The load can change from
system to system. For a single CPU system 1 - 3 and SMP systems 6-10


load value might be acceptable.

How do I find out Linux Resource utilization

vmstat command reports information about processes, memory, paging, block IO, traps, and cpu activity. However, a real advantage of vmstat command output - is to the point and (concise) easy to read/understand. The output of vmstat command use to help identify system bottlenecks. Please note that Linux vmstat does not count itself as a running process.

Here is an output of vmstat command from my enterprise grade system:

$ vmstat -S M

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
3 0 0 1963 607 2359 0 0 0 0 0 1 32 0 68 0

Where,

  • The fist line is nothing but six different categories. The second line gives more information about each category. This second line gives all data you need.
  • -S M: vmstat lets you choose units (k, K, m, M) default is K (1024 bytes) in the default mode. I am using M since this system has over 4 GB memory. Without -M option it will use K as unit

Field Description For Vm Mode

(a) procs is the process-related fields are:

  • r: The number of processes waiting for run time.
  • b: The number of processes in uninterruptible sleep.

(b) memory is the memory-related fields are:

  • swpd: the amount of virtual memory used.
  • free: the amount of idle memory.
  • buff: the amount of memory used as buffers.
  • cache: the amount of memory used as cache.

(c) swap is swap-related fields are:

  • si: Amount of memory swapped in from disk (/s).
  • so: Amount of memory swapped to disk (/s).

(d) io is the I/O-related fields are:

  • bi: Blocks received from a block device (blocks/s).
  • bo: Blocks sent to a block device (blocks/s).

(e) system is the system-related fields are:

  • in: The number of interrupts per second, including the clock.
  • cs: The number of context switches per second.

(f) cpu is the CPU-related fields are:

These are percentages of total CPU time.

  • us: Time spent running non-kernel code. (user time, including nice time)
  • sy: Time spent running kernel code. (system time)
  • id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
  • wa: Time spent waiting for IO. Prior to Linux 2.5.41, shown as zero.

As you see the first output produced gives averages data since the last reboot. Additional reports give information on a sampling period of length delay. You need to sample data using delays i.e. collect data by setting intervals. For example collect data every 2 seconds (or collect data every 2 second 5 times only):


Role Of A Sustem Administrator

The person who is responsible for setting up and maintaining the system is called as the system administrator. System administrators may be members of an information technology department. Most of the following discussion also applies to network and Windows system admins.

Duties of a system administrator

The duties of a system administrator are wide-ranging, and vary widely from one organization to another. Sysadmins are usually charged with installing, supporting, and maintaining servers or other computer systems, and planning for and responding to service outages and other problems. Other duties may include scripting or light programming, project management for systems-related projects.

The system administrator is responsible for following things:

  1. User administration (setup and maintaining account)
  2. Maintaining system
  3. Verify that peripherals are working properly
  4. Quickly arrange repair for hardware in occasion of hardware failure
  5. Monitor system performance
  6. Create file systems
  7. Install software
  8. Create a backup and recover policy
  9. Monitor network communication
  10. Update system as soon as new version of OS and application software comes out
  11. Implement the policies for the use of the computer system and network
  12. Setup security policies for users. A sysadmin must have a strong grasp of computer security (e.g. firewalls and intrusion detection systems).


Monday, July 27, 2009

For The Linux ADMIN's

Please check the following URL's for the getting help in all type of LINUX server issues:

1) http://nazeem86.blogspot.com

2) http://jibinthomas.blogspot.com

3) http://scorpio-jibin.blogspot.com

BOOKS

100 Best Books

Here is a list of one hundred books selected by the National Education Association in 1999 as great reading for children and young people. To help make these books more useful, we have added book and author links to any TeachersFirst resources and lesson ideas. For more reading ideas - including books grouped by theme and grade level - check out the hundreds of titles in our Suggested Reading section.

You can see NEA's online survey of best books from 2007 here.

TeachersFirst includes the most recent publications in our monthly TogetheRead themes on our companion site, TeachersAndFamilies. Don't miss these opportunities to promote literacy as a family activity!

Books for All Ages

The Giving Tree by Shel Silverstein
Where the Sidewalk Ends: the Poems and Drawing of Shel Silverstein by Shel Silverstein
Little Women by Louisa May Alcott
The Wizard of Oz by L. Frank Baum
Heidi by Johanna Spyri

Books for Preschoolers -

The Very Hungry Caterpillar by Eric Carle
Goodnight Moon by Margaret Wise Brown
Brown Bear, Brown Bear, What do you see? by Bill Martin, Jr.
The Rainbow Fish by Marcus Pfister
Corduroy by Don Freeman
The Snowy Day by Ezra Jack Keats
The Runaway Bunny by Margaret Wise
Guess How Much I Love You by Sam McBratney

Books for Children Ages 4-8 -

The Polar Express by Chris Van Allsburg
Green Eggs and Ham by Dr. Seuss
The Cat in the Hat by Dr. Seuss
Where the Wild Things Are by Maurice Sendak
Love You Forever by Robert N. Munsch
The Mitten by Jan Brett
Stellaluna by Janell Cannon
Oh, The Places You'll Go by Dr. Seuss
Strega Nona by Tomie De Paola
The Velveteen Rabbit by Margery Williams
How the Grinch Stole Christmas by Dr. Seuss
The True Story of the Three Little Pigs by Jon Scieszka
Chicka Chicka Boom Boom by John Archambault
The Complete Tales of Winnie the Pooh by A. A. Milne
If You Give a Mouse a Cookie by Laura Joffe Numeroff
The Lorax by Dr. Seuss
Amazing Grace by Mary Hoffman
Jumanji by Chris Van Allsburg
Math Curse by Jon Scieszka
Are You My Mother? by Philip D. Eastman
The Napping House by Audrey Wood
Sylvester and the Magic Pebble by William Steig
The Tale of Peter Rabbit by Beatrix Potter
Horton Hatches the Egg by Dr. Seuss
Basil of Baker Street by Eve Titus
The Little Engine That Could by Watty Piper
Curious George by Hans Augusto Rey
Wilfrid Gordon McDonald Partridge by Mem Fox
Arthur series by Marc Tolon Brown
Lilly's Purple Plastic Purse by Kevin Henkes
The Little House by Virginia Lee Burton
Amelia Bedelia by Peggy Parish
The Art Lesson by Tomie De Paola
Caps for Sale by Esphyr Slobodkina
Clifford, the Big Red Dog by Norman Bridwell
The Paper Bag Princess by Robert N. Munsch

Books for Children Ages 9-12 -

Charlotte's Web by E. B. White
Hatchet by Gary Paulsen
The Lion, the Witch, and the Wardrobe by C. S. Lewis
Bridge to Terabithia by Katherine Paterson
Charlie and the Chocolate Factory by Roald Dahl
A Wrinkle in Time by Madeleine L'Engle
Shiloh by Phyllis Reynolds Naylor
Little House on the Prarie by Laura Ingalls Wilder
The Secret Garden by Frances Hodgson Burnett
The Boxcar Children by Gertrude Chandler Warner
Sarah, Plain and Tall by Patricia MacLachlan
The Indian in the Cupboard by Lynne Reid Banks
Island of the Blue Dolphins by Scott O'Dell
Maniac Magee by Jerry Spinelli
The BFG by Roald Dahl
The Giver by Lois Lowry
James and the Giant Peach: A Children's Story by Roald Dahl
Little House in the Big Woods by Laura Ingalls Wilder
Roll of Thunder, Hear My Cry by Mildred D. Taylor
Stone Fox by John Reynolds Gardiner
Number the Stars by Lois Lowry
Mrs. Frisby and the Rats of Nimh by Robert C. O'Brien
The Best Christmas Pageant Ever by Barbara Robinson
Matilda by Roald Dahl
Tales of a Fourth Grade Nothing by Judy Blume
Ramona Quimby, Age 8 by Beverly Cleary
The Trumpet of the Swan by E. B. White
The Chronicles of Narnia by C. S. Lewis
The Phantom Tollbooth by Norton Juster
Tuck Everlasting by Natalie Babbitt
Anne of Green Gables by Lucy Maud Montgomery
The Great Gilly Hopkins by Katherine Paterson
Sideways Stories from Wayside School by Louis Sachar
Harriet the Spy by Louise Fitzhugh
A Light in the Attic by Shel Silverstein
Mr. Popper's Penguins by Richard Atwater
My Father's Dragon by Ruth Stiles Gannett
Stuart Little by E. B. White
Walk Two Moons by Sharon Creech
The Witch of Blackbird Pond by Elizabeth George Speare
The Watsons Go to Birmingham-1963 by Christopher Paul Curtis

Books for Young Adults -

Where the Red Fern Grows by Wilson Rawls
The Hobbit by J. R. R. Tolkien
Summer of the Monkeys by Wilson Rawls
The Cay by Theodore Taylor
The Sign of the Beaver by Elizabeth George Speare