<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/book-excerpt">
  <channel>
    <title>Book Excerpt</title>
    <link>https://www.linuxjournal.com/tag/book-excerpt</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Book Excerpt: DevOps Troubleshooting: Linux Server Best Practices</title>
  <link>https://www.linuxjournal.com/content/book-excerpt-devops-troubleshooting-linux-server-best-practices</link>
  <description>  &lt;div data-history-node-id="1084378" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/devops-cover.jpg" width="160" height="209" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/kyle-rankin" lang="" about="https://www.linuxjournal.com/users/kyle-rankin" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Kyle Rankin&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;This excerpt is from the book, 'DevOps Troubleshooting: Linux Server Best Practices' by Kyle Rankin, published by Pearson/Addison-Wesley Professional, ISBN 0321832043, Nov 2012, Copyright 2013 Pearson Education, Inc. 
For more info please visit: 
&lt;a href="http://www.informit.com/store/devops-troubleshooting-linux-server-best-practices-9780321832047"&gt;http://www.informit.com/store/devops-troubleshooting-linux-server-best-practices-9780321832047&lt;/a&gt;
&lt;/p&gt;
&lt;h2&gt;Chapter 8: Is the Website Down? Tracking Down Web Server Problems &lt;/h2&gt;
&lt;h3&gt;Get Web Server Statistics&lt;/h3&gt;
&lt;p&gt;Although there’s a fair amount of web server troubleshooting you can perform outside of the server itself, ultimately you will get in a situation where you want to know this type of information: How many web server processes are currently serving requests? How many web server processes are idle? What are the busy processes doing right now? To pull data like this, you can enable a special server status page that gives you all sorts of useful server statistics.&lt;/p&gt;
&lt;p&gt;Both Apache and Nginx provide a server status page. In the case of Apache, it requires that you enable a built-in module named status. How modules are enabled varies depending on your distribution; for example, on an Ubuntu server, you would type a2enmod status. On other distributions you may need to browse through the Apache configuration files and look for a commented-out section that loads the status module; it may look something like this:&lt;/p&gt;
&lt;pre&gt;LoadModule status_module /usr/lib/apache2/modules/mod_status.so&lt;/pre&gt;
&lt;p&gt;After the module is loaded on Ubuntu systems, the server-status page is already configured for use by localhost. On other systems you may need to add configuration like the following to your Apache configuration:&lt;/p&gt;
&lt;pre&gt;ExtendedStatus On
&lt;IfModule mod_status.c&gt;
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Uncomment and change the ".example.com" to allow
# access from other hosts.
#
&lt;Location /server-status&gt;
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost ip6-localhost
#    Allow from .example.com
&lt;/Location&gt;

&lt;/IfModule&gt;&lt;/pre&gt;
&lt;p&gt;Note that in this configuration example, we have really locked down who can access the page by saying deny from all hosts and only allow from localhost. This is a safe default because you generally don’t want the world to be able to view this kind of debugging information. As you can see in the commented-out example, you can add additional Allow from statements to add IPs or hostnames that are allowed to view the page.&lt;/p&gt;
&lt;p&gt;For Nginx, you would add a configuration like the following to your existing Nginx config. In this example, Nginx will only listen on localhost, but you could change this to allow other machines on your local network:&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/book-excerpt-devops-troubleshooting-linux-server-best-practices" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Wed, 13 Mar 2013 14:00:00 +0000</pubDate>
    <dc:creator>Kyle Rankin</dc:creator>
    <guid isPermaLink="false">1084378 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Book Excerpt: A Practical Guide to Fedora and Red Hat Enterprise Linux</title>
  <link>https://www.linuxjournal.com/content/book-exercpt-practical-guide-fedora-and-red-hat-enterprise-linux</link>
  <description>  &lt;div data-history-node-id="1026574" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/FandRHEL.jpg" width="386" height="480" alt="A Practical Guide to Fedora and Red Hat Enterprise Linux cover" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/mark-sobell-0" lang="" about="https://www.linuxjournal.com/users/mark-sobell-0" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Mark Sobell&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;h2&gt;The init Daemon&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;init&lt;/strong&gt; daemon is the system and service manager for Linux. It is the first true process Linux starts when it boots and as such, has a PID of 1 and is the ancestor of all processes. The &lt;strong&gt;init&lt;/strong&gt; daemon has been around since the early days of UNIX, and many people have worked to improve it. The first Linux &lt;strong&gt;init&lt;/strong&gt; daemon was based on the UNIX System V &lt;strong&gt;init&lt;/strong&gt; daemon and is referred to as SysVinit (System V &lt;strong&gt;init&lt;/strong&gt; daemon).&lt;/p&gt;
&lt;p&gt;Because SysVinit does not deal
  well with modern hardware, including
  hotplug devices,
  USB hard and flash drives, and
  network-mounted filesystems,
  Fedora/RHEL recently replaced
  it with the Upstart &lt;strong&gt;init&lt;/strong&gt; daemon
  (&lt;a href="http://upstart.ubuntu.com/" target="new"&gt;http://upstart.ubuntu.com/&lt;/a&gt; and
  &lt;a href="http://upstart.ubuntu.com/wiki" target="new"&gt;http://upstart.ubuntu.com/wiki&lt;/a&gt;).
   Fedora 15 has
moved past Upstart to systemd &lt;strong&gt;init&lt;/strong&gt; daemon,
which is described next. Several
other replacements for SysVinit
are also available. One of the
most prominent is &lt;span class="style1"&gt;initng&lt;/span&gt; (&lt;a href="http://initng.sourceforge.net/trac" target="new"&gt;http://initng.sourceforge.net/trac&lt;/a&gt;).
In addition, Solaris uses SMF (Service
Management Facility), and MacOS
uses &lt;strong&gt;launchd&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;The systemd init Daemon (Fedora)&lt;/h3&gt;
&lt;p&gt;The name &lt;em&gt;systemd&lt;/em&gt; comprises &lt;em&gt;system,&lt;/em&gt; which systemd manages, followed by &lt;em&gt;d.&lt;/em&gt; Under UNIX/Linux, daemon names frequently end in &lt;strong&gt;d&lt;/strong&gt;: systemd is the system daemon. At boot time, systemd renames itself &lt;strong&gt;init&lt;/strong&gt;, so you will not see a process named systemd. However, &lt;strong&gt;init&lt;/strong&gt; is simply a link to systemd:&lt;/p&gt;
&lt;pre&gt;$ &lt;strong&gt;ls -l /sbin/init&lt;/strong&gt;
lrwxrwxrwx. 1 root root 14 04-22 08:47 /sbin/init -&gt; ../bin/systemd&lt;/pre&gt;
&lt;p&gt;The name is also a play on words
  with &lt;em&gt;System D,&lt;/em&gt; a reference
  to the French dérouillard
  (to untangle) or démerder.
  System D is a manner of responding
  to challenges that requires fast
  thinking, adapting, and improvising.&lt;/p&gt;
&lt;p&gt;The systemd &lt;strong&gt;init&lt;/strong&gt; daemon is a drop-in replacement for SysVinit; most of the administration tools that worked with SysVinit and Upstart work with systemd. Although systemd is new, most of the user interfaces pertinent to administrators will remain stable (&lt;a href="http://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise" target="new"&gt;http://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise&lt;/a&gt;). A GUI to systemd is under development.&lt;/p&gt;
&lt;h3&gt;More Information&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Local&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Use apropos to list man pages that pertain to systemd (&lt;strong&gt;apropos systemd&lt;/strong&gt;). Some of the most interesting of these are &lt;strong&gt;systemd&lt;/strong&gt;, systemctl, systemd.unit, and systemd.special.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Web&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/book-exercpt-practical-guide-fedora-and-red-hat-enterprise-linux" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 10 Nov 2011 17:09:53 +0000</pubDate>
    <dc:creator>Mark Sobell</dc:creator>
    <guid isPermaLink="false">1026574 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Book Excerpt: The Python Standard Library by Example</title>
  <link>https://www.linuxjournal.com/content/book-excerpt-python-standard-library-example%E2%80%99</link>
  <description>  &lt;div data-history-node-id="1025986" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/pythoncover.jpg" width="373" height="480" alt="The Python Standard Library by Example book cover" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/doug-hellmann-0" lang="" about="https://www.linuxjournal.com/users/doug-hellmann-0" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Doug Hellmann&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;h2&gt;Chapter 3: Algorithms&lt;/h2&gt;
&lt;p&gt;Python includes several modules for implementing algorithms elegantly and concisely using whatever style is most appropriate for the task. It supports purely procedural, object-oriented, and functional styles. All three styles are frequently mixed within different parts of the same program. &lt;/p&gt;
&lt;p&gt;functools includes functions for creating function decorators, enabling aspect-oriented programming and code reuse beyond what a traditional object-oriented approach supports. It also provides a class decorator for implementing all rich comparison APIs using a shortcut and partial objects for creating references to functions with their arguments included. &lt;/p&gt;
&lt;p&gt;The itertools module includes functions for creating and working with iterators and generators used in functional programming. The operator module eliminates the need for many trivial lambda functions when using a functional programming style by providing function-based interfaces to built-in operations, such as arithmetic or item lookup. &lt;/p&gt;
&lt;p&gt;contextlib makes resource management easier, more reliable, and more concise for all programming styles. Combining context managers and the with statement reduces the number of try:finally blocks and indentation levels needed, while ensuring that files, sockets, database transactions, and other resources are closed and released at the right time. &lt;/p&gt;
&lt;h2&gt;3.1 functools—Tools for Manipulating Functions &lt;/h2&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt; Functions that operate on other functions. &lt;/p&gt;
  &lt;p&gt;&lt;strong&gt;Python
  Version&lt;/strong&gt; 2.5 and later &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The functools module provides tools for adapting or extending functions and other callable objects, without completely rewriting them. &lt;/p&gt;
&lt;h3&gt;3.1.1 Decorators &lt;/h3&gt;
&lt;p&gt;The primary tool supplied by the functools module is the class partial, which can be used to “wrap” a callable object with default arguments. The resulting object is itself callable and can be treated as though it is the original function. It takes all the same arguments as the original, and it can be invoked with extra positional or named arguments as well. A partial can be used instead of a lambda to provide default arguments to a function, while leaving some arguments unspecified. &lt;/p&gt;
&lt;h4&gt;Partial Objects &lt;/h4&gt;
&lt;p&gt;This example shows two simple partial objects for the function myfunc(). The output of show_details() includes the func, args, and keywords attributes of the partial object. &lt;/p&gt;

  
&lt;pre&gt;&lt;strong&gt;import functools 

def&lt;/strong&gt; myfunc(a, b=2): 
  """Docstring for myfunc().""" 
&lt;strong&gt;  print ’&lt;/strong&gt; &lt;em&gt;called myfunc with:’&lt;/em&gt;, (a, b) 
&lt;strong&gt;  return &lt;/strong&gt;

&lt;strong&gt;def &lt;/strong&gt;show_details(name, f, is_partial=False): 
    &lt;em&gt;"""Show details of a callable object.""" &lt;/em&gt;
&lt;strong&gt;    prin&lt;/strong&gt;t &lt;em&gt;’&lt;strong&gt;%s&lt;/strong&gt;:&lt;/em&gt;’ % name 
&lt;strong&gt;    prin&lt;/strong&gt;t ’ &lt;em&gt;object:’&lt;/em&gt;,f &lt;/pre&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/book-excerpt-python-standard-library-example%E2%80%99" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 20 Oct 2011 15:20:31 +0000</pubDate>
    <dc:creator>Doug Hellmann</dc:creator>
    <guid isPermaLink="false">1025986 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Book Excerpt: Practical Guide to Ubuntu Linux, A, 3rd Edition</title>
  <link>https://www.linuxjournal.com/content/book-excerpt-practical-guide-ubuntu-linux-3rd-edition</link>
  <description>  &lt;div data-history-node-id="1015878" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/sobellbook.jpeg" width="388" height="480" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/user/800005" lang="" about="https://www.linuxjournal.com/user/800005" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;LJ Staff&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.informit.com/title/013254248X"&gt;Excerpt from &lt;em&gt;Practical Guide to Ubuntu Linux, A, 3rd Edition&lt;/em&gt;.&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;By Mark G. Sobell&lt;br /&gt; 			Published by Prentice Hall&lt;br /&gt; 			ISBN-10: 0-13-254248-X&lt;br /&gt; 			ISBN-13: 978-0-13-254248-7&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h1&gt;Securing a Server&lt;/h1&gt;
&lt;p&gt;Two ways you can secure a server are by using TCP wrappers and by setting up a chroot jail. This section describes both techniques.&lt;/p&gt;
&lt;h2&gt;TCP Wrappers: Secure a Server (hosts.allow and hosts.deny)&lt;/h2&gt;
&lt;p&gt;Follow these guidelines when you open a local system to access from remote systems:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Open the local system only to systems you want to allow to access it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Allow each remote system to access only the data you want it to access.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Allow each remote system to access data only in the appropriate manner (readonly, read/write, write only).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;h4&gt;libwrap&lt;/h4&gt;
&lt;p&gt;As part of the client/server model, TCP wrappers, which can be used for any daemon that is linked against &lt;strong&gt;libwrap&lt;/strong&gt;, rely on the &lt;strong&gt;/etc/hosts.allow&lt;/strong&gt; and &lt;strong&gt;/etc/hosts.deny&lt;/strong&gt; files as the basis of a simple access control language (ACL). This access control language defines rules that selectively allow clients to access server daemons on a local system based on the client’s address and the daemon the client tries to access. The output of ldd shows that one of the shared library dependencies of &lt;strong&gt;sshd&lt;/strong&gt; is &lt;strong&gt;libwrap&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;$ &lt;strong&gt;ldd /usr/sbin/sshd | grep libwrap&lt;/strong&gt;
		libwrap.so.0 =&gt; /lib/libwrap.so.0 (0xb7ec7000)&lt;/pre&gt;&lt;h4&gt;&lt;strong&gt;hosts.allow&lt;/strong&gt; and &lt;strong&gt;hosts.deny&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Each line in the &lt;strong&gt;hosts.allow&lt;/strong&gt; and &lt;strong&gt;hosts.deny&lt;/strong&gt; files has the following format:&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;daemon_list&lt;/strong&gt; : &lt;strong&gt;client_list&lt;/strong&gt; [: &lt;strong&gt;command&lt;/strong&gt;]&lt;/pre&gt;&lt;p&gt;where &lt;strong&gt;&lt;em&gt;daemon_list&lt;/em&gt;&lt;/strong&gt; is   a comma-separated list of one   or more server daemons (such   as &lt;strong&gt;portmap&lt;/strong&gt;, &lt;strong&gt;vsftpd&lt;/strong&gt;,   and &lt;strong&gt;sshd&lt;/strong&gt;), &lt;strong&gt;&lt;em&gt;client_list&lt;/em&gt;&lt;/strong&gt; is   a comma-separated list of one or more clients, and the optional &lt;strong&gt;&lt;em&gt;command&lt;/em&gt;&lt;/strong&gt; is the command that is executed when a client from &lt;strong&gt;&lt;em&gt;client_list&lt;/em&gt;&lt;/strong&gt; tries to access a server daemon from &lt;strong&gt;&lt;em&gt;daemon_list.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When a client requests a connection to a server, the &lt;strong&gt;hosts.allow&lt;/strong&gt; and &lt;strong&gt;hosts.deny&lt;/strong&gt; files on the server system are consulted in the following order until a match is found:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;
&lt;p&gt;If the daemon/client pair matches a line in &lt;strong&gt;hosts.allow&lt;/strong&gt;, access is granted.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the daemon/client pair matches a line in &lt;strong&gt;hosts.deny&lt;/strong&gt;, access is denied.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/book-excerpt-practical-guide-ubuntu-linux-3rd-edition" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 11 Nov 2010 15:00:00 +0000</pubDate>
    <dc:creator>LJ Staff</dc:creator>
    <guid isPermaLink="false">1015878 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Book Excerpt: Linux Kernel Development, 3rd Edition.</title>
  <link>https://www.linuxjournal.com/content/book-excerpt-linux-kernel-development-3rd-edition</link>
  <description>  &lt;div data-history-node-id="1015189" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/linuxkerneldevelopment.jpeg" width="373" height="480" alt="Linux Kernel Development cover" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/user/800005" lang="" about="https://www.linuxjournal.com/user/800005" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;LJ Staff&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.informit.com/title/0672329468"&gt;Excerpt from &lt;em&gt;Linux Kernel Development, 3rd Edition&lt;/em&gt;.&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;By Robert Love&lt;br /&gt; 			Published by Addison-Wesley Professional&lt;br /&gt; 			ISBN-10: 0-672-32946-8&lt;br /&gt; 			ISBN-13: 978-0-672-32946-3&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h1&gt;Chapter 2: Getting Started with the Kernel&lt;/h1&gt;
&lt;p&gt;In this chapter, we introduce some of the basics of the Linux kernel: where to get its source, how to compile it, and how to install the new kernel. We then go over the differences between the kernel and user-space programs and common programming constructs used in the kernel. Although the kernel certainly is unique in many ways, at the end of the day it is little different from any other large software project.&lt;/p&gt;
&lt;h2&gt;Obtaining the Kernel Source&lt;/h2&gt;
&lt;p&gt;The current Linux source code is always available in both a complete tarball (an archive created with the tar command) and an incremental patch from the official home of the Linux kernel, &lt;a href="http://www.kernel.org"&gt;http://www.kernel.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Unless you have a specific reason to work with an older version of the Linux source, you always want the latest code. The repository at kernel.org is the place to get it, along with additional patches from a number of leading kernel developers.&lt;/p&gt;
&lt;h3&gt;Using Git&lt;/h3&gt;
&lt;p&gt;Over the last couple of years, the kernel hackers, led by Linus himself, have begun using a new version control system to manage the Linux kernel source. Linus created this system, called Git, with speed in mind. Unlike traditional systems such as CVS, Git is distributed, and its usage and workflow is consequently unfamiliar to many developers. I strongly recommend using Git to download and manage the Linux kernel source.&lt;/p&gt;
&lt;p&gt;You can use Git to obtain a copy of the latest “pushed” version of Linus’s tree:&lt;/p&gt;
&lt;pre&gt;$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git&lt;/pre&gt;&lt;p&gt;When checked out, you can update your tree to Linus’s latest:&lt;/p&gt;
&lt;pre&gt;$ git pull&lt;/pre&gt;&lt;p&gt;With these two commands, you can obtain and subsequently keep up to date with the official kernel tree. To commit and manage your own changes, see Chapter 20, “Patches, Hacking, and the Community.” A complete discussion of Git is outside the scope of this book; many online resources provide excellent guides.&lt;/p&gt;
&lt;h3&gt;Installing the Kernel Source&lt;/h3&gt;
&lt;p&gt;The kernel tarball is distributed in both GNU zip (gzip) and bzip2 format. Bzip2 is the default and preferred format because it generally compresses quite a bit better than gzip. The Linux kernel tarball in bzip2 format is named linux-&lt;em&gt;x&lt;/em&gt;.&lt;em&gt;y&lt;/em&gt;.&lt;em&gt;z&lt;/em&gt;.tar.bz2, where &lt;em&gt;x.y.z&lt;/em&gt; is the version of that particular release of the kernel source. After downloading the source, uncompressing and untarring it is simple. If your tarball is compressed with bzip2, run&lt;/p&gt;
&lt;pre&gt;$ tar xvjf linux-x.y.z.tar.bz2&lt;/pre&gt;&lt;p&gt;If it is compressed with GNU zip, run&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/book-excerpt-linux-kernel-development-3rd-edition" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Fri, 15 Oct 2010 13:00:00 +0000</pubDate>
    <dc:creator>LJ Staff</dc:creator>
    <guid isPermaLink="false">1015189 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Book Excerpt: A Practical Guide to Linux Commands, Editors, and Shell Programming</title>
  <link>https://www.linuxjournal.com/content/book-excerpt-chapter-12-practical-guide-linux-commands-editors-and-shell-programming</link>
  <description>  &lt;div data-history-node-id="1009930" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/cover2.jpg" width="640" height="320" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/user/800005" lang="" about="https://www.linuxjournal.com/user/800005" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;LJ Staff&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
This article is an excerpt from the new 2nd Ed. of Mark Sobell's book,
&lt;cite&gt;A Practical Guide to Linux Commands, Editors, and Shell Programming&lt;/cite&gt;,
published Nov. 2009 by Prentice Hall Professional, ISBN 0131367366,
Copyright 2010 Mark G. Sobell. For additional sample content from a
selection of chapters, please visit the publisher site:
&lt;a href="http://www.informit.com/title/0131367366"&gt;www.informit.com/title/0131367366&lt;/a&gt;
&lt;/p&gt;
&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/book-excerpt-chapter-12-practical-guide-linux-commands-editors-and-shell-programming" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Fri, 05 Mar 2010 20:53:47 +0000</pubDate>
    <dc:creator>LJ Staff</dc:creator>
    <guid isPermaLink="false">1009930 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Book Excerpt: Chapter 4 of Citizen Engineer</title>
  <link>https://www.linuxjournal.com/content/book-excerpt-chapter-4-citizen-engineer</link>
  <description>  &lt;div data-history-node-id="1009926" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/cover.jpg" width="125" height="188" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/user/800005" lang="" about="https://www.linuxjournal.com/user/800005" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;LJ Staff&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
This chapter excerpt is from &lt;cite&gt;Citizen Engineer: A Handbook for
Socially Responsible Engineering&lt;/cite&gt; by David Douglas and Greg
Papadopoulos, with John Boutelle, published by Prentice Hall
Professional, ISBN 0137143923, Copyright 2010 David Douglas and Greg
Papadopoulos. For more info, please visit the publisher page: &lt;a href="http://www.informit.com/title/0137143923"&gt;
www.informit.com/title/0137143923&lt;/a&gt;
&lt;/p&gt;
&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/book-excerpt-chapter-4-citizen-engineer" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Fri, 19 Feb 2010 15:26:39 +0000</pubDate>
    <dc:creator>LJ Staff</dc:creator>
    <guid isPermaLink="false">1009926 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
